VirtualBox

Changeset 14246

Show
Ignore:
Timestamp:
11/17/08 12:03:40 (2 months ago)
Author:
vboxsync
Message:

ASMAtomicSubS32/U32.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/iprt/asm.h

    r14073 r14246  
    33403340 
    33413341/** 
     3342 * Atomically exchanges and subtracts to an unsigned 32-bit value, ordered. 
     3343 * 
     3344 * @returns The old value. 
     3345 * @param   pu32        Pointer to the value. 
     3346 * @param   u32         Number to subtract. 
     3347 */ 
     3348DECLINLINE(uint32_t) ASMAtomicSubU32(int32_t volatile *pi32, uint32_t u32) 
     3349{ 
     3350    return ASMAtomicAddU32((uint32_t volatile *)pi32, (uint32_t)-(int32_t)u32); 
     3351} 
     3352 
     3353 
     3354/** 
     3355 * Atomically exchanges and subtracts to a signed 32-bit value, ordered. 
     3356 * 
     3357 * @returns The old value. 
     3358 * @param   pi32        Pointer to the value. 
     3359 * @param   i32         Number to subtract. 
     3360 */ 
     3361DECLINLINE(int32_t) ASMAtomicSubS32(int32_t volatile *pi32, int32_t i32) 
     3362{ 
     3363    return (int32_t)ASMAtomicAddU32((uint32_t volatile *)pi32, (uint32_t)-i32); 
     3364} 
     3365 
     3366 
     3367/** 
    33423368 * Atomically increment a 32-bit value, ordered. 
    33433369 * 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy