VirtualBox

Changeset 14246 in vbox for trunk/include


Ignore:
Timestamp:
Nov 17, 2008 11:03:40 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39388
Message:

ASMAtomicSubS32/U32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 *
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