Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

static void kPrfAtomicSet32 ( volatile KU32 *  pu32,
const KU32  u32 
) [inline, static]

Atomically set a 32-bit value.

Definition at line 360 of file kProfileR3.cpp.

{
#if defined(HAVE_INTRIN)
    _InterlockedExchange((long volatile *)pu32, (const long)u32);

#elif defined(__GNUC__)
    __asm__ __volatile__("xchgl %0, %1\n\t"
                         : "=m" (*pu32)
                         : "r" (u32));

#elif _MSC_VER
    __asm
    {
        mov     edx, [pu32]
        mov     eax, [u32]
        xchg    [edx], eax
    }

#else
    *pu32 = u32;
#endif
}


Generated by  Doxygen 1.6.0   Back to index