VirtualBox

Changeset 37324 in vbox for trunk/src/VBox/VMM


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/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/TMAll.cpp

    r35346 r37324  
    5353        if ((pTimer)->pCritSect) \
    5454        { \
     55            VMSTATE      enmState; \
    5556            PPDMCRITSECT pCritSect = (PPDMCRITSECT)MMHyperR3ToCC((pTimer)->CTX_SUFF(pVM), (pTimer)->pCritSect); \
    56             AssertMsg(pCritSect && PDMCritSectIsOwner(pCritSect), \
    57                       ("pTimer=%p (%s) pCritSect=%p\n", pTimer, R3STRING(pTimer->pszDesc), (pTimer)->pCritSect)); \
     57            AssertMsg(   pCritSect \
     58                      && (   PDMCritSectIsOwner(pCritSect) \
     59                          || (enmState = (pTimer)->CTX_SUFF(pVM)->enmVMState) == VMSTATE_CREATING \
     60                          || enmState == VMSTATE_RESETTING \
     61                          || enmState == VMSTATE_RESETTING_LS ),\
     62                      ("pTimer=%p (%s) pCritSect=%p (%s)\n", pTimer, R3STRING(pTimer->pszDesc), \
     63                       (pTimer)->pCritSect, R3STRING(PDMR3CritSectName((pTimer)->pCritSect)) )); \
    5864        } \
    5965    } while (0)
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r36254 r37324  
    13151315 * @param   ppTimer         Where to store the timer on success.
    13161316 */
    1317 VMM_INT_DECL(int) TMR3TimerCreateDevice(PVM pVM, PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer)
     1317VMM_INT_DECL(int) TMR3TimerCreateDevice(PVM pVM, PPDMDEVINS pDevIns, TMCLOCK enmClock,
     1318                                        PFNTMTIMERDEV pfnCallback, void *pvUser,
     1319                                        uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer)
    13181320{
    13191321    AssertReturn(!(fFlags & ~(TMTIMER_FLAGS_NO_CRIT_SECT)), VERR_INVALID_PARAMETER);
     
    13291331        (*ppTimer)->u.Dev.pDevIns   = pDevIns;
    13301332        (*ppTimer)->pvUser          = pvUser;
    1331         if (fFlags & TMTIMER_FLAGS_DEFAULT_CRIT_SECT)
     1333        if (!(fFlags & TMTIMER_FLAGS_NO_CRIT_SECT))
    13321334        {
    13331335            if (pDevIns->pCritSectR3)
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