Changeset 64808 in vbox
- Timestamp:
- Dec 8, 2016 12:08:01 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
r64766 r64808 287 287 /** Critical section protecting the reply free queue. */ 288 288 PDMCRITSECT ReplyFreeQueueCritSect; 289 /** Critical section protecting the request queue against 290 * concurrent access from the guest. */ 291 PDMCRITSECT RequestQueueCritSect; 292 /** Critical section protecting the reply free queue against 293 * concurrent write access from the guest. */ 294 PDMCRITSECT ReplyFreeQueueWriteCritSect; 289 295 290 296 /** Pointer to the start of the reply free queue - R3. */ … … 1276 1282 case LSILOGIC_REG_REPLY_QUEUE: 1277 1283 { 1284 int rc = PDMCritSectEnter(&pThis->ReplyFreeQueueWriteCritSect, VINF_IOM_R3_MMIO_WRITE); 1285 if (rc != VINF_SUCCESS) 1286 return rc; 1278 1287 /* Add the entry to the reply free queue. */ 1279 1288 ASMAtomicWriteU32(&pThis->CTX_SUFF(pReplyFreeQueueBase)[pThis->uReplyFreeQueueNextEntryFreeWrite], u32); 1280 1289 pThis->uReplyFreeQueueNextEntryFreeWrite++; 1281 1290 pThis->uReplyFreeQueueNextEntryFreeWrite %= pThis->cReplyQueueEntries; 1291 PDMCritSectLeave(&pThis->ReplyFreeQueueWriteCritSect); 1282 1292 break; 1283 1293 } 1284 1294 case LSILOGIC_REG_REQUEST_QUEUE: 1285 1295 { 1296 int rc = PDMCritSectEnter(&pThis->RequestQueueCritSect, VINF_IOM_R3_MMIO_WRITE); 1297 if (rc != VINF_SUCCESS) 1298 return rc; 1299 1286 1300 uint32_t uNextWrite = ASMAtomicReadU32(&pThis->uRequestQueueNextEntryFreeWrite); 1287 1301 … … 1297 1311 uNextWrite %= pThis->cRequestQueueEntries; 1298 1312 ASMAtomicWriteU32(&pThis->uRequestQueueNextEntryFreeWrite, uNextWrite); 1313 PDMCritSectLeave(&pThis->RequestQueueCritSect); 1299 1314 1300 1315 /* Send notification to R3 if there is not one sent already. Do this … … 1310 1325 #else 1311 1326 LogFlowFunc(("Signal event semaphore\n")); 1312 intrc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess);1327 rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess); 1313 1328 AssertRC(rc); 1314 1329 #endif … … 5305 5320 PDMR3CritSectDelete(&pThis->ReplyFreeQueueCritSect); 5306 5321 PDMR3CritSectDelete(&pThis->ReplyPostQueueCritSect); 5322 PDMR3CritSectDelete(&pThis->RequestQueueCritSect); 5323 PDMR3CritSectDelete(&pThis->ReplyFreeQueueWriteCritSect); 5307 5324 5308 5325 RTMemFree(pThis->paDeviceStates); … … 5470 5487 if (RT_FAILURE(rc)) 5471 5488 return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic: cannot create critical section for reply post queue")); 5489 5490 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->RequestQueueCritSect, RT_SRC_POS, "%sRQ", szDevTag); 5491 if (RT_FAILURE(rc)) 5492 return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic: cannot create critical section for request queue")); 5493 5494 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->ReplyFreeQueueWriteCritSect, RT_SRC_POS, "%sRFQW", szDevTag); 5495 if (RT_FAILURE(rc)) 5496 return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic: cannot create critical section for reply free queue write access")); 5472 5497 5473 5498 /* -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r64800 r64808 1745 1745 GEN_CHECK_OFF(LSILOGICSCSI, ReplyPostQueueCritSect); 1746 1746 GEN_CHECK_OFF(LSILOGICSCSI, ReplyFreeQueueCritSect); 1747 GEN_CHECK_OFF(LSILOGICSCSI, RequestQueueCritSect); 1748 GEN_CHECK_OFF(LSILOGICSCSI, ReplyFreeQueueWriteCritSect); 1747 1749 GEN_CHECK_OFF(LSILOGICSCSI, pReplyFreeQueueBaseR3); 1748 1750 GEN_CHECK_OFF(LSILOGICSCSI, pReplyPostQueueBaseR3);
Note:
See TracChangeset
for help on using the changeset viewer.