Changeset 22236 in vbox for trunk/src/VBox/HostDrivers/Support/SUPDrv.c
- Timestamp:
- Aug 13, 2009 1:39:07 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r22224 r22236 4959 4959 RTCCUINTREG fOldFlags = ASMIntDisableFlags(); /* No interruptions please (real problem on S10). */ 4960 4960 PSUPDRVDEVEXT pDevExt = (PSUPDRVDEVEXT)pvUser; 4961 4962 supdrvGipUpdate(pDevExt->pGip, RTTimeSystemNanoTS()); 4961 uint64_t u64TSC = ASMReadTSC(); 4962 uint64_t NanoTS = RTTimeSystemNanoTS(); 4963 4964 supdrvGipUpdate(pDevExt->pGip, NanoTS, u64TSC); 4963 4965 4964 4966 ASMSetFlags(fOldFlags); … … 4976 4978 PSUPDRVDEVEXT pDevExt = (PSUPDRVDEVEXT)pvUser; 4977 4979 RTCPUID idCpu = RTMpCpuId(); 4980 uint64_t u64TSC = ASMReadTSC(); 4978 4981 uint64_t NanoTS = RTTimeSystemNanoTS(); 4979 4982 4980 4983 /** @todo reset the transaction number and whatnot when iTick == 1. */ 4981 4984 if (pDevExt->idGipMaster == idCpu) 4982 supdrvGipUpdate(pDevExt->pGip, NanoTS );4985 supdrvGipUpdate(pDevExt->pGip, NanoTS, u64TSC); 4983 4986 else 4984 supdrvGipUpdatePerCpu(pDevExt->pGip, NanoTS, ASMGetApicId());4987 supdrvGipUpdatePerCpu(pDevExt->pGip, NanoTS, u64TSC, ASMGetApicId()); 4985 4988 4986 4989 ASMSetFlags(fOldFlags); … … 5278 5281 * @param pGipCpu Pointer to the per cpu data. 5279 5282 * @param u64NanoTS The current time stamp. 5280 * /5281 static void supdrvGipDoUpdateCpu(PSUPGLOBALINFOPAGE pGip, PSUPGIPCPU pGipCpu, uint64_t u64NanoTS) 5282 { 5283 uint64_t u64TSC; 5283 * @param u64TSC The current TSC. 5284 */ 5285 static void supdrvGipDoUpdateCpu(PSUPGLOBALINFOPAGE pGip, PSUPGIPCPU pGipCpu, uint64_t u64NanoTS, uint64_t u64TSC) 5286 { 5284 5287 uint64_t u64TSCDelta; 5285 5288 uint32_t u32UpdateIntervalTSC; … … 5288 5291 uint64_t u64CpuHz; 5289 5292 5293 /* Delta between this and the previous update. */ 5294 pGipCpu->u32UpdateIntervalNS = (uint32_t)(u64NanoTS - pGipCpu->u64NanoTS); 5295 5290 5296 /* 5291 5297 * Update the NanoTS. … … 5297 5303 */ 5298 5304 /** @todo validate the NanoTS delta, don't trust the OS to call us when it should... */ 5299 u64TSC = ASMReadTSC();5300 5305 u64TSCDelta = u64TSC - pGipCpu->u64TSC; 5301 5306 ASMAtomicXchgU64(&pGipCpu->u64TSC, u64TSC); … … 5369 5374 * @param pGip Pointer to the GIP. 5370 5375 * @param u64NanoTS The current nanosecond timesamp. 5371 */ 5372 void VBOXCALL supdrvGipUpdate(PSUPGLOBALINFOPAGE pGip, uint64_t u64NanoTS) 5376 * @param u64TSC The current TSC timesamp. 5377 */ 5378 void VBOXCALL supdrvGipUpdate(PSUPGLOBALINFOPAGE pGip, uint64_t u64NanoTS, uint64_t u64TSC) 5373 5379 { 5374 5380 /* … … 5421 5427 * Update the data. 5422 5428 */ 5423 supdrvGipDoUpdateCpu(pGip, pGipCpu, u64NanoTS );5429 supdrvGipDoUpdateCpu(pGip, pGipCpu, u64NanoTS, u64TSC); 5424 5430 5425 5431 /* … … 5435 5441 * @param pGip Pointer to the GIP. 5436 5442 * @param u64NanoTS The current nanosecond timesamp. 5443 * @param u64TSC The current TSC timesamp. 5437 5444 * @param iCpu The CPU index. 5438 5445 */ 5439 void VBOXCALL supdrvGipUpdatePerCpu(PSUPGLOBALINFOPAGE pGip, uint64_t u64NanoTS, u nsigned iCpu)5446 void VBOXCALL supdrvGipUpdatePerCpu(PSUPGLOBALINFOPAGE pGip, uint64_t u64NanoTS, uint64_t u64TSC, unsigned iCpu) 5440 5447 { 5441 5448 PSUPGIPCPU pGipCpu; … … 5459 5466 * Update the data. 5460 5467 */ 5461 supdrvGipDoUpdateCpu(pGip, pGipCpu, u64NanoTS );5468 supdrvGipDoUpdateCpu(pGip, pGipCpu, u64NanoTS, u64TSC); 5462 5469 5463 5470 /*
Note:
See TracChangeset
for help on using the changeset viewer.