VirtualBox

Changeset 37541 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Jun 17, 2011 1:09:56 PM (13 years ago)
Author:
vboxsync
Message:

DevHPET: Some minor cleanups.

File:
1 edited

Legend:

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

    r37539 r37541  
    245245    PDMCRITSECT          csLock;
    246246
    247     /** If we emulate ICH9 HPET (different frequency).
    248      * @todo different number of timers */
     247    /** If we emulate ICH9 HPET (different frequency & timer count). */
    249248    bool                 fIch9;
    250249    uint8_t              padding0[7];
     
    514513    if (iTimerNo >= HPET_CAP_GET_TIMERS(pThis->u32Capabilities))
    515514    {
    516         LogRel(("HPET: using timer above configured range: %d\n", iTimerNo));
     515        static unsigned s_cOccurences = 0;
     516        if (s_cOccurences++ < 10)
     517            LogRel(("HPET: using timer above configured range: %d\n", iTimerNo));
    517518        return VINF_SUCCESS;
    518519    }
     
    528529
    529530            uint64_t u64Mask = HPET_TN_CFG_WRITE_MASK;
    530             if ((pHpetTimer->u64Config & HPET_TN_PERIODIC_CAP) != 0)
     531            if (pHpetTimer->u64Config & HPET_TN_PERIODIC_CAP)
    531532                u64Mask |= HPET_TN_PERIODIC;
    532533
    533             if ((pHpetTimer->u64Config & HPET_TN_SIZE_CAP) != 0)
     534            if (pHpetTimer->u64Config & HPET_TN_SIZE_CAP)
    534535                u64Mask |= HPET_TN_32BIT;
    535536            else
    536537                u32NewValue &= ~HPET_TN_32BIT;
    537538
    538             if ((u32NewValue & HPET_TN_32BIT) != 0)
     539            if (u32NewValue & HPET_TN_32BIT)
    539540            {
    540541                Log(("setting timer %d to 32-bit mode\n", iTimerNo));
     
    544545            if ((u32NewValue & HPET_TN_INT_TYPE) == HPET_TIMER_TYPE_LEVEL)
    545546            {
    546                 LogRel(("level-triggered config not yet supported\n"));
     547                static unsigned s_cOccurences = 0;
     548                if (s_cOccurences++ < 10)
     549                    LogRel(("level-triggered config not yet supported\n"));
    547550                AssertFailed();
    548551            }
     
    567570            if (pHpetTimer->u64Config & HPET_TN_PERIODIC)
    568571            {
    569                 u32NewValue &= hpetInvalidValue(pHpetTimer) >> 1;
    570                 pHpetTimer->u64Period = (pHpetTimer->u64Period & UINT64_C(0xffffffff00000000))
    571                                       | u32NewValue;
     572                u32NewValue &= hpetInvalidValue(pHpetTimer) >> 1; /** @todo check this in the docs and add a not why? */
     573                pHpetTimer->u64Period = RT_MAKE_U64(u32NewValue, pHpetTimer->u64Period);
    572574            }
    573 
    574             pHpetTimer->u64Cmp = (pHpetTimer->u64Cmp & UINT64_C(0xffffffff00000000))
    575                                | u32NewValue; /** @todo RT_MAKE_U64 */
    576 
     575            pHpetTimer->u64Cmp     = RT_MAKE_U64(u32NewValue, pHpetTimer->u64Cmp);
    577576            pHpetTimer->u64Config &= ~HPET_TN_SETVAL;
    578577            Log2(("after HPET_TN_CMP cmp=%#llx per=%#llx\n", pHpetTimer->u64Cmp, pHpetTimer->u64Period));
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