VirtualBox

Changeset 42723 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Aug 9, 2012 6:49:59 PM (13 years ago)
Author:
vboxsync
Message:

AHCI: Fix EFI boot

File:
1 edited

Legend:

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

    r42522 r42723  
    263263
    264264/** Task encountered a buffer overflow. */
    265 #define AHCI_REQ_OVERFLOW RT_BIT_32(0)
     265#define AHCI_REQ_OVERFLOW   RT_BIT_32(0)
    266266/** Request is a PIO data command, if this flag is not set it either is
    267267 * a command which does not transfer data or a DMA command based on the transfer size. */
    268 #define AHCI_REQ_PIO_DATA RT_BIT_32(1)
     268#define AHCI_REQ_PIO_DATA   RT_BIT_32(1)
     269/** The request has the SACT register set. */
     270#define AHCI_REQ_CLEAR_SACT RT_BIT_32(2)
     271/** FLag whether the request is queued. */
     272#define AHCI_REQ_IS_QUEUED  RT_BIT_32(3)
    269273
    270274/**
     
    277281    /** Tag of the task. */
    278282    uint32_t                   uTag;
    279     /** Command is queued. */
    280     bool                       fQueued;
    281283    /** The command header for this task. */
    282284    CmdHdr                     cmdHdr;
     
    57005702        if (!fRedo)
    57015703        {
    5702             if (pAhciReq->fQueued)
     5704
     5705            /* Post a PIO setup FIS first if this is a PIO command which transfers data. */
     5706            if (pAhciReq->fFlags & AHCI_REQ_PIO_DATA)
     5707                ahciSendPioSetupFis(pAhciPort, pAhciReq, pAhciReq->cmdFis, false /* fInterrupt */);
     5708
     5709            if (pAhciReq->fFlags & AHCI_REQ_CLEAR_SACT)
    57035710            {
    57045711                if (RT_SUCCESS(rcReq) && !ASMAtomicReadPtrT(&pAhciPort->pTaskErr, PAHCIREQ))
    57055712                    ASMAtomicOrU32(&pAhciPort->u32QueuedTasksFinished, RT_BIT_32(pAhciReq->uTag));
    5706 
     5713            }
     5714
     5715            if (pAhciReq->fFlags & AHCI_REQ_IS_QUEUED)
     5716            {
    57075717                /*
    57085718                 * Always raise an interrupt after task completion; delaying
     
    57135723            }
    57145724            else
    5715             {
    5716                 /* Post a PIO setup FIS first if this is a PIO command which transfers data. */
    5717                 if (pAhciReq->fFlags & AHCI_REQ_PIO_DATA)
    5718                     ahciSendPioSetupFis(pAhciPort, pAhciReq, pAhciReq->cmdFis, false /* fInterrupt */);
    57195725                ahciSendD2HFis(pAhciPort, pAhciReq, pAhciReq->cmdFis, true);
    5720             }
    57215726        }
    57225727    }
     
    59615966            pAhciReq->cbTransfer = ahciGetNSectorsQueued(pCmdFis) * 512;
    59625967            pAhciReq->uOffset = ahciGetSectorQueued(pCmdFis) * 512;
     5968            pAhciReq->fFlags |= AHCI_REQ_IS_QUEUED;
    59635969            rc = AHCITXDIR_READ;
    59645970            break;
     
    59685974            pAhciReq->cbTransfer = ahciGetNSectorsQueued(pCmdFis) * 512;
    59695975            pAhciReq->uOffset = ahciGetSectorQueued(pCmdFis) * 512;
     5976            pAhciReq->fFlags |= AHCI_REQ_IS_QUEUED;
    59705977            rc = AHCITXDIR_WRITE;
    59715978            break;
     
    59946001                        if (pTaskErr)
    59956002                        {
    5996                             aBuf[0] = pTaskErr->fQueued ? pTaskErr->uTag : (1 << 7);
     6003                            aBuf[0] = (pTaskErr->fFlags & AHCI_REQ_IS_QUEUED) ? pTaskErr->uTag : (1 << 7);
    59976004                            aBuf[2] = pTaskErr->uATARegStatus;
    59986005                            aBuf[3] = pTaskErr->uATARegError;
     
    61186125
    61196126    /* We "received" the FIS. Clear the BSY bit in regTFD. */
    6120     if ((pAhciReq->cmdHdr.u32DescInf & AHCI_CMDHDR_C) && (pAhciReq->fQueued))
     6127    if ((pAhciReq->cmdHdr.u32DescInf & AHCI_CMDHDR_C) && (pAhciReq->fFlags & AHCI_REQ_CLEAR_SACT))
    61216128    {
    61226129        /*
     
    62236230            if (pAhciPort->regSACT & (1 << idx))
    62246231            {
    6225                 pAhciReq->fQueued = true;
     6232                pAhciReq->fFlags |= AHCI_REQ_CLEAR_SACT;
    62266233                ASMAtomicOrU32(&pAhciPort->u32TasksFinished, (1 << pAhciReq->uTag));
    62276234            }
    6228             else
    6229                 pAhciReq->fQueued = false;
    62306235
    62316236            if (!(pAhciReq->cmdFis[AHCI_CMDFIS_BITS] & AHCI_CMDFIS_C))
     
    64116416            if (pAhciPort->regSACT & (1 << idx))
    64126417            {
    6413                 pAhciReq->fQueued = true;
     6418                pAhciReq->fFlags |= AHCI_REQ_CLEAR_SACT;
    64146419                ASMAtomicOrU32(&pAhciPort->u32TasksFinished, (1 << pAhciReq->uTag));
    64156420            }
    6416             else
    6417                 pAhciReq->fQueued = false;
    64186421
    64196422            ahciPortTaskGetCommandFis(pAhciPort, pAhciReq);
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