Changeset 22242 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Aug 13, 2009 3:38:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/TMAllCpu.cpp
r20689 r22242 210 210 else 211 211 u64 = ASMReadTSC(); 212 213 /* Never return a value lower than what the guest has already seen. */ 214 if (u64 < pVCpu->tm.s.u64TSCLastSeen) 215 { 216 STAM_COUNTER_INC(&pVM->tm.s.StatTSCUnderflow); 217 pVCpu->tm.s.u64TSCLastSeen += 64; /* @todo choose a good increment here */ 218 u64 = pVCpu->tm.s.u64TSCLastSeen; 219 } 212 220 } 213 221 else … … 271 279 } 272 280 281 /** 282 * Sets the last seen CPU timestamp counter. 283 * 284 * @returns VBox status code. 285 * @param pVCpu The virtual CPU to operate on. 286 * @param u64LastSeenTick The last seen timestamp value. 287 * 288 * @thread EMT which TSC is to be set. 289 */ 290 VMMDECL(int) TMCpuTickSetLastSeen(PVMCPU pVCpu, uint64_t u64LastSeenTick) 291 { 292 VMCPU_ASSERT_EMT(pVCpu); 293 294 Assert(pVCpu->tm.s.u64TSCLastSeen < u64LastSeenTick); 295 pVCpu->tm.s.u64TSCLastSeen = u64LastSeenTick; 296 return VINF_SUCCESS; 297 } 298 299 /** 300 * Gets the last seen CPU timestamp counter. 301 * 302 * @returns last seen TSC 303 * @param pVCpu The virtual CPU to operate on. 304 * 305 * @thread EMT which TSC is to be set. 306 */ 307 VMMDECL(uint64_t) TMCpuTickGetLastSeen(PVMCPU pVCpu) 308 { 309 VMCPU_ASSERT_EMT(pVCpu); 310 311 return pVCpu->tm.s.u64TSCLastSeen; 312 } 313 273 314 274 315 /**
Note:
See TracChangeset
for help on using the changeset viewer.