VirtualBox

Changeset 68698 in vbox


Ignore:
Timestamp:
Sep 7, 2017 3:06:15 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
117929
Message:

asm.h: Add ASMAtomicWriteZ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm.h

    r68606 r68698  
    23742374
    23752375/**
     2376 * Atomically writes a size_t value, ordered.
     2377 *
     2378 * @returns nothing.
     2379 * @param   pcb     Pointer to the size_t variable to write.
     2380 * @param   cb      The value to assign to *pcb.
     2381 */
     2382DECLINLINE(void) ASMAtomicWriteZ(volatile size_t RT_FAR *pcb, size_t cb)
     2383{
     2384#if ARCH_BITS == 64
     2385    ASMAtomicWriteU64((uint64_t volatile *)pcb, cb);
     2386#elif ARCH_BITS == 32
     2387    ASMAtomicWriteU32((uint32_t volatile *)pcb, cb);
     2388#elif ARCH_BITS == 16
     2389    AssertCompileSize(size_t, 2);
     2390    ASMAtomicWriteU16((uint16_t volatile *)pcb, cb);
     2391#else
     2392# error "Unsupported ARCH_BITS value"
     2393#endif
     2394}
     2395
     2396
     2397/**
    23762398 * Atomically writes a boolean value, unordered.
    23772399 *
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