Changeset 32879 in vbox
- Timestamp:
- Oct 4, 2010 8:40:38 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r32723 r32879 5928 5928 case ATA_SMART: 5929 5929 case ATA_NV_CACHE: 5930 case ATA_IDLE: 5930 5931 pAhciPortTaskState->uATARegError = ABRT_ERR; 5931 5932 pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_ERR; … … 6069 6070 AssertMsg(fXchg, ("Task is already active\n")); 6070 6071 #endif 6072 6073 pAhciPortTaskState->uATARegStatus = 0; 6074 pAhciPortTaskState->uATARegError = 0; 6071 6075 6072 6076 /** Set current command slot */ … … 6115 6119 } 6116 6120 } 6117 6118 enmTxDir = ahciProcessCmd(pAhciPort, pAhciPortTaskState, pAhciPortTaskState->cmdFis); 6119 6120 if (enmTxDir != AHCITXDIR_NONE) 6121 { 6122 pAhciPortTaskState->enmTxDir = enmTxDir; 6123 6124 ahciLog(("%s: Before increment uActTasksActive=%u\n", __FUNCTION__, pAhciPort->uActTasksActive)); 6125 ASMAtomicIncU32(&pAhciPort->uActTasksActive); 6126 ahciLog(("%s: After increment uActTasksActive=%u\n", __FUNCTION__, pAhciPort->uActTasksActive)); 6127 6128 if (enmTxDir != AHCITXDIR_FLUSH) 6121 else 6122 { 6123 enmTxDir = ahciProcessCmd(pAhciPort, pAhciPortTaskState, pAhciPortTaskState->cmdFis); 6124 6125 if (enmTxDir != AHCITXDIR_NONE) 6129 6126 { 6130 STAM_REL_COUNTER_INC(&pAhciPort->StatDMA); 6131 6132 rc = ahciScatterGatherListCreate(pAhciPort, pAhciPortTaskState, (enmTxDir == AHCITXDIR_READ) ? false : true); 6133 if (RT_FAILURE(rc)) 6134 AssertMsgFailed(("%s: Failed to process command %Rrc\n", __FUNCTION__, rc)); 6135 } 6136 6137 if (enmTxDir == AHCITXDIR_FLUSH) 6138 { 6139 rc = pAhciPort->pDrvBlockAsync->pfnStartFlush(pAhciPort->pDrvBlockAsync, 6140 pAhciPortTaskState); 6141 } 6142 else if (enmTxDir == AHCITXDIR_READ) 6143 { 6144 pAhciPort->Led.Asserted.s.fReading = pAhciPort->Led.Actual.s.fReading = 1; 6145 rc = pAhciPort->pDrvBlockAsync->pfnStartRead(pAhciPort->pDrvBlockAsync, pAhciPortTaskState->uOffset, 6146 pAhciPortTaskState->pSGListHead, pAhciPortTaskState->cSGListUsed, 6147 pAhciPortTaskState->cbTransfer, 6148 pAhciPortTaskState); 6127 pAhciPortTaskState->enmTxDir = enmTxDir; 6128 6129 ahciLog(("%s: Before increment uActTasksActive=%u\n", __FUNCTION__, pAhciPort->uActTasksActive)); 6130 ASMAtomicIncU32(&pAhciPort->uActTasksActive); 6131 ahciLog(("%s: After increment uActTasksActive=%u\n", __FUNCTION__, pAhciPort->uActTasksActive)); 6132 6133 if (enmTxDir != AHCITXDIR_FLUSH) 6134 { 6135 STAM_REL_COUNTER_INC(&pAhciPort->StatDMA); 6136 6137 rc = ahciScatterGatherListCreate(pAhciPort, pAhciPortTaskState, (enmTxDir == AHCITXDIR_READ) ? false : true); 6138 if (RT_FAILURE(rc)) 6139 AssertMsgFailed(("%s: Failed to process command %Rrc\n", __FUNCTION__, rc)); 6140 } 6141 6142 if (enmTxDir == AHCITXDIR_FLUSH) 6143 { 6144 rc = pAhciPort->pDrvBlockAsync->pfnStartFlush(pAhciPort->pDrvBlockAsync, 6145 pAhciPortTaskState); 6146 } 6147 else if (enmTxDir == AHCITXDIR_READ) 6148 { 6149 pAhciPort->Led.Asserted.s.fReading = pAhciPort->Led.Actual.s.fReading = 1; 6150 rc = pAhciPort->pDrvBlockAsync->pfnStartRead(pAhciPort->pDrvBlockAsync, pAhciPortTaskState->uOffset, 6151 pAhciPortTaskState->pSGListHead, pAhciPortTaskState->cSGListUsed, 6152 pAhciPortTaskState->cbTransfer, 6153 pAhciPortTaskState); 6154 } 6155 else 6156 { 6157 pAhciPort->Led.Asserted.s.fWriting = pAhciPort->Led.Actual.s.fWriting = 1; 6158 rc = pAhciPort->pDrvBlockAsync->pfnStartWrite(pAhciPort->pDrvBlockAsync, pAhciPortTaskState->uOffset, 6159 pAhciPortTaskState->pSGListHead, pAhciPortTaskState->cSGListUsed, 6160 pAhciPortTaskState->cbTransfer, 6161 pAhciPortTaskState); 6162 } 6163 if (rc == VINF_VD_ASYNC_IO_FINISHED) 6164 rc = ahciTransferComplete(pAhciPort, pAhciPortTaskState, VINF_SUCCESS); 6165 6166 if (RT_FAILURE(rc) && rc != VERR_VD_ASYNC_IO_IN_PROGRESS) 6167 rc = ahciTransferComplete(pAhciPort, pAhciPortTaskState, rc); 6149 6168 } 6150 6169 else 6151 6170 { 6152 pAhciPort->Led.Asserted.s.fWriting = pAhciPort->Led.Actual.s.fWriting = 1; 6153 rc = pAhciPort->pDrvBlockAsync->pfnStartWrite(pAhciPort->pDrvBlockAsync, pAhciPortTaskState->uOffset, 6154 pAhciPortTaskState->pSGListHead, pAhciPortTaskState->cSGListUsed, 6155 pAhciPortTaskState->cbTransfer, 6156 pAhciPortTaskState); 6171 #ifdef RT_STRICT 6172 fXchg = ASMAtomicCmpXchgBool(&pAhciPortTaskState->fActive, false, true); 6173 AssertMsg(fXchg, ("Task is not active\n")); 6174 #endif 6175 6176 /* There is nothing left to do. Notify the guest. */ 6177 ahciSendD2HFis(pAhciPort, pAhciPortTaskState, &pAhciPortTaskState->cmdFis[0], true); 6178 /* Add the task to the cache. */ 6179 pAhciPort->aCachedTasks[pAhciPortTaskState->uTag] = pAhciPortTaskState; 6157 6180 } 6158 if (rc == VINF_VD_ASYNC_IO_FINISHED)6159 rc = ahciTransferComplete(pAhciPort, pAhciPortTaskState, VINF_SUCCESS);6160 6161 if (RT_FAILURE(rc) && rc != VERR_VD_ASYNC_IO_IN_PROGRESS)6162 rc = ahciTransferComplete(pAhciPort, pAhciPortTaskState, rc);6163 }6164 else6165 {6166 #ifdef RT_STRICT6167 fXchg = ASMAtomicCmpXchgBool(&pAhciPortTaskState->fActive, false, true);6168 AssertMsg(fXchg, ("Task is not active\n"));6169 #endif6170 6171 /* There is nothing left to do. Notify the guest. */6172 ahciSendD2HFis(pAhciPort, pAhciPortTaskState, &pAhciPortTaskState->cmdFis[0], true);6173 /* Add the task to the cache. */6174 pAhciPort->aCachedTasks[pAhciPortTaskState->uTag] = pAhciPortTaskState;6175 6181 } 6176 6182 }
Note:
See TracChangeset
for help on using the changeset viewer.

