VirtualBox

Changeset 97027 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Oct 6, 2022 9:44:06 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
153962
Message:

HPET: Fixed several calculations and typos, see bugref:10301

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevHPET.cpp

    r96407 r97027  
    102102
    103103/**
    104  * Femtoseconds in a day. Still fits within int64_t.
    105  */
    106 #define FS_PER_DAY                  (1000000LL * 60 * 60 * 24 * FS_PER_NS)
     104 * Femtoseconds in a day. Still fits within uint64_t.
     105 */
     106#define FS_PER_DAY                  (1000000000ULL * 60 * 60 * 24 * FS_PER_NS)
    107107
    108108/**
     
    465465                                           uint64_t fConfig, uint64_t uPeriod)
    466466{
    467     if (fConfig & HPET_TN_PERIODIC)
     467    if ((fConfig & HPET_TN_PERIODIC) && uPeriod && (uPeriod < UINT32_MAX))
    468468    {
    469469        uint64_t const nsPeriod = hpetTicksToNs(pThis, uPeriod);
     
    641641
    642642            case HPET_TN_CMP:
    643                 u64Value = ASMAtomicReadU64(&pHpetTimer->u64Config);
     643                u64Value = ASMAtomicReadU64(&pHpetTimer->u64Cmp);
    644644                Log(("HPET[%u]: read64 HPET_TN_CMP: %#RX64\n", iTimerNo, u64Value));
    645645                break;
     
    815815
    816816/**
    817  * 32-bit write to a HPET timer register.
     817 * 64-bit write to a HPET timer register.
    818818 *
    819819 * @returns Strict VBox status code.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette