- Timestamp:
- May 26, 2010 6:27:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
r29744 r29827 404 404 uIntSts = (ASMAtomicReadU32(&pThis->uInterruptStatus) & ~LSILOGIC_REG_HOST_INTR_STATUS_DOORBELL_STS); 405 405 /* Check maskable interrupts. */ 406 uIntSts &= ~( pThis->uInterruptMask& ~LSILOGIC_REG_HOST_INTR_MASK_IRQ_ROUTING);406 uIntSts &= ~(ASMAtomicReadU32(&pThis->uInterruptMask) & ~LSILOGIC_REG_HOST_INTR_MASK_IRQ_ROUTING); 407 407 408 408 if (uIntSts) … … 584 584 pLsiLogic->uReplyPostQueueNextEntryFreeWrite %= pLsiLogic->cReplyQueueEntries; 585 585 586 PDMCritSectLeave(&pLsiLogic->ReplyPostQueueCritSect);587 588 586 /* Set interrupt. */ 589 587 lsilogicSetInterrupt(pLsiLogic, LSILOGIC_REG_HOST_INTR_STATUS_REPLY_INTR); 588 589 PDMCritSectLeave(&pLsiLogic->ReplyPostQueueCritSect); 590 590 } 591 591 … … 702 702 pLsiLogic->uReplyPostQueueNextEntryFreeWrite %= pLsiLogic->cReplyQueueEntries; 703 703 704 PDMCritSectLeave(&pLsiLogic->ReplyPostQueueCritSect);705 706 704 if (fForceReplyFifo) 707 705 { … … 712 710 /* Set interrupt. */ 713 711 lsilogicSetInterrupt(pLsiLogic, LSILOGIC_REG_HOST_INTR_STATUS_REPLY_INTR); 712 713 PDMCritSectLeave(&pLsiLogic->ReplyPostQueueCritSect); 714 714 #else 715 715 AssertMsgFailed(("This is not allowed to happen.\n")); … … 1060 1060 * the latter one is read only. 1061 1061 */ 1062 pThis->uInterruptStatus = pThis->uInterruptStatus & ~LSILOGIC_REG_HOST_INTR_STATUS_SYSTEM_DOORBELL;1062 ASMAtomicAndU32(&pThis->uInterruptStatus, ~LSILOGIC_REG_HOST_INTR_STATUS_SYSTEM_DOORBELL); 1063 1063 1064 1064 /* … … 1085 1085 case LSILOGIC_REG_HOST_INTR_MASK: 1086 1086 { 1087 pThis->uInterruptMask = (u32 & LSILOGIC_REG_HOST_INTR_MASK_W_MASK);1087 ASMAtomicWriteU32(&pThis->uInterruptMask, u32 & LSILOGIC_REG_HOST_INTR_MASK_W_MASK); 1088 1088 lsilogicUpdateInterrupt(pThis); 1089 1089 break; … … 1147 1147 static int lsilogicRegisterRead(PLSILOGICSCSI pThis, uint32_t uOffset, void *pv, unsigned cb) 1148 1148 { 1149 int rc = VINF_SUCCESS; 1149 1150 uint32_t u32 = 0; 1150 1151 … … 1161 1162 LogFlowFunc((": cb is not 4 (%u)\n", cb)); 1162 1163 1163 if (pThis->uReplyPostQueueNextEntryFreeWrite != pThis->uReplyPostQueueNextAddressRead) 1164 rc = PDMCritSectEnter(&pThis->ReplyPostQueueCritSect, VINF_IOM_HC_MMIO_READ); 1165 if (rc != VINF_SUCCESS) 1166 break; 1167 1168 uint32_t idxReplyPostQueueWrite = ASMAtomicUoReadU32(&pThis->uReplyPostQueueNextEntryFreeWrite); 1169 uint32_t idxReplyPostQueueRead = ASMAtomicUoReadU32(&pThis->uReplyPostQueueNextAddressRead); 1170 1171 if (idxReplyPostQueueWrite != idxReplyPostQueueRead) 1164 1172 { 1165 u32 = pThis->CTX_SUFF(pReplyPostQueueBase)[pThis->uReplyPostQueueNextAddressRead]; 1166 pThis->uReplyPostQueueNextAddressRead++; 1167 pThis->uReplyPostQueueNextAddressRead %= pThis->cReplyQueueEntries; 1173 u32 = pThis->CTX_SUFF(pReplyPostQueueBase)[idxReplyPostQueueRead]; 1174 idxReplyPostQueueRead++; 1175 idxReplyPostQueueRead %= pThis->cReplyQueueEntries; 1176 ASMAtomicWriteU32(&pThis->uReplyPostQueueNextAddressRead, idxReplyPostQueueRead); 1168 1177 } 1169 1178 else … … 1173 1182 lsilogicClearInterrupt(pThis, LSILOGIC_REG_HOST_INTR_STATUS_REPLY_INTR); 1174 1183 } 1184 PDMCritSectLeave(&pThis->ReplyPostQueueCritSect); 1185 1175 1186 Log(("%s: Returning address %#x\n", __FUNCTION__, u32)); 1176 1187 break; … … 1200 1211 case LSILOGIC_REG_HOST_INTR_STATUS: 1201 1212 { 1202 u32 = pThis->uInterruptStatus;1213 u32 = ASMAtomicReadU32(&pThis->uInterruptStatus); 1203 1214 break; 1204 1215 } 1205 1216 case LSILOGIC_REG_HOST_INTR_MASK: 1206 1217 { 1207 u32 = pThis->uInterruptMask;1218 u32 = ASMAtomicReadU32(&pThis->uInterruptMask); 1208 1219 break; 1209 1220 } … … 1255 1266 LogFlowFunc(("pThis=%#p uOffset=%#x pv=%#p{%.*Rhxs} cb=%u\n", pThis, uOffset, pv, cb, pv, cb)); 1256 1267 1257 return VINF_SUCCESS;1268 return rc; 1258 1269 } 1259 1270 … … 1281 1292 Assert(cb <= 4); 1282 1293 1283 return lsilogicRegisterRead(pThis, uOffset, pu32, cb); 1294 int rc = lsilogicRegisterRead(pThis, uOffset, pu32, cb); 1295 if (rc == VINF_IOM_HC_MMIO_READ) 1296 rc = VINF_IOM_HC_IOPORT_READ; 1297 1298 return rc; 1284 1299 } 1285 1300
Note:
See TracChangeset
for help on using the changeset viewer.