VirtualBox

Changeset 74453 in vbox for trunk


Ignore:
Timestamp:
Sep 25, 2018 11:15:13 AM (6 years ago)
Author:
vboxsync
Message:

DrvChar,asm.h: Added ASMAtomicXchgZ to get rid of 32-bit VCC warnings/errors.

Location:
trunk
Files:
2 edited

Legend:

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

    r73502 r74453  
    527527
    528528/**
     529 * Atomically Exchange a size_t value, ordered.
     530 *
     531 * @returns Current *ppv value
     532 * @param   ppv    Pointer to the pointer variable to update.
     533 * @param   pv     The pointer value to assign to *ppv.
     534 */
     535DECLINLINE(size_t) ASMAtomicXchgZ(size_t volatile RT_FAR *puValue, const size_t uValue)
     536{
     537#if ARCH_BITS == 16
     538    AssertCompile(sizeof(size_t) == 2);
     539    return ASMAtomicXchgU16((volatile uint16_t RT_FAR *)puValue, uValue);
     540#elif ARCH_BITS == 32
     541    return ASMAtomicXchgU32((volatile uint32_t RT_FAR *)puValue, uValue);
     542#elif ARCH_BITS == 64
     543    return ASMAtomicXchgU64((volatile uint64_t RT_FAR *)puValue, uValue);
     544#else
     545# error "ARCH_BITS is bogus"
     546#endif
     547}
     548
     549
     550/**
    529551 * Atomically Exchange a pointer value, ordered.
    530552 *
  • trunk/src/VBox/Devices/Serial/DrvChar.cpp

    r74447 r74453  
    212212    {       
    213213        size_t cbOld = 0;
    214         ASMAtomicXchgSizeCorrect(&pThis->cbRemaining, 0, &cbOld);
     214        cbOld = ASMAtomicXchgZ(&pThis->cbRemaining, 0);
    215215        if (cbOld) /* Kick the I/O thread to fetch new data. */
    216216            rc = pThis->pDrvStream->pfnPollInterrupt(pThis->pDrvStream);
     
    218218
    219219    LogFlowFunc(("-> %Rrc\n", rc));
    220     return VINF_SUCCESS;
     220    return VINF_SUCCESS; /** @todo r=bird: return rc? */
    221221}
    222222
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette