VirtualBox

Changeset 51571 in vbox


Ignore:
Timestamp:
Jun 7, 2014 2:28:43 AM (11 years ago)
Author:
vboxsync
Message:

Runtime/generic: Explicitly prevent mixing ring-3 and ring-0 spinlock implementations.

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/spinlock-generic.cpp

    r48935 r51571  
    6363typedef struct RTSPINLOCKINTERNAL
    6464{
    65     /** Spinlock magic value (RTSPINLOCK_MAGIC). */
     65    /** Spinlock magic value (RTSPINLOCK_GEN_MAGIC). */
    6666    uint32_t            u32Magic;
    6767    /** The spinlock creation flags. */
     
    8989     * Initialize and return.
    9090     */
    91     pThis->u32Magic  = RTSPINLOCK_MAGIC;
     91    pThis->u32Magic  = RTSPINLOCK_GEN_MAGIC;
    9292    pThis->fFlags    = fFlags;
    9393    pThis->fIntSaved = 0;
     
    108108    if (!pThis)
    109109        return VERR_INVALID_PARAMETER;
    110     if (pThis->u32Magic != RTSPINLOCK_MAGIC)
     110    if (pThis->u32Magic != RTSPINLOCK_GEN_MAGIC)
    111111    {
    112112        AssertMsgFailed(("Invalid spinlock %p magic=%#x\n", pThis, pThis->u32Magic));
     
    124124{
    125125    PRTSPINLOCKINTERNAL pThis = (PRTSPINLOCKINTERNAL)Spinlock;
    126     AssertMsg(pThis && pThis->u32Magic == RTSPINLOCK_MAGIC,
     126    AssertMsg(pThis && pThis->u32Magic == RTSPINLOCK_GEN_MAGIC,
    127127              ("pThis=%p u32Magic=%08x\n", pThis, pThis ? (int)pThis->u32Magic : 0));
    128128
     
    200200{
    201201    PRTSPINLOCKINTERNAL pThis = (PRTSPINLOCKINTERNAL)Spinlock;
    202     AssertMsg(pThis && pThis->u32Magic == RTSPINLOCK_MAGIC,
     202    AssertMsg(pThis && pThis->u32Magic == RTSPINLOCK_GEN_MAGIC,
    203203              ("pThis=%p u32Magic=%08x\n", pThis, pThis ? (int)pThis->u32Magic : 0));
    204204
  • trunk/src/VBox/Runtime/include/internal/magics.h

    r47199 r51571  
    171171/** Magic value for RTSPINLOCKINTERNAL::u32Magic. (Terry Pratchett) */
    172172#define RTSPINLOCK_MAGIC                UINT32_C(0x19480428)
     173/** Magic value for generic RTSPINLOCKINTERNAL::u32Magic (Georges Prosper Remi). */
     174#define RTSPINLOCK_GEN_MAGIC            UINT32_C(0x10970522)
    173175/** Magic value for RTSTRCACHE::u32Magic. (Sir Arthur Charles Clarke) */
    174176#define RTSTRCACHE_MAGIC                UINT32_C(0x19171216)
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