VirtualBox

Changeset 25368 in vbox for trunk/include/VBox/pdmcritsect.h


Ignore:
Timestamp:
Dec 14, 2009 4:31:40 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55985
Message:

RTCritSect,PDMCritSect,iprt/lockvalidator.h: Reworked the deadlocking detection for critical sections and preparing for lock order validation. This change generalizes the RTCRITSECT::Strict data and moves it out of the RTCRITSECT, leaving a pointer behind. This saves a bit of space in release builds.

File:
1 edited

Legend:

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

    r23350 r25368  
    4848{
    4949    /** Padding. */
    50     uint8_t padding[HC_ARCH_BITS == 64 ? 0xb8 : 0xa8];
     50    uint8_t padding[HC_ARCH_BITS == 32 ? 0x80 : 0xc0];
    5151#ifdef PDMCRITSECTINT_DECLARED
    5252    /** The internal structure (not normally visible). */
     
    5757VMMR3DECL(int)      PDMR3CritSectInit(PVM pVM, PPDMCRITSECT pCritSect, const char *pszName);
    5858VMMDECL(int)        PDMCritSectEnter(PPDMCRITSECT pCritSect, int rcBusy);
     59VMMDECL(int)        PDMCritSectEnterDebug(PPDMCRITSECT pCritSect, int rcBusy, RTHCUINTPTR uId, RT_SRC_POS_DECL);
    5960VMMDECL(int)        PDMCritSectTryEnter(PPDMCRITSECT pCritSect);
     61VMMDECL(int)        PDMCritSectTryEnterDebug(PPDMCRITSECT pCritSect, RTHCUINTPTR uId, RT_SRC_POS_DECL);
    6062VMMR3DECL(int)      PDMR3CritSectEnterEx(PPDMCRITSECT pCritSect, bool fCallRing3);
    6163VMMDECL(void)       PDMCritSectLeave(PPDMCRITSECT pCritSect);
     
    7577VMMR3DECL(void)     PDMR3CritSectLeaveAll(PVM pVM);
    7678
     79/* Strict build: Remap the two enter calls to the debug versions. */
     80#ifdef VBOX_STRICT
     81# ifdef ___iprt_asm_h
     82#  define PDMCritSectEnter(pCritSect, rcBusy)   PDMCritSectEnterDebug((pCritSect), (rcBusy), (uintptr_t)ASMReturnAddress(), RT_SRC_POS)
     83#  define PDMCritSectTryEnter(pCritSect)        PDMCritSectTryEnterDebug((pCritSect), (uintptr_t)ASMReturnAddress(), RT_SRC_POS)
     84# else
     85#  define PDMCritSectEnter(pCritSect, rcBusy)   PDMCritSectEnterDebug((pCritSect), (rcBusy), 0, RT_SRC_POS)
     86#  define PDMCritSectTryEnter(pCritSect)        PDMCritSectTryEnterDebug((pCritSect), 0, RT_SRC_POS)
     87# endif
     88#endif
     89
    7790/** @} */
    7891
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette