VirtualBox

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


Ignore:
Timestamp:
Aug 7, 2012 2:16:30 PM (12 years ago)
Author:
vboxsync
Message:

HPET: More comments; do not lose high dword of timer config.

File:
1 edited

Legend:

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

    r42635 r42663  
    4646
    4747/** Base address for MMIO. */
     48/* On ICH9, it is 0xFED0x000 where 'x' is 0-3, default 0. We do not support
     49 * relocation as the platform firmware is responsible for configuring the
     50 * HPET base address and the OS isn't expected to move it.
     51 * WARNING: This has to match the ACPI tables! */
    4852#define HPET_BASE                   0xfed00000
     53
     54/* HPET reserves a 1K range. */
     55#define HPET_BAR_SIZE               0x1000
    4956
    5057/** The number of timers for PIIX4 / PIIX3. */
     
    515522        {
    516523            DEVHPET_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE);
     524            uint64_t    u64Mask = HPET_TN_CFG_WRITE_MASK;
     525
    517526            Log(("write HPET_TN_CFG: %d: %x\n", iTimerNo, u32NewValue));
    518             uint64_t const iOldValue = (uint32_t)pHpetTimer->u64Config;
    519 
    520             uint64_t u64Mask = HPET_TN_CFG_WRITE_MASK;
    521527            if (pHpetTimer->u64Config & HPET_TN_PERIODIC_CAP)
    522528                u64Mask |= HPET_TN_PERIODIC;
     
    542548
    543549            /* We only care about lower 32-bits so far */
    544             pHpetTimer->u64Config = hpetUpdateMasked(u32NewValue, iOldValue, u64Mask);
     550            pHpetTimer->u64Config = hpetUpdateMasked(u32NewValue, pHpetTimer->u64Config, u64Mask);
    545551            DEVHPET_UNLOCK(pThis);
    546552            break;
    547553        }
    548554
    549         case HPET_TN_CFG + 4: /* Interrupt capabilities */
     555        case HPET_TN_CFG + 4: /* Interrupt capabilities - read only. */
    550556        {
    551557            Log(("write HPET_TN_CFG + 4, useless\n"));
     
    14321438     * addresses and sizes.
    14331439     */
    1434     rc = PDMDevHlpMMIORegister(pDevIns, HPET_BASE, 0x1000, pThis,
     1440    rc = PDMDevHlpMMIORegister(pDevIns, HPET_BASE, HPET_BAR_SIZE, pThis,
    14351441                               IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
    14361442                               hpetMMIOWrite, hpetMMIORead, "HPET Memory");
     
    14391445    if (fRCEnabled)
    14401446    {
    1441         rc = PDMDevHlpMMIORegisterRC(pDevIns, HPET_BASE, 0x1000, NIL_RTRCPTR /*pvUser*/, "hpetMMIOWrite", "hpetMMIORead");
     1447        rc = PDMDevHlpMMIORegisterRC(pDevIns, HPET_BASE, HPET_BAR_SIZE, NIL_RTRCPTR /*pvUser*/, "hpetMMIOWrite", "hpetMMIORead");
    14421448        AssertRCReturn(rc, rc);
    14431449
     
    14481454    if (fR0Enabled)
    14491455    {
    1450         rc = PDMDevHlpMMIORegisterR0(pDevIns, HPET_BASE, 0x1000, NIL_RTR0PTR /*pvUser*/,
     1456        rc = PDMDevHlpMMIORegisterR0(pDevIns, HPET_BASE, HPET_BAR_SIZE, NIL_RTR0PTR /*pvUser*/,
    14511457                                     "hpetMMIOWrite", "hpetMMIORead");
    14521458        AssertRCReturn(rc, rc);
Note: See TracChangeset for help on using the changeset viewer.

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