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

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

Atomically add a 32-bit integer to another.

Definition at line 431 of file kProfileR3.cpp.

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

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

#elif _MSC_VER
    __asm
    {
        mov     edx, [pu32]
        mov     eax, dword ptr [u32]
        lock add [edx], eax
    }

#else
    *pu32 += u32;
#endif
}


Generated by  Doxygen 1.6.0   Back to index