Changeset 42723 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Aug 9, 2012 6:49:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r42522 r42723 263 263 264 264 /** Task encountered a buffer overflow. */ 265 #define AHCI_REQ_OVERFLOW RT_BIT_32(0)265 #define AHCI_REQ_OVERFLOW RT_BIT_32(0) 266 266 /** Request is a PIO data command, if this flag is not set it either is 267 267 * 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) 269 273 270 274 /** … … 277 281 /** Tag of the task. */ 278 282 uint32_t uTag; 279 /** Command is queued. */280 bool fQueued;281 283 /** The command header for this task. */ 282 284 CmdHdr cmdHdr; … … 5700 5702 if (!fRedo) 5701 5703 { 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) 5703 5710 { 5704 5711 if (RT_SUCCESS(rcReq) && !ASMAtomicReadPtrT(&pAhciPort->pTaskErr, PAHCIREQ)) 5705 5712 ASMAtomicOrU32(&pAhciPort->u32QueuedTasksFinished, RT_BIT_32(pAhciReq->uTag)); 5706 5713 } 5714 5715 if (pAhciReq->fFlags & AHCI_REQ_IS_QUEUED) 5716 { 5707 5717 /* 5708 5718 * Always raise an interrupt after task completion; delaying … … 5713 5723 } 5714 5724 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 */);5719 5725 ahciSendD2HFis(pAhciPort, pAhciReq, pAhciReq->cmdFis, true); 5720 }5721 5726 } 5722 5727 } … … 5961 5966 pAhciReq->cbTransfer = ahciGetNSectorsQueued(pCmdFis) * 512; 5962 5967 pAhciReq->uOffset = ahciGetSectorQueued(pCmdFis) * 512; 5968 pAhciReq->fFlags |= AHCI_REQ_IS_QUEUED; 5963 5969 rc = AHCITXDIR_READ; 5964 5970 break; … … 5968 5974 pAhciReq->cbTransfer = ahciGetNSectorsQueued(pCmdFis) * 512; 5969 5975 pAhciReq->uOffset = ahciGetSectorQueued(pCmdFis) * 512; 5976 pAhciReq->fFlags |= AHCI_REQ_IS_QUEUED; 5970 5977 rc = AHCITXDIR_WRITE; 5971 5978 break; … … 5994 6001 if (pTaskErr) 5995 6002 { 5996 aBuf[0] = pTaskErr->fQueued? pTaskErr->uTag : (1 << 7);6003 aBuf[0] = (pTaskErr->fFlags & AHCI_REQ_IS_QUEUED) ? pTaskErr->uTag : (1 << 7); 5997 6004 aBuf[2] = pTaskErr->uATARegStatus; 5998 6005 aBuf[3] = pTaskErr->uATARegError; … … 6118 6125 6119 6126 /* We "received" the FIS. Clear the BSY bit in regTFD. */ 6120 if ((pAhciReq->cmdHdr.u32DescInf & AHCI_CMDHDR_C) && (pAhciReq->f Queued))6127 if ((pAhciReq->cmdHdr.u32DescInf & AHCI_CMDHDR_C) && (pAhciReq->fFlags & AHCI_REQ_CLEAR_SACT)) 6121 6128 { 6122 6129 /* … … 6223 6230 if (pAhciPort->regSACT & (1 << idx)) 6224 6231 { 6225 pAhciReq->f Queued = true;6232 pAhciReq->fFlags |= AHCI_REQ_CLEAR_SACT; 6226 6233 ASMAtomicOrU32(&pAhciPort->u32TasksFinished, (1 << pAhciReq->uTag)); 6227 6234 } 6228 else6229 pAhciReq->fQueued = false;6230 6235 6231 6236 if (!(pAhciReq->cmdFis[AHCI_CMDFIS_BITS] & AHCI_CMDFIS_C)) … … 6411 6416 if (pAhciPort->regSACT & (1 << idx)) 6412 6417 { 6413 pAhciReq->f Queued = true;6418 pAhciReq->fFlags |= AHCI_REQ_CLEAR_SACT; 6414 6419 ASMAtomicOrU32(&pAhciPort->u32TasksFinished, (1 << pAhciReq->uTag)); 6415 6420 } 6416 else6417 pAhciReq->fQueued = false;6418 6421 6419 6422 ahciPortTaskGetCommandFis(pAhciPort, pAhciReq);
Note:
See TracChangeset
for help on using the changeset viewer.