Changeset 37237 in vbox for trunk/src/VBox
- Timestamp:
- May 27, 2011 2:57:54 PM (14 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r35773 r37237 203 203 /** Number of logical CPUs in guest */ 204 204 uint16_t cCpus; 205 int64_t pm_timer_initial; 205 uint64_t u64PmTimerInitial; 206 uint64_t u64PmTimerLastSeen; 206 207 PTMTIMERR3 tsR3; 207 208 PTMTIMERR0 tsR0; … … 1919 1920 { 1920 1921 ACPIState *s = PDMINS_2_DATA(pDevIns, ACPIState *); 1921 int64_t now = TMTimerGet(s->CTX_SUFF(ts)); 1922 int64_t elapsed = now - s->pm_timer_initial; 1923 1924 *pu32 = ASMMultU64ByU32DivByU32(elapsed, PM_TMR_FREQ, TMTimerGetFreq(s->CTX_SUFF(ts))); 1922 uint64_t u64Now = TMTimerGet(s->CTX_SUFF(ts)); 1923 uint64_t u64Seen; 1924 do 1925 { 1926 u64Seen = ASMAtomicReadU64(&s->u64PmTimerLastSeen); 1927 if (u64Now < s->u64PmTimerLastSeen) 1928 u64Now = s->u64PmTimerLastSeen + 1; 1929 } while (!ASMAtomicCmpXchgU64(&s->u64PmTimerLastSeen, u64Now, u64Seen)); 1930 1931 uint64_t u64Elapsed = u64Now - s->u64PmTimerInitial; 1932 *pu32 = ASMMultU64ByU32DivByU32(u64Elapsed, PM_TMR_FREQ, TMTimerGetFreq(s->CTX_SUFF(ts))); 1925 1933 Log(("acpi: acpiPMTmrRead -> %#x\n", *pu32)); 1926 1934 return VINF_SUCCESS; … … 2121 2129 SSMFIELD_ENTRY(ACPIState, pm1a_sts), 2122 2130 SSMFIELD_ENTRY(ACPIState, pm1a_ctl), 2123 SSMFIELD_ENTRY(ACPIState, pm_timer_initial),2131 SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial), 2124 2132 SSMFIELD_ENTRY(ACPIState, gpe0_en), 2125 2133 SSMFIELD_ENTRY(ACPIState, gpe0_sts), … … 2141 2149 SSMFIELD_ENTRY(ACPIState, pm1a_sts), 2142 2150 SSMFIELD_ENTRY(ACPIState, pm1a_ctl), 2143 SSMFIELD_ENTRY(ACPIState, pm_timer_initial),2151 SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial), 2144 2152 SSMFIELD_ENTRY(ACPIState, gpe0_en), 2145 2153 SSMFIELD_ENTRY(ACPIState, gpe0_sts), … … 2160 2168 SSMFIELD_ENTRY(ACPIState, pm1a_sts), 2161 2169 SSMFIELD_ENTRY(ACPIState, pm1a_ctl), 2162 SSMFIELD_ENTRY(ACPIState, pm_timer_initial),2170 SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial), 2163 2171 SSMFIELD_ENTRY(ACPIState, gpe0_en), 2164 2172 SSMFIELD_ENTRY(ACPIState, gpe0_sts), … … 2579 2587 s->pm1a_sts = 0; 2580 2588 s->pm1a_ctl = 0; 2581 s-> pm_timer_initial= TMTimerGet(s->CTX_SUFF(ts));2589 s->u64PmTimerInitial = TMTimerGet(s->CTX_SUFF(ts)); 2582 2590 acpiPMTimerReset(s); 2583 2591 s->uBatteryIndex = 0; … … 2889 2897 s->tsR0 = TMTimerR0Ptr(s->tsR3); 2890 2898 s->tsRC = TMTimerRCPtr(s->tsR3); 2891 s-> pm_timer_initial = TMTimerGet(s->tsR3);2899 s->u64PmTimerInitial = TMTimerGet(s->tsR3); 2892 2900 acpiPMTimerReset(s); 2893 2901 -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r36878 r37237 480 480 GEN_CHECK_OFF(ACPIState, pm1a_sts); 481 481 GEN_CHECK_OFF(ACPIState, pm1a_ctl); 482 GEN_CHECK_OFF(ACPIState, pm_timer_initial);482 GEN_CHECK_OFF(ACPIState, u64PmTimerInitial); 483 483 GEN_CHECK_OFF(ACPIState, tsR3); 484 484 GEN_CHECK_OFF(ACPIState, tsR0);
Note:
See TracChangeset
for help on using the changeset viewer.