Changeset 37539 in vbox
- Timestamp:
- Jun 17, 2011 1:04:56 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Devices/PC/DevHPET.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevHPET.cpp
r37538 r37539 366 366 } 367 367 368 369 /** 370 * Sets the frequency hint if it's a periodic timer. 371 * 372 * @param pThis The HPET state. 373 * @param pHpetTimer The timer. 374 */ 375 DECLINLINE(void) hpetTimerSetFrequencyHint(HpetState *pThis, HpetTimer *pHpetTimer) 376 { 377 if (pHpetTimer->u64Config & HPET_TN_PERIODIC) 378 { 379 uint64_t const u64Period = pHpetTimer->u64Period; 380 uint32_t const u32Freq = pThis->u32Period; 381 if (u64Period > 0 && u64Period < u32Freq) 382 TMTimerSetFrequencyHint(pHpetTimer->CTX_SUFF(pTimer), u32Freq / (uint32_t)u64Period); 383 } 384 } 385 386 368 387 static void hpetProgramTimer(HpetTimer *pHpetTimer) 369 388 { … … 403 422 Log4(("HPET: next IRQ in %lld ticks (%lld ns)\n", u64Diff, hpetTicksToNs(pHpetTimer->CTX_SUFF(pHpet), u64Diff))); 404 423 TMTimerSetNano(pHpetTimer->CTX_SUFF(pTimer), hpetTicksToNs(pHpetTimer->CTX_SUFF(pHpet), u64Diff)); 405 if (pHpetTimer->u64Config & HPET_TN_PERIODIC) 406 { 407 uint64_t const u64Period = pHpetTimer->u64Period; 408 uint32_t const u32Freq = pHpetTimer->CTX_SUFF(pHpet)->u32Period; 409 if (u64Period > 0 && u64Period < u32Freq) 410 TMTimerSetFrequencyHint(pHpetTimer->CTX_SUFF(pTimer), u32Freq / (uint32_t)u64Period); 411 } 424 hpetTimerSetFrequencyHint(pHpetTimer->CTX_SUFF(pHpet), pHpetTimer); 412 425 } 413 426 … … 1248 1261 { 1249 1262 HpetTimer *pHpetTimer = &pThis->aTimers[iTimer]; 1250 if ( (pHpetTimer->u64Config & HPET_TN_PERIODIC) 1251 && TMTimerIsActive(pHpetTimer->CTX_SUFF(pTimer))) 1252 { 1253 uint64_t const u64Period = pHpetTimer->u64Period; 1254 uint32_t const u32Freq = pHpetTimer->CTX_SUFF(pHpet)->u32Period; 1255 if (u64Period > 0 && u64Period < u32Freq) 1256 TMTimerSetFrequencyHint(pHpetTimer->CTX_SUFF(pTimer), u32Freq / (uint32_t)u64Period); 1257 } 1263 if (TMTimerIsActive(pHpetTimer->CTX_SUFF(pTimer))) 1264 hpetTimerSetFrequencyHint(pThis, pHpetTimer); 1258 1265 } 1259 1266 PDMCritSectLeave(&pThis->csLock);
Note:
See TracChangeset
for help on using the changeset viewer.

