VirtualBox

Changeset 55954 in vbox


Ignore:
Timestamp:
May 19, 2015 11:59:57 PM (9 years ago)
Author:
vboxsync
Message:

VBox/intnetinline.h: RT_UNLIKELY -> RT_LIKELY.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/intnetinline.h

    r46904 r55954  
    424424            if (offNew >= pRingBuf->offEnd)
    425425                offNew = pRingBuf->offStart;
    426             if (RT_UNLIKELY(!ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
    427                 return VERR_WRONG_ORDER; /* race */
     426            if (RT_LIKELY(ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
     427            { /* likely */ } else return VERR_WRONG_ORDER; /* race */
    428428            Log2(("intnetRingAllocateFrameInternal: offWriteInt: %#x -> %#x (1) (R=%#x T=%#x S=%#x)\n", offWriteInt, offNew, offRead, u8Type, cbFrame));
    429429
     
    445445        {
    446446            uint32_t offNew = pRingBuf->offStart + cb;
    447             if (RT_UNLIKELY(!ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
    448                 return VERR_WRONG_ORDER; /* race */
     447            if (RT_LIKELY(ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
     448            { /* likely */ } else return VERR_WRONG_ORDER; /* race */
    449449            Log2(("intnetRingAllocateFrameInternal: offWriteInt: %#x -> %#x (2) (R=%#x T=%#x S=%#x)\n", offWriteInt, offNew, offRead, u8Type, cbFrame));
    450450
     
    465465    {
    466466        uint32_t offNew = offWriteInt + cb + sizeof(INTNETHDR);
    467         if (RT_UNLIKELY(!ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
    468             return VERR_WRONG_ORDER; /* race */
     467        if (RT_LIKELY(ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
     468        { /* likely */ } else return VERR_WRONG_ORDER; /* race */
    469469        Log2(("intnetRingAllocateFrameInternal: offWriteInt: %#x -> %#x (3) (R=%#x T=%#x S=%#x)\n", offWriteInt, offNew, offRead, u8Type, cbFrame));
    470470
     
    661661            if (offNew >= pRingBuf->offEnd)
    662662                offNew = pRingBuf->offStart;
    663             if (RT_UNLIKELY(!ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
    664                 return VERR_WRONG_ORDER; /* race */
     663            if (RT_LIKELY(ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
     664            { /* likely */ } else return VERR_WRONG_ORDER; /* race */
    665665            Log2(("IntNetRingWriteFrame: offWriteInt: %#x -> %#x (1)\n", offWriteInt, offNew));
    666666
     
    686686        {
    687687            uint32_t offNew = pRingBuf->offStart + cb;
    688             if (RT_UNLIKELY(!ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
    689                 return VERR_WRONG_ORDER; /* race */
     688            if (RT_LIKELY(ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
     689            { /* likely */ } else return VERR_WRONG_ORDER; /* race */
    690690            Log2(("IntNetRingWriteFrame: offWriteInt: %#x -> %#x (2)\n", offWriteInt, offNew));
    691691
     
    710710    {
    711711        uint32_t offNew = offWriteInt + cb + sizeof(INTNETHDR);
    712         if (RT_UNLIKELY(!ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
    713             return VERR_WRONG_ORDER; /* race */
     712        if (RT_LIKELY(ASMAtomicCmpXchgU32(&pRingBuf->offWriteInt, offNew, offWriteInt)))
     713        { /* likely */ } else return VERR_WRONG_ORDER; /* race */
    714714        Log2(("IntNetRingWriteFrame: offWriteInt: %#x -> %#x (3)\n", offWriteInt, offNew));
    715715
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