- Timestamp:
- Apr 20, 2007 10:35:30 PM (18 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile
r2246 r2285 53 53 ifdef VBOX_WITH_INTERNAL_NETWORKING 54 54 DEFS += VBOX_WITH_INTERNAL_NETWORKING 55 endif 56 ifeq ($(USERNAME),bird) 57 DEFS += VBOX_WITH_VIRTUAL_SYNC_TIMERS 55 58 endif 56 59 -
trunk/src/VBox/Devices/PC/DevACPI.cpp
r1912 r2285 1595 1595 } 1596 1596 1597 #ifdef VBOX_WITH_VIRTUAL_SYNC_TIMERS 1598 rc = PDMDevHlpTMTimerCreate (pDevIns, TMCLOCK_VIRTUAL_SYNC, acpiTimer, "ACPI Timer", &s->tsHC); 1599 #else 1597 1600 rc = PDMDevHlpTMTimerCreate (pDevIns, TMCLOCK_VIRTUAL, acpiTimer, "ACPI Timer", &s->tsHC); 1601 #endif 1598 1602 if (VBOX_FAILURE(rc)) 1599 1603 { -
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r1931 r2285 1725 1725 * Create the APIC timer. 1726 1726 */ 1727 #ifdef VBOX_WITH_VIRTUAL_SYNC_TIMERS 1728 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, apicTimer, 1729 #else 1727 1730 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, apicTimer, 1731 #endif 1728 1732 "APIC Timer", &pData->CTXSUFF(pTimer)); 1729 1733 if (VBOX_FAILURE(rc)) -
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r1912 r2285 93 93 * As apposed to the next_transition_time which contains the correct time of the next tick. */ 94 94 uint64_t u64NextTS; 95 #ifndef VBOX_WITH_VIRTUAL_SYNC_TIMERS 95 96 /** When to give up catching up. (negative number) */ 96 97 int64_t i64MaxCatchupTS; 98 #endif 97 99 98 100 /** (count_load_time is only set by TMTimerGet() which returns uint64_t) */ … … 136 138 /** Profiling the timer callback handler. */ 137 139 STAMPROFILEADV StatPITHandler; 140 #ifndef VBOX_WITH_VIRTUAL_SYNC_TIMERS 138 141 /** The number of times we've had to speed up the time because we lagged too far behind. */ 139 142 STAMCOUNTER StatPITCatchup; 140 143 /** The number of times we've lagged too far behind for it to be worth trying to catch up. */ 141 144 STAMCOUNTER StatPITGiveup; 145 #endif 142 146 } PITState; 143 147 … … 400 404 } 401 405 406 #ifdef VBOX_WITH_VIRTUAL_SYNC_TIMERS 407 if (expire_time != -1) 408 { 409 s->u64NextTS = expire_time; 410 TMTimerSet(s->CTXSUFF(pTimer), s->u64NextTS); 411 } 412 #else 402 413 /* check if it expires too soon - move at 4x rate if it does. */ 403 414 if (expire_time != -1) … … 439 450 TMTimerSet(s->CTXSUFF(pTimer), s->u64NextTS); 440 451 } 452 #endif 441 453 else 442 454 { … … 981 993 * Create timer, register I/O Ports and save state. 982 994 */ 995 #ifdef VBOX_WITH_VIRTUAL_SYNC_TIMERS 996 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, pitTimer, "i8254 Programmable Interval Timer", 997 #else 983 998 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, pitTimer, "i8254 Programmable Interval Timer", 999 #endif 984 1000 &pData->channels[0].CTXSUFF(pTimer)); 985 1001 if (VBOX_FAILURE(rc)) … … 1024 1040 return rc; 1025 1041 1042 #ifndef VBOX_WITH_VIRTUAL_SYNC_TIMERS 1026 1043 /* 1027 1044 * Calculate max catchup time. … … 1029 1046 pData->channels[0].i64MaxCatchupTS = pData->channels[1].i64MaxCatchupTS 1030 1047 = pData->channels[2].i64MaxCatchupTS = -TMTimerFromMilli(pData->channels[0].CTXSUFF(pTimer), 1000*60*2); /* 2 min */ 1048 #endif 1031 1049 1032 1050 /* … … 1040 1058 PDMDevHlpSTAMRegister(pDevIns, &pData->StatPITIrq, STAMTYPE_COUNTER, "/TM/PIT/Irq", STAMUNIT_OCCURENCES, "The number of times a timer interrupt was triggered."); 1041 1059 PDMDevHlpSTAMRegister(pDevIns, &pData->StatPITHandler, STAMTYPE_PROFILE, "/TM/PIT/Handler", STAMUNIT_TICKS_PER_CALL, "Profiling timer callback handler."); 1060 #ifndef VBOX_WITH_VIRTUAL_SYNC_TIMERS 1042 1061 PDMDevHlpSTAMRegister(pDevIns, &pData->StatPITCatchup, STAMTYPE_COUNTER, "/TM/PIT/Catchup", STAMUNIT_OCCURENCES, "The number of times we lagged too far behind."); 1043 1062 PDMDevHlpSTAMRegister(pDevIns, &pData->StatPITGiveup, STAMTYPE_COUNTER, "/TM/PIT/Giveup", STAMUNIT_OCCURENCES, "The number of times we lagged so far behind that we simply gave up."); 1063 #endif 1044 1064 1045 1065 PDMDevHlpDBGFInfoRegister(pDevIns, "pit", "Display PIT (i8254) status. (no arguments)", pitInfo); -
trunk/src/VBox/Devices/PC/DevRTC.cpp
r1912 r2285 149 149 { 150 150 int period_code, period; 151 uint64_t cur_clock, next_irq_clock, now, quarter_period_time; 152 int64_t delta; 151 uint64_t cur_clock, next_irq_clock; 153 152 uint32_t freq; 154 153 … … 166 165 next_irq_clock = (cur_clock & ~(uint64_t)(period - 1)) + period; 167 166 s->next_periodic_time = ASMMultU64ByU32DivByU32(next_irq_clock, freq, 32768) + 1; 168 167 #ifdef VBOX_WITH_VIRTUAL_SYNC_TIMERS 168 TMTimerSet(s->CTXSUFF(pPeriodicTimer), s->next_periodic_time); 169 170 #else 169 171 /* fiddly bits for dealing with running to keep up and losing interrupts. */ 170 quarter_period_time = ASMMultU64ByU32DivByU32(period, freq, 32768 * 4);171 now = TMTimerGet(s->CTXSUFF(pPeriodicTimer));172 delta = s->next_periodic_time - now;172 uint64_t quarter_period_time = ASMMultU64ByU32DivByU32(period, freq, 32768 * 4); 173 uint64_t now = TMTimerGet(s->CTXSUFF(pPeriodicTimer)); 174 int64_t delta = s->next_periodic_time - now; 173 175 if (delta >= (int64_t)quarter_period_time) 174 176 { … … 183 185 s->next_periodic_time, delta, now, next)); 184 186 } 187 #endif 185 188 } else { 186 189 TMTimerStop(s->CTXSUFF(pPeriodicTimer)); … … 853 856 * Create timers, arm them, register I/O Ports and save state. 854 857 */ 858 #ifdef VBOX_WITH_VIRTUAL_SYNC_TIMERS 859 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerPeriodic, "MC146818 RTC/CMOS - Periodic", &pData->pPeriodicTimerHC); 860 #else 855 861 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, rtcTimerPeriodic, "MC146818 RTC/CMOS - Periodic", &pData->pPeriodicTimerHC); 862 #endif 856 863 if (VBOX_FAILURE(rc)) 857 864 { … … 859 866 return rc; 860 867 } 868 #ifdef VBOX_WITH_VIRTUAL_SYNC_TIMERS 869 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerSecond, "MC146818 RTC/CMOS - Second", &pData->pSecondTimerHC); 870 #else 861 871 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, rtcTimerSecond, "MC146818 RTC/CMOS - Second", &pData->pSecondTimerHC); 872 #endif 862 873 if (VBOX_FAILURE(rc)) 863 874 { … … 865 876 return rc; 866 877 } 878 #ifdef VBOX_WITH_VIRTUAL_SYNC_TIMERS 879 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerSecond2, "MC146818 RTC/CMOS - Second2", &pData->pSecondTimer2HC); 880 #else 867 881 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, rtcTimerSecond2, "MC146818 RTC/CMOS - Second2", &pData->pSecondTimer2HC); 882 #endif 868 883 if (VBOX_FAILURE(rc)) 869 884 { -
trunk/src/VBox/Devices/testcase/Makefile
r735 r2285 26 26 # 27 27 PROGRAMS = tstDeviceStructSize tstDeviceStructSizeGC 28 29 # temp hack. 30 ifeq ($(USERNAME),bird) 31 DEFS += VBOX_WITH_VIRTUAL_SYNC_TIMERS 32 endif 33 28 34 29 35 # -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeGC.cpp
r2269 r2285 447 447 GEN_CHECK_OFF(PITChannelState, u64ReloadTS); 448 448 GEN_CHECK_OFF(PITChannelState, u64NextTS); 449 #ifndef VBOX_WITH_VIRTUAL_SYNC_TIMERS 449 450 GEN_CHECK_OFF(PITChannelState, i64MaxCatchupTS); 451 #endif 450 452 GEN_CHECK_OFF(PITChannelState, count_load_time); 451 453 GEN_CHECK_OFF(PITChannelState, next_transition_time); … … 472 474 GEN_CHECK_OFF(PITState, StatPITIrq); 473 475 GEN_CHECK_OFF(PITState, StatPITHandler); 476 #ifndef VBOX_WITH_VIRTUAL_SYNC_TIMERS 474 477 GEN_CHECK_OFF(PITState, StatPITCatchup); 475 478 GEN_CHECK_OFF(PITState, StatPITGiveup); 479 #endif 476 480 477 481 /* PC/DevRTC.cpp */
Note:
See TracChangeset
for help on using the changeset viewer.