Changeset 81966 in vbox
- Timestamp:
- Nov 18, 2019 8:51:08 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevHPET.cpp
r81965 r81966 389 389 390 390 u32Diff = (uint32_t)pHpetTimer->u64Cmp - (uint32_t)u64Now; 391 u32Diff = ( (int32_t)u32Diff > 0)? u32Diff : (uint32_t)0;391 u32Diff = (int32_t)u32Diff > 0 ? u32Diff : (uint32_t)0; 392 392 return (uint64_t)u32Diff; 393 393 } 394 else 395 { 396 uint64_t u64Diff; 397 398 u64Diff = pHpetTimer->u64Cmp - u64Now; 399 u64Diff = ((int64_t)u64Diff > 0) ? u64Diff : (uint64_t)0; 400 return u64Diff; 401 } 394 uint64_t u64Diff; 395 396 u64Diff = pHpetTimer->u64Cmp - u64Now; 397 u64Diff = (int64_t)u64Diff > 0 ? u64Diff : (uint64_t)0; 398 return u64Diff; 402 399 } 403 400 … … 405 402 static void hpetAdjustComparator(PHPETTIMER pHpetTimer, uint64_t u64Now) 406 403 { 407 uint64_t u64Period = pHpetTimer->u64Period; 408 409 if ((pHpetTimer->u64Config & HPET_TN_PERIODIC) && u64Period) 410 { 411 uint64_t cPeriods = (u64Now - pHpetTimer->u64Cmp) / u64Period; 412 413 pHpetTimer->u64Cmp += (cPeriods + 1) * u64Period; 404 if ((pHpetTimer->u64Config & HPET_TN_PERIODIC)) 405 { 406 uint64_t u64Period = pHpetTimer->u64Period; 407 if (u64Period) 408 { 409 uint64_t cPeriods = (u64Now - pHpetTimer->u64Cmp) / u64Period; 410 pHpetTimer->u64Cmp += (cPeriods + 1) * u64Period; 411 } 414 412 } 415 413 }
Note:
See TracChangeset
for help on using the changeset viewer.