Changeset 32748 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Sep 24, 2010 9:28:02 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
r32737 r32748 228 228 ASMOutStrU8(0x504, (uint8_t *)&szTmp[0], cb); 229 229 } 230 # define RTAssertMsg1Weak(pszExpr, uLine, pszFile, pszFunction) \230 # define RTAssertMsg1Weak(pszExpr, uLine, pszFile, pszFunction) \ 231 231 myLogBackdoorPrintf("\n!!Guest Assertion failed!!\n%s(%d) %s\n%s\n", uLine, pszFile, pszFunction, (pszExpr)) 232 # define RTAssertMsg2Weak myLogBackdoorPrintf233 # define dprintf(a) myLogBackdoorPrintf a232 # define RTAssertMsg2Weak myLogBackdoorPrintf 233 # define RTTIMERLNX_LOG(a) myLogBackdoorPrintf a 234 234 #else 235 # define dprintf(a) do { } while (0)235 # define RTTIMERLNX_LOG(a) do { } while (0) 236 236 #endif 237 237 … … 242 242 { 243 243 #ifdef DEBUG_HACKING 244 dprintf(("set %d -> %d\n", *penmState, enmNewState));244 RTTIMERLNX_LOG(("set %d -> %d\n", *penmState, enmNewState)); 245 245 #endif 246 246 ASMAtomicWriteU32((uint32_t volatile *)penmState, enmNewState); … … 261 261 RTTIMERLNXSTATE enmOldState = enmCurState; 262 262 bool fRc = ASMAtomicCmpXchgExU32((uint32_t volatile *)penmState, enmNewState, enmCurState, (uint32_t *)&enmOldState); 263 dprintf(("cxg %d -> %d - %d at %u\n", enmOldState, enmNewState, fRc, uLine));263 RTTIMERLNX_LOG(("cxg %d -> %d - %d at %u\n", enmOldState, enmNewState, fRc, uLine)); 264 264 return fRc; 265 265 } … … 351 351 if (fHighRes) 352 352 pSubTimer->u.Std.u64NextTS = u64NextTS; 353 dprintf(("startsubtimer %p\n", pSubTimer->pParent));353 RTTIMERLNX_LOG(("startsubtimer %p\n", pSubTimer->pParent)); 354 354 355 355 pSubTimer->iTick = 0; … … 390 390 static void rtTimerLnxStopSubTimer(PRTTIMERLNXSUBTIMER pSubTimer, bool fHighRes) 391 391 { 392 dprintf(("stopsubtimer %p %d\n", pSubTimer->pParent, fHighRes));392 RTTIMERLNX_LOG(("stopsubtimer %p %d\n", pSubTimer->pParent, fHighRes)); 393 393 #ifdef RTTIMER_LINUX_WITH_HRTIMER 394 394 if (fHighRes) … … 414 414 RTSPINLOCK hSpinlock = pTimer->hSpinlock; 415 415 Assert(pTimer->fSuspended); 416 dprintf(("destroyit %p\n", pTimer));416 RTTIMERLNX_LOG(("destroyit %p\n", pTimer)); 417 417 418 418 /* … … 454 454 if (pTimer->cCpus > 1) 455 455 { 456 bool fAllStopped = true;457 456 uint32_t iCpu = pTimer->cCpus; 458 457 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; … … 591 590 592 591 593 dprintf(("hrcallback %p\n", pTimer));592 RTTIMERLNX_LOG(("hrcallback %p\n", pTimer)); 594 593 if (RT_UNLIKELY(!rtTimerLnxChangeToCallbackState(pSubTimer))) 595 594 return HRTIMER_NORESTART; … … 599 598 * Check for unwanted migration. 600 599 */ 601 if ( (pTimer->fSpecificCpu || pTimer->fAllCpus) 602 && RT_UNLIKELY((RTCPUID)(pSubTimer - &pTimer->aSubTimers[0]) != RTMpCpuId())) 603 { 604 rtTimerLnxCallbackHandleMigration(pTimer, pSubTimer); 605 return HRTIMER_NORESTART; 600 if (pTimer->fAllCpus || pTimer->fSpecificCpu) 601 { 602 RTCPUID idCpu = RTMpCpuId(); 603 if (RT_UNLIKELY( pTimer->fAllCpus 604 ? (RTCPUID)(pSubTimer - &pTimer->aSubTimers[0]) != idCpu 605 : pTimer->idCpu != idCpu)) 606 { 607 rtTimerLnxCallbackHandleMigration(pTimer, pSubTimer); 608 return HRTIMER_NORESTART; 609 } 606 610 } 607 611 #endif … … 678 682 PRTTIMER pTimer = pSubTimer->pParent; 679 683 680 dprintf(("hrcallback %p\n", pTimer));684 RTTIMERLNX_LOG(("stdcallback %p\n", pTimer)); 681 685 if (RT_UNLIKELY(!rtTimerLnxChangeToCallbackState(pSubTimer))) 682 686 return; … … 686 690 * Check for unwanted migration. 687 691 */ 688 if ( (pTimer->fSpecificCpu || pTimer->fAllCpus) 689 && RT_UNLIKELY((RTCPUID)(pSubTimer - &pTimer->aSubTimers[0]) != RTMpCpuId())) 690 { 691 rtTimerLnxCallbackHandleMigration(pTimer, pSubTimer); 692 return; 693 } 692 if (pTimer->fAllCpus || pTimer->fSpecificCpu) 693 { 694 RTCPUID idCpu = RTMpCpuId(); 695 if (RT_UNLIKELY( pTimer->fAllCpus 696 ? (RTCPUID)(pSubTimer - &pTimer->aSubTimers[0]) != idCpu 697 : pTimer->idCpu != idCpu)) 698 { 699 rtTimerLnxCallbackHandleMigration(pTimer, pSubTimer); 700 return; 701 } 702 } 703 694 704 #endif 695 705 … … 910 920 * them because of the STARTING state. This is an extremely unlikely case - not that 911 921 * that means anything in my experience... ;-) */ 922 RTTIMERLNX_LOG(("what!? iCpu=%u -> didn't start\n", iCpu)); 912 923 } 913 924 … … 1152 1163 if (!ASMAtomicUoReadBool(&pTimer->fSuspended)) 1153 1164 return VERR_TIMER_ACTIVE; 1154 dprintf(("start %p\n", pTimer));1165 RTTIMERLNX_LOG(("start %p cCpus=%d\n", pTimer, pTimer->cCpus)); 1155 1166 1156 1167 Args.u64First = u64First; … … 1223 1234 static bool rtTimerLnxStop(PRTTIMER pTimer, bool fForDestroy) 1224 1235 { 1225 dprintf(("lnxstop %p %d\n", pTimer, fForDestroy));1236 RTTIMERLNX_LOG(("lnxstop %p %d\n", pTimer, fForDestroy)); 1226 1237 #ifdef CONFIG_SMP 1227 1238 /* … … 1288 1299 AssertPtrReturn(pTimer, VERR_INVALID_HANDLE); 1289 1300 AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, VERR_INVALID_HANDLE); 1290 dprintf(("stop %p\n", pTimer));1301 RTTIMERLNX_LOG(("stop %p\n", pTimer)); 1291 1302 1292 1303 if (ASMAtomicUoReadBool(&pTimer->fSuspended)) … … 1310 1321 AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, VERR_INVALID_HANDLE); 1311 1322 AssertReturn(u64NanoInterval, VERR_INVALID_PARAMETER); 1312 dprintf(("change %p %llu\n", pTimer, u64NanoInterval));1323 RTTIMERLNX_LOG(("change %p %llu\n", pTimer, u64NanoInterval)); 1313 1324 1314 1325 #ifdef RTTIMER_LINUX_WITH_HRTIMER … … 1356 1367 AssertPtrReturn(pTimer, VERR_INVALID_HANDLE); 1357 1368 AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, VERR_INVALID_HANDLE); 1358 dprintf(("destroy %p\n", pTimer));1369 RTTIMERLNX_LOG(("destroy %p\n", pTimer)); 1359 1370 1360 1371 /* … … 1516 1527 #endif /* CONFIG_SMP */ 1517 1528 1518 dprintf(("create %p\n", pTimer));1529 RTTIMERLNX_LOG(("create %p hires=%d fFlags=%#x cCpus=%u\n", pTimer, pTimer->fHighRes, fFlags, cCpus)); 1519 1530 *ppTimer = pTimer; 1520 1531 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.