VirtualBox

Changeset 51566 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Jun 6, 2014 11:32:36 AM (10 years ago)
Author:
vboxsync
Message:

Storage/AHCI: Get rid of ASMAtomic*Size and replace with the *U32 variants to get rid of some compiler warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r51516 r51566  
    276276    AHCITXSTATE_32BIT_HACK = 0x7fffffff
    277277} AHCITXSTATE, *PAHCITXSTATE;
     278AssertCompileSize(AHCITXSTATE, sizeof(uint32_t));
    278279
    279280/** Task encountered a buffer overflow. */
     
    56595660        if (VALID_PTR(pAhciReq))
    56605661        {
    5661             bool fXchg = false;
    5662             ASMAtomicCmpXchgSize(&pAhciReq->enmTxState, AHCITXSTATE_CANCELED, AHCITXSTATE_ACTIVE, fXchg);
     5662            bool fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pAhciReq->enmTxState, AHCITXSTATE_CANCELED, AHCITXSTATE_ACTIVE);
    56635663
    56645664            if (fXchg)
     
    59095909                 pAhciPort, pAhciReq, rcReq, fFreeReq));
    59105910
    5911     ASMAtomicReadSize(&pAhciReq->enmTxState, &enmTxState);
     5911    enmTxState = (AHCITXSTATE)ASMAtomicReadU32((volatile uint32_t *)&pAhciReq->enmTxState);
    59125912    VBOXDD_AHCI_REQ_COMPLETED(pAhciReq, rcReq, enmTxState, pAhciReq->uOffset, pAhciReq->cbTransfer);
    59135913    VBOXDD_AHCI_REQ_COMPLETED_TIMESTAMP(pAhciReq, tsNow);
     
    59435943    }
    59445944
    5945     ASMAtomicCmpXchgSize(&pAhciReq->enmTxState, AHCITXSTATE_FREE, AHCITXSTATE_ACTIVE, fXchg);
     5945    fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pAhciReq->enmTxState, AHCITXSTATE_FREE, AHCITXSTATE_ACTIVE);
    59465946
    59475947    if (   fXchg
     
    60666066
    60676067        fCanceled = true;
    6068         ASMAtomicXchgSize(&pAhciReq->enmTxState, AHCITXSTATE_FREE);
     6068        ASMAtomicXchgU32((volatile uint32_t *)&pAhciReq->enmTxState, AHCITXSTATE_FREE);
    60696069
    60706070        if (pAhciReq->enmTxDir == AHCITXDIR_TRIM)
     
    66096609                pAhciReq = pAhciPort->aCachedTasks[idx];
    66106610
    6611             bool fXchg;
    6612             ASMAtomicCmpXchgSize(&pAhciReq->enmTxState, AHCITXSTATE_ACTIVE, AHCITXSTATE_FREE, fXchg);
     6611            bool fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pAhciReq->enmTxState, AHCITXSTATE_ACTIVE, AHCITXSTATE_FREE);
    66136612            AssertMsg(fXchg, ("Task is already active\n"));
    66146613
     
    66336632                 * the guest messed up everything and this behavior is undefined.
    66346633                 */
    6635                 ASMAtomicCmpXchgSize(&pAhciReq->enmTxState, AHCITXSTATE_FREE, AHCITXSTATE_ACTIVE, fXchg);
     6634                fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pAhciReq->enmTxState, AHCITXSTATE_FREE, AHCITXSTATE_ACTIVE);
    66366635                Assert(fXchg);
    66376636                u32Tasks &= ~RT_BIT_32(idx); /* Clear task bit. */
     
    66616660                    AssertMsgFailed(("%s: Update the control register\n", __FUNCTION__));
    66626661
    6663                 ASMAtomicCmpXchgSize(&pAhciReq->enmTxState, AHCITXSTATE_FREE, AHCITXSTATE_ACTIVE, fXchg);
     6662                fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pAhciReq->enmTxState, AHCITXSTATE_FREE, AHCITXSTATE_ACTIVE);
    66646663                AssertMsg(fXchg, ("Task is not active\n"));
    66656664                break;
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