VirtualBox

Changeset 17422 in vbox for trunk


Ignore:
Timestamp:
Mar 5, 2009 8:33:58 PM (16 years ago)
Author:
vboxsync
Message:

VMM: Do not forcibly enable RC logging in VMMGCLogEnabled! Renamed it to VMMGCLogRestore and made VMMGCLogDisable return a state indicator that should be passed to it.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm.h

    r17397 r17422  
    316316VMMRCDECL(void)     VMMGCGuestToHost(PVM pVM, int rc);
    317317VMMRCDECL(int)      VMMGCCallHost(PVM pVM, VMMCALLHOST enmOperation, uint64_t uArg);
    318 VMMRCDECL(void)     VMMGCLogDisable(PVM pVM);
    319 VMMRCDECL(void)     VMMGCLogEnable(PVM pVM);
     318VMMRCDECL(bool)     VMMGCLogDisable(PVM pVM);
     319VMMRCDECL(void)     VMMGCLogRestore(PVM pVM, bool fLog);
    320320VMMRCDECL(void)     VMMGCLogFlushIfFull(PVM pVM);
    321321/** @} */
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r17398 r17422  
    46904690#  ifdef IN_RC
    46914691    /** NOTE: We can't deal with jumps to ring 3 here as we're now in an inconsistent state! */
    4692     VMMGCLogDisable(pVM);
     4692    bool fLog = VMMGCLogDisable(pVM);
    46934693#  endif
    46944694
     
    47294729
    47304730#  ifdef IN_RC
    4731     VMMGCLogEnable(pVM);
     4731    VMMGCLogRestore(pVM, fLog);
    47324732#  endif
    47334733
  • trunk/src/VBox/VMM/VMMGC/VMMGC.cpp

    r17411 r17422  
    195195
    196196/**
    197  * Disables the GC logger temporarily
     197 * Disables the GC logger temporarily, restore with VMMGCLogRestore.
    198198 *
    199199 * @param   pVM             The VM handle.
    200200 */
    201 VMMRCDECL(void) VMMGCLogDisable(PVM pVM)
    202 {
    203     if (pVM->vmm.s.pRCLoggerRC)
     201VMMRCDECL(bool) VMMGCLogDisable(PVM pVM)
     202{
     203    bool fLog = pVM->vmm.s.pRCLoggerRC
     204             && !(pVM->vmm.s.pRCLoggerRC->fFlags & RTLOGFLAGS_DISABLED);
     205    if (fLog)
    204206        pVM->vmm.s.pRCLoggerRC->fFlags |= RTLOGFLAGS_DISABLED;
    205 }
    206 
    207 
    208 /**
    209  * Enables the GC logger again
     207    return fLog;
     208}
     209
     210
     211/**
     212 * Restores the GC logger after a call to VMMGCLogDisable.
    210213 *
    211214 * @param   pVM             The VM handle.
    212  */
    213 VMMRCDECL(void) VMMGCLogEnable(PVM pVM)
    214 {
    215     if (pVM->vmm.s.pRCLoggerRC)
     215 * @param   fLog            What VMMGCLogDisable returned.
     216 */
     217VMMRCDECL(void) VMMGCLogRestore(PVM pVM, bool fLog)
     218{
     219    if (fLog && pVM->vmm.s.pRCLoggerRC)
    216220        pVM->vmm.s.pRCLoggerRC->fFlags &= ~RTLOGFLAGS_DISABLED;
    217221}
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