VirtualBox

Changeset 37467 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Jun 15, 2011 1:08:45 PM (13 years ago)
Author:
vboxsync
Message:

IOM: Clean up locking now that all devices has its own CS.

Location:
trunk/src/VBox/VMM/include
Files:
2 edited

Legend:

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

    r37452 r37467  
    3535DECLINLINE(CTX_SUFF(PIOMIOPORTRANGE)) iomIOPortGetRange(PVM pVM, RTIOPORT Port)
    3636{
    37     Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock) || !PDMCritSectIsInitialized(&pVM->iom.s.EmtLock));
     37    Assert(PDMCritSectIsOwner(&pVM->iom.s.CritSect));
    3838    return (CTX_SUFF(PIOMIOPORTRANGE))RTAvlroIOPortRangeGet(&pVM->iom.s.CTX_SUFF(pTrees)->CTX_SUFF(IOPortTree), Port);
    3939}
     
    5151DECLINLINE(PIOMIOPORTRANGER3) iomIOPortGetRangeR3(PVM pVM, RTIOPORT Port)
    5252{
    53     Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock) || !PDMCritSectIsInitialized(&pVM->iom.s.EmtLock));
     53    Assert(PDMCritSectIsOwner(&pVM->iom.s.CritSect));
    5454    return (PIOMIOPORTRANGER3)RTAvlroIOPortRangeGet(&pVM->iom.s.CTX_SUFF(pTrees)->IOPortTreeR3, Port);
    5555}
     
    6767DECLINLINE(PIOMMMIORANGE) iomMmioGetRange(PVM pVM, RTGCPHYS GCPhys)
    6868{
    69     Assert(PDMCritSectIsOwner(&pVM->iom.s.EmtLock));
     69    Assert(PDMCritSectIsOwner(&pVM->iom.s.CritSect));
    7070    PIOMMMIORANGE pRange = pVM->iom.s.CTX_SUFF(pMMIORangeLast);
    7171    if (    !pRange
     
    101101DECLINLINE(PIOMMMIORANGE) iomMmioGetRangeWithRef(PVM pVM, RTGCPHYS GCPhys)
    102102{
    103     int rc = PDMCritSectEnter(&pVM->iom.s.EmtLock, VINF_SUCCESS);
     103    int rc = PDMCritSectEnter(&pVM->iom.s.CritSect, VINF_SUCCESS);
    104104    AssertRCReturn(rc, NULL);
    105105
     
    112112        iomMmioRetainRange(pRange);
    113113
    114     PDMCritSectLeave(&pVM->iom.s.EmtLock);
     114    PDMCritSectLeave(&pVM->iom.s.CritSect);
    115115    return pRange;
    116116}
     
    169169DECLINLINE(PIOMMMIOSTATS) iomMmioGetStats(PVM pVM, RTGCPHYS GCPhys, PIOMMMIORANGE pRange)
    170170{
    171     PDMCritSectEnter(&pVM->iom.s.EmtLock, VINF_SUCCESS);
     171    PDMCritSectEnter(&pVM->iom.s.CritSect, VINF_SUCCESS);
    172172
    173173    /* For large ranges, we'll put everything on the first byte. */
     
    186186    }
    187187
    188     PDMCritSectLeave(&pVM->iom.s.EmtLock);
     188    PDMCritSectLeave(&pVM->iom.s.CritSect);
    189189    return pStats;
    190190}
  • trunk/src/VBox/VMM/include/IOMInternal.h

    r37452 r37467  
    323323
    324324    /** Lock serializing EMT access to IOM. */
    325     PDMCRITSECT                     EmtLock;
     325    PDMCRITSECT                     CritSect;
    326326
    327327    /** @name Caching of I/O Port and MMIO ranges and statistics.
     
    433433
    434434/* IOM locking helpers. */
    435 int     iomLock(PVM pVM);
    436 int     iomTryLock(PVM pVM);
    437 void    iomUnlock(PVM pVM);
     435#define IOM_LOCK(a_pVM)     PDMCritSectEnter(&(a_pVM)->iom.s.CritSect, VERR_SEM_BUSY)
     436#define IOM_UNLOCK(a_pVM)   do { PDMCritSectLeave(&(a_pVM)->iom.s.CritSect); } while (0)
     437
    438438
    439439/* Disassembly helpers used in IOMAll.cpp & IOMAllMMIO.cpp */
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