- Timestamp:
- Apr 4, 2007 8:25:13 AM (18 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 1 deleted
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile
r1723 r1912 92 92 VBoxDD_SDKS.win = WINPSDK DXSDK W2K3DDK VBOX_NTDLL 93 93 VBoxDD_SOURCES = \ 94 Builtins.cpp \ 95 muldiv64.c 94 Builtins.cpp 96 95 VBoxDD_DEFS = VBOX_ACPI 97 96 ifdef VBOX_WITH_USB … … 181 180 Network/DevPCNet.cpp \ 182 181 Audio/DevIchAc97.cpp \ 183 PC/ dma.c\182 PC/DevDMA.cpp \ 184 183 Storage/fdc.c \ 185 184 Serial/DevSerial.cpp … … 216 215 $(PATH_CURRENT) 217 216 VBoxDDGC_SOURCES = \ 218 muldiv64.c \219 217 Bus/DevPCI.cpp \ 220 218 Graphics/DevVGA.cpp \ … … 253 251 $(PATH_CURRENT) 254 252 VBoxDDR0_SOURCES = \ 255 muldiv64.c \256 253 Bus/DevPCI.cpp \ 257 254 Graphics/DevVGA.cpp \ -
trunk/src/VBox/Devices/PC/DevACPI.cpp
r491 r1912 26 26 #include <VBox/log.h> 27 27 #include <iprt/assert.h> 28 #include <iprt/asm.h> 28 29 #ifdef IN_RING3 29 30 #include <iprt/alloc.h> … … 871 872 872 873 freq = TMTimerGetFreq (s->CTXSUFF(ts)); 873 interval = muldiv64(0xffffffff, freq, PM_TMR_FREQ);874 interval = ASMMultU64ByU32DivByU32 (0xffffffff, freq, PM_TMR_FREQ); 874 875 Log (("interval = %RU64\n", interval)); 875 876 TMTimerSet (s->CTXSUFF(ts), TMTimerGet (s->CTXSUFF(ts)) + interval); … … 1216 1217 int64_t elapsed = now - s->pm_timer_initial; 1217 1218 1218 *pu32 = muldiv64(elapsed, PM_TMR_FREQ, TMTimerGetFreq (s->CTXSUFF(ts)));1219 *pu32 = ASMMultU64ByU32DivByU32 (elapsed, PM_TMR_FREQ, TMTimerGetFreq (s->CTXSUFF(ts))); 1219 1220 Log (("acpi: acpiPMTmrRead -> %#x\n", *pu32)); 1220 1221 return VINF_SUCCESS; -
trunk/src/VBox/Devices/PC/DevDMA.cpp
r1906 r1912 169 169 static void write_page (void *opaque, uint32_t nport, uint32_t data) 170 170 { 171 struct dma_cont *d = opaque;171 struct dma_cont *d = (struct dma_cont*)opaque; 172 172 int ichan; 173 173 … … 182 182 static void write_pageh (void *opaque, uint32_t nport, uint32_t data) 183 183 { 184 struct dma_cont *d = opaque;184 struct dma_cont *d = (struct dma_cont*)opaque; 185 185 int ichan; 186 186 … … 195 195 static uint32_t read_page (void *opaque, uint32_t nport) 196 196 { 197 struct dma_cont *d = opaque;197 struct dma_cont *d = (struct dma_cont*)opaque; 198 198 int ichan; 199 199 … … 208 208 static uint32_t read_pageh (void *opaque, uint32_t nport) 209 209 { 210 struct dma_cont *d = opaque;210 struct dma_cont *d = (struct dma_cont*)opaque; 211 211 int ichan; 212 212 … … 239 239 static uint32_t read_chan (void *opaque, uint32_t nport) 240 240 { 241 struct dma_cont *d = opaque;241 struct dma_cont *d = (struct dma_cont*)opaque; 242 242 int ichan, nreg, iport, ff, val, dir; 243 243 struct dma_regs *r; … … 261 261 static void write_chan (void *opaque, uint32_t nport, uint32_t data) 262 262 { 263 struct dma_cont *d = opaque;263 struct dma_cont *d = (struct dma_cont*)opaque; 264 264 int iport, ichan, nreg; 265 265 struct dma_regs *r; … … 279 279 static void write_cont (void *opaque, uint32_t nport, uint32_t data) 280 280 { 281 struct dma_cont *d = opaque;281 struct dma_cont *d = (struct dma_cont*)opaque; 282 282 int iport, ichan = 0; 283 283 … … 363 363 static uint32_t read_cont (void *opaque, uint32_t nport) 364 364 { 365 struct dma_cont *d = opaque;365 struct dma_cont *d = (struct dma_cont*)opaque; 366 366 int iport, val; 367 367 … … 480 480 481 481 if (r->mode & 0x20) { 482 inti;483 uint8_t *p = buf;482 unsigned i; 483 uint8_t *p = (uint8_t*)buf; 484 484 485 485 #ifdef VBOX … … 513 513 514 514 if (r->mode & 0x20) { 515 inti;515 unsigned i; 516 516 uint8_t *p = (uint8_t *) buf; 517 517 … … 548 548 static void dma_reset(void *opaque) 549 549 { 550 struct dma_cont *d = opaque;550 struct dma_cont *d = (struct dma_cont*)opaque; 551 551 write_cont (d, (0x0d << d->dshift), 0); 552 552 } … … 727 727 static void dma_save (QEMUFile *f, void *opaque) 728 728 { 729 struct dma_cont *d = opaque;729 struct dma_cont *d = (struct dma_cont*)opaque; 730 730 int i; 731 731 … … 752 752 static int dma_load (QEMUFile *f, void *opaque, int version_id) 753 753 { 754 struct dma_cont *d = opaque;754 struct dma_cont *d = (struct dma_cont*)opaque; 755 755 int i; 756 756 -
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r485 r1912 53 53 #define LOG_GROUP LOG_GROUP_DEV_PIT 54 54 #include <VBox/pdm.h> 55 56 55 #include <VBox/log.h> 56 #include <VBox/stam.h> 57 57 #include <iprt/assert.h> 58 #include <VBox/stam.h> 59 60 #include "vl_vbox.h" 61 58 #include <iprt/asm.h> 59 60 #include "Builtins.h" 62 61 63 62 /******************************************************************************* … … 172 171 d = TMTimerGet(pTimer); 173 172 d -= s->u64ReloadTS; 174 d = muldiv64(d, PIT_FREQ, TMTimerGetFreq(pTimer));173 d = ASMMultU64ByU32DivByU32(d, PIT_FREQ, TMTimerGetFreq(pTimer)); 175 174 #else /* variable time because of catch up */ 176 175 if (s->u64NextTS == UINT64_MAX) 177 176 return 1; /** @todo check this value. */ 178 177 d = TMTimerGet(pTimer); 179 d = muldiv64(d - s->u64ReloadTS, s->count, s->u64NextTS - s->u64ReloadTS);178 d = ASMMultU64ByU32DivByU32(d - s->u64ReloadTS, s->count, s->u64NextTS - s->u64ReloadTS); 180 179 #endif 181 180 if (d >= s->count) … … 183 182 return s->count - d; 184 183 } 185 d = muldiv64(TMTimerGet(pTimer) - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));184 d = ASMMultU64ByU32DivByU32(TMTimerGet(pTimer) - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)); 186 185 switch(s->mode) { 187 186 case 0: … … 210 209 int out; 211 210 212 d = muldiv64(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));211 d = ASMMultU64ByU32DivByU32(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)); 213 212 switch(s->mode) { 214 213 default: … … 259 258 s->count_latched = s->rw_mode; 260 259 LogFlow(("pit_latch_count: latched_count=%#06x / %10RU64 ns (c=%#06x m=%d)\n", 261 s->latched_count, muldiv64(s->count - s->latched_count, 1000000000, PIT_FREQ), s->count, s->mode));260 s->latched_count, ASMMultU64ByU32DivByU32(s->count - s->latched_count, 1000000000, PIT_FREQ), s->count, s->mode)); 262 261 } 263 262 } … … 316 315 uint32_t period2; 317 316 318 d = muldiv64(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));317 d = ASMMultU64ByU32DivByU32(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)); 319 318 switch(s->mode) { 320 319 default: … … 366 365 /* convert to timer units */ 367 366 LogFlow(("PIT: next_time=%14RI64 %20RI64 mode=%#x count=%#06x\n", next_time, 368 muldiv64(next_time, TMTimerGetFreq(pTimer), PIT_FREQ), s->mode, s->count));369 next_time = s->count_load_time + muldiv64(next_time, TMTimerGetFreq(pTimer), PIT_FREQ);367 ASMMultU64ByU32DivByU32(next_time, TMTimerGetFreq(pTimer), PIT_FREQ), s->mode, s->count)); 368 next_time = s->count_load_time + ASMMultU64ByU32DivByU32(next_time, TMTimerGetFreq(pTimer), PIT_FREQ); 370 369 /* fix potential rounding problems */ 371 370 /* XXX: better solution: use a clock at PIT_FREQ Hz */ … … 418 417 LogFlow(("PIT: m=%d cnt=%#4x irq=%#x delay=%8RI64 next=%20RI64 now=%20RI64 load=%20RI64 %9RI64 delta=%9RI64\n", 419 418 s->mode, s->count, irq_level, quarter, s->u64NextTS, now, s->count_load_time, 420 muldiv64(s->u64NextTS - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)), delta));419 ASMMultU64ByU32DivByU32(s->u64NextTS - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)), delta)); 421 420 } 422 421 else … … 427 426 LogFlow(("PIT: m=%d cnt=%#4x irq=%#x delay=%8RI64 next=%20RI64 now=%20RI64 load=%20RI64 %9RI64 delta=%9RI64 giving up!\n", 428 427 s->mode, s->count, irq_level, quarter, s->u64NextTS, now, s->count_load_time, 429 muldiv64(s->u64NextTS - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)), delta));428 ASMMultU64ByU32DivByU32(s->u64NextTS - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)), delta)); 430 429 } 431 430 } … … 436 435 LogFlow(("PIT: m=%d cnt=%#4x irq=%#x delay=%8RI64 next=%20RI64 now=%20RI64 load=%20RI64 %9RI64\n", 437 436 s->mode, s->count, irq_level, expire_time - now, expire_time, now, s->count_load_time, 438 muldiv64(expire_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer))));437 ASMMultU64ByU32DivByU32(expire_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)))); 439 438 } 440 439 TMTimerSet(s->CTXSUFF(pTimer), s->u64NextTS); -
trunk/src/VBox/Devices/PC/DevRTC.cpp
r1384 r1912 52 52 #define LOG_GROUP LOG_GROUP_DEV_RTC 53 53 #include <VBox/pdm.h> 54 55 54 #include <VBox/log.h> 55 #include <iprt/asm.h> 56 56 #include <iprt/assert.h> 57 57 … … 163 163 freq = TMTimerGetFreq(s->CTXSUFF(pPeriodicTimer)); 164 164 165 cur_clock = muldiv64(current_time, 32768, freq);165 cur_clock = ASMMultU64ByU32DivByU32(current_time, 32768, freq); 166 166 next_irq_clock = (cur_clock & ~(uint64_t)(period - 1)) + period; 167 s->next_periodic_time = muldiv64(next_irq_clock, freq, 32768) + 1;167 s->next_periodic_time = ASMMultU64ByU32DivByU32(next_irq_clock, freq, 32768) + 1; 168 168 169 169 /* fiddly bits for dealing with running to keep up and losing interrupts. */ 170 quarter_period_time = muldiv64(period, freq, 32768 * 4);170 quarter_period_time = ASMMultU64ByU32DivByU32(period, freq, 32768 * 4); 171 171 now = TMTimerGet(s->CTXSUFF(pPeriodicTimer)); 172 172 delta = s->next_periodic_time - now; -
trunk/src/VBox/Devices/PC/Etherboot-src/Makefile.kmk
r1846 r1912 198 198 # General rules for compiling/assembling source files. 199 199 $(PATH_TARGET)/%.o: core/%.c $(MAKEDEPS) 200 $(call MSG_ L1,Compiling $<,=> $@)200 $(call MSG_COMPILE,$@,$<,$@,CC) 201 201 $(QUIET)$(EB_CC) $(EB_CFLAGS) -o $@ -c $< 202 202 203 203 $(PATH_TARGET)/%.o: drivers/net/%.c $(MAKEDEPS) 204 $(call MSG_ L1,Compiling $<,=> $@)204 $(call MSG_COMPILE,$@,$<,$@,CC) 205 205 $(QUIET)$(EB_CC) $(EB_CFLAGS) -o $@ -c $< 206 206 207 207 $(PATH_TARGET)/%.o: arch/$(ARCH)/core/%.c $(MAKEDEPS) 208 $(call MSG_ L1,Compiling $<,=> $@)208 $(call MSG_COMPILE,$@,$<,$@,CC) 209 209 $(QUIET)$(EB_CC) $(EB_CFLAGS) -o $@ -c $< 210 210 … … 227 227 # General rules for generating runtime (rt) files. 228 228 $(PATH_TARGET)/%.rt.o: $(PATH_TARGET)/%.o $(START) $(PATH_TARGET)/config.o $(BLIB) $(MAKEDEPS) 229 $(call MSG_LINK,$@,$@) 229 230 $(call MSG_L1,Linking $@) 230 231 $(QUIET)$(EB_LD) $(EB_LDFLAGS) -r $(START) $(PATH_TARGET)/config.o $< $(BLIB) -o $@ -
trunk/src/VBox/Devices/vl_vbox.h
r1723 r1912 173 173 * Misc. 174 174 */ 175 uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);176 177 175 178 176 #ifdef _MSC_VER
Note:
See TracChangeset
for help on using the changeset viewer.