VirtualBox

Ignore:
Timestamp:
Jun 12, 2011 7:35:28 PM (13 years ago)
Author:
vboxsync
Message:

IOMInline.h: Make sure we don't call PDMCritSectIsInitialized unncessarily in non-strict builds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IOMInline.h

    r37425 r37426  
    3535DECLINLINE(CTX_SUFF(PIOMIOPORTRANGE)) iomIOPortGetRange(PVM pVM, RTIOPORT Port)
    3636{
    37 #ifdef IN_RING3
    38     if (PDMCritSectIsInitialized(&pVM->iom.s.EmtLock))
    39 #endif
    40         Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock));
     37    Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock) || !PDMCritSectIsInitialized(&pVM->iom.s.EmtLock));
    4138    return (CTX_SUFF(PIOMIOPORTRANGE))RTAvlroIOPortRangeGet(&pVM->iom.s.CTX_SUFF(pTrees)->CTX_SUFF(IOPortTree), Port);
    4239}
     
    5451DECLINLINE(PIOMIOPORTRANGER3) iomIOPortGetRangeR3(PVM pVM, RTIOPORT Port)
    5552{
    56 #ifdef IN_RING3
    57     if (PDMCritSectIsInitialized(&pVM->iom.s.EmtLock)) /** @todo Move the call into the assertion since the compiler cannot optimize it away in non-strict builds. */
    58 #endif
    59         Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock));
     53    Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock) || !PDMCritSectIsInitialized(&pVM->iom.s.EmtLock));
    6054    return (PIOMIOPORTRANGER3)RTAvlroIOPortRangeGet(&pVM->iom.s.CTX_SUFF(pTrees)->IOPortTreeR3, Port);
    6155}
     
    7367DECLINLINE(PIOMMMIORANGE) iomMMIOGetRange(PVM pVM, RTGCPHYS GCPhys)
    7468{
    75 #ifdef IN_RING3
    76     if (PDMCritSectIsInitialized(&pVM->iom.s.EmtLock))
    77 #endif
    78         Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock));
     69    Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock) || !PDMCritSectIsInitialized(&pVM->iom.s.EmtLock));
    7970    PIOMMMIORANGE pRange = pVM->iom.s.CTX_SUFF(pMMIORangeLast);
    8071    if (    !pRange
     
    125116{
    126117    Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock));
     118
    127119    /* For large ranges, we'll put everything on the first byte. */
    128120    if (pRange->cb > PAGE_SIZE)
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