VirtualBox

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


Ignore:
Timestamp:
Jun 3, 2011 4:28:03 PM (14 years ago)
Author:
vboxsync
Message:

TM,Devices: Fixed default critical section screwup and adjusted its usage in the devices.

Location:
trunk/src/VBox/Devices/PC
Files:
2 edited

Legend:

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

    r36024 r37324  
    14271427    Assert(pThis->pTimerR3 == pTimer);
    14281428    Assert(pThis->fTimerArmed);
     1429    Assert(PDMCritSectIsOwned(dev->pCritSectR3));
    14291430
    14301431    if (!(pThis->lvt[APIC_LVT_TIMER] & APIC_LVT_MASKED)) {
  • trunk/src/VBox/Devices/PC/DevHPET.cpp

    r36971 r37324  
    364364        if (u32TillWrap < (uint32_t)u64Diff)
    365365        {
    366             Log(("wrap on timer %d: till=%u ticks=%lld diff64=%lld\n", 
     366            Log(("wrap on timer %d: till=%u ticks=%lld diff64=%lld\n",
    367367                 pTimer->u8TimerNumber, u32TillWrap, u64Ticks, u64Diff));
    368368            u64Diff = u32TillWrap;
     
    10631063    HpetTimer *pTimer     = (HpetTimer *)pvUser;
    10641064    uint64_t   u64Period  = pTimer->u64Period;
    1065     uint64_t   u64CurTick = hpetGetTicks(pThis);
     1065    uint64_t   u64CurTick = hpetGetTicks(pThis); /** @todo this should be done AFTER locking the HPET. */
    10661066    uint64_t   u64Diff;
    10671067    int        rc;
     
    11461146        /* capable of periodic operations and 64-bits */
    11471147        if (pThis->fIch9)
    1148             pTimer->u64Config = (i == 0) ? 
    1149                     (HPET_TN_PERIODIC_CAP | HPET_TN_SIZE_CAP) 
    1150                     : 
     1148            pTimer->u64Config = (i == 0) ?
     1149                    (HPET_TN_PERIODIC_CAP | HPET_TN_SIZE_CAP)
     1150                    :
    11511151                    0;
    11521152        else
    11531153            pTimer->u64Config = HPET_TN_PERIODIC_CAP | HPET_TN_SIZE_CAP;
    1154        
     1154
    11551155        /* We can do all IRQs */
    11561156        uint32_t u32RoutingCap = 0xffffffff;
     
    11861186static int hpetInit(PPDMDEVINS pDevIns)
    11871187{
    1188     unsigned   i;
    1189     int        rc;
    11901188    HpetState *pThis = PDMINS_2_DATA(pDevIns, HpetState *);
    11911189
     
    11941192    pThis->pDevInsRC  = PDMDEVINS_2_RCPTR(pDevIns);
    11951193
    1196     for (i = 0; i < HPET_NUM_TIMERS; i++)
    1197     {
    1198         HpetTimer *timer = &pThis->aTimers[i];
    1199 
    1200         timer->pHpetR3 = pThis;
    1201         timer->pHpetR0 = PDMINS_2_DATA_R0PTR(pDevIns);
    1202         timer->pHpetRC = PDMINS_2_DATA_RCPTR(pDevIns);
    1203 
    1204         rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hpetTimer, timer,
    1205                                     TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "HPET Timer",
    1206                                     &pThis->aTimers[i].pTimerR3);
     1194    for (unsigned i = 0; i < HPET_NUM_TIMERS; i++)
     1195    {
     1196        HpetTimer *pTimer = &pThis->aTimers[i];
     1197
     1198        pTimer->pHpetR3 = pThis;
     1199        pTimer->pHpetR0 = PDMINS_2_DATA_R0PTR(pDevIns);
     1200        pTimer->pHpetRC = PDMINS_2_DATA_RCPTR(pDevIns);
     1201
     1202        int rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hpetTimer, pTimer,
     1203                                        TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "HPET Timer",
     1204                                        &pThis->aTimers[i].pTimerR3);
    12071205        if (RT_FAILURE(rc))
    12081206            return 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