- Timestamp:
- Oct 8, 2020 6:53:02 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r85121 r86482 1250 1250 } 1251 1251 1252 /** 1253 * Memory read helper to handle PCI/ISA differences - metadata reads. 1254 * 1255 * @returns nothing. 1256 * @param pDevIns The device instance. 1257 * @param pThis Pointer to the shared BusLogic instance data. 1258 * @param GCPhys Guest physical memory address. 1259 * @param pvBuf Host side buffer address. 1260 * @param cbRead Number of bytes to read. 1261 */ 1262 static void blPhysReadMeta(PPDMDEVINS pDevIns, PBUSLOGIC pThis, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead) 1263 { 1264 if (!pThis->uIsaIrq) 1265 PDMDevHlpPCIPhysReadMeta(pDevIns, GCPhys, pvBuf, cbRead); 1266 else 1267 PDMDevHlpPhysReadMeta(pDevIns, GCPhys, pvBuf, cbRead); 1268 } 1269 1252 1270 #if defined(IN_RING3) 1253 1271 … … 1268 1286 else 1269 1287 PDMDevHlpPhysWriteUser(pDevIns, GCPhys, pvBuf, cbWrite); 1288 } 1289 1290 /** 1291 * Memory read helper to handle PCI/ISA differences - userdata reads. 1292 * 1293 * @returns nothing. 1294 * @param pDevIns The device instance. 1295 * @param pThis Pointer to the shared BusLogic instance data. 1296 * @param GCPhys Guest physical memory address. 1297 * @param pvBuf Host side buffer address. 1298 * @param cbRead Number of bytes to read. 1299 */ 1300 static void blPhysReadUser(PPDMDEVINS pDevIns, PBUSLOGIC pThis, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead) 1301 { 1302 if (!pThis->uIsaIrq) 1303 PDMDevHlpPCIPhysReadUser(pDevIns, GCPhys, pvBuf, cbRead); 1304 else 1305 PDMDevHlpPhysReadUser(pDevIns, GCPhys, pvBuf, cbRead); 1270 1306 } 1271 1307 … … 1343 1379 uint8_t uCode; 1344 1380 unsigned uCodeOffs = pThis->fMbxIs24Bit ? RT_OFFSETOF(Mailbox24, uCmdState) : RT_OFFSETOF(Mailbox32, u.out.uActionCode); 1345 PDMDevHlpPhysReadMeta(pDevIns, GCPhysAddrMailboxIncoming + uCodeOffs, &uCode, sizeof(uCode));1381 blPhysReadMeta(pDevIns, pThis, GCPhysAddrMailboxIncoming + uCodeOffs, &uCode, sizeof(uCode)); 1346 1382 Assert(uCode == BUSLOGIC_MAILBOX_INCOMING_COMPLETION_FREE); 1347 1383 # endif … … 1458 1494 { 1459 1495 /* Read the S/G entries. Convert 24-bit entries to 32-bit format. */ 1496 PBUSLOGIC pThis = PDMDEVINS_2_DATA(pDevIns, PBUSLOGIC); 1460 1497 if (fIs24Bit) 1461 1498 { … … 1464 1501 1465 1502 Log2(("Converting %u 24-bit S/G entries to 32-bit\n", cEntries)); 1466 PDMDevHlpPhysReadMeta(pDevIns, GCSGList, &aSGE24, cEntries * sizeof(SGE24));1503 blPhysReadMeta(pDevIns, pThis, GCSGList, &aSGE24, cEntries * sizeof(SGE24)); 1467 1504 for (uint32_t i = 0; i < cEntries; ++i) 1468 1505 { … … 1472 1509 } 1473 1510 else 1474 PDMDevHlpPhysReadMeta(pDevIns, GCSGList, pSGEList, cEntries * sizeof(SGE32));1511 blPhysReadMeta(pDevIns, pThis, GCSGList, pSGEList, cEntries * sizeof(SGE32)); 1475 1512 } 1476 1513 … … 1567 1604 PRTSGBUF pSgBuf, size_t cbCopy, size_t *pcbSkip) 1568 1605 { 1569 RT_NOREF(pThis);1570 1571 1606 size_t cbSkipped = RT_MIN(cbCopy, *pcbSkip); 1572 1607 cbCopy -= cbSkipped; … … 1580 1615 1581 1616 AssertPtr(pvSeg); 1582 PDMDevHlpPhysReadUser(pDevIns, GCPhys, pvSeg, cbSeg);1617 blPhysReadUser(pDevIns, pThis, GCPhys, pvSeg, cbSeg); 1583 1618 GCPhys += cbSeg; 1584 1619 cbCopy -= cbSeg; … … 2337 2372 GCPhysFifoBuf = (RTGCPHYS)ADDR_TO_U32(addr); 2338 2373 Log(("Write busmaster FIFO at: %04X\n", ADDR_TO_U32(addr))); 2339 PDMDevHlpPhysReadMeta(pDevIns, GCPhysFifoBuf, 2340 &pThis->LocalRam.u8View[64], 64); 2374 blPhysReadMeta(pDevIns, pThis, GCPhysFifoBuf, &pThis->LocalRam.u8View[64], 64); 2341 2375 break; 2342 2376 } … … 3204 3238 /* Fetch the CCB from guest memory. */ 3205 3239 /** @todo How much do we really have to read? */ 3206 PDMDevHlpPhysReadMeta(pDevIns, GCPhysAddrCCB, &CCBGuest, sizeof(CCB32));3240 blPhysReadMeta(pDevIns, pThis, GCPhysAddrCCB, &CCBGuest, sizeof(CCB32)); 3207 3241 3208 3242 uTargetIdCCB = pThis->fMbxIs24Bit ? CCBGuest.o.uTargetId : CCBGuest.n.uTargetId; … … 3288 3322 CCBU CCBGuest; 3289 3323 3290 PDMDevHlpPhysReadMeta(pDevIns, GCPhysAddrCCB, &CCBGuest, sizeof(CCB32));3324 blPhysReadMeta(pDevIns, pThis, GCPhysAddrCCB, &CCBGuest, sizeof(CCB32)); 3291 3325 3292 3326 uTargetIdCCB = pThis->fMbxIs24Bit ? CCBGuest.o.uTargetId : CCBGuest.n.uTargetId; … … 3323 3357 3324 3358 GCMailbox = pThis->GCPhysAddrMailboxOutgoingBase + (pThis->uMailboxOutgoingPositionCurrent * sizeof(Mailbox24)); 3325 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx24, sizeof(Mailbox24));3359 blPhysReadMeta(pDevIns, pThis, GCMailbox, &Mbx24, sizeof(Mailbox24)); 3326 3360 pMbx->u32PhysAddrCCB = ADDR_TO_U32(Mbx24.aPhysAddrCCB); 3327 3361 pMbx->u.out.uActionCode = Mbx24.uCmdState; … … 3330 3364 { 3331 3365 GCMailbox = pThis->GCPhysAddrMailboxOutgoingBase + (pThis->uMailboxOutgoingPositionCurrent * sizeof(Mailbox32)); 3332 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, pMbx, sizeof(Mailbox32));3366 blPhysReadMeta(pDevIns, pThis, GCMailbox, pMbx, sizeof(Mailbox32)); 3333 3367 } 3334 3368 … … 3853 3887 for (i = 0; i < pThis->cMailbox; ++i) 3854 3888 { 3855 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx24, sizeof(Mailbox24));3889 blPhysReadMeta(pDevIns, pThis, GCMailbox, &Mbx24, sizeof(Mailbox24)); 3856 3890 pHlp->pfnPrintf(pHlp, " slot %03d: CCB at %06X action code %02X", i, ADDR_TO_U32(Mbx24.aPhysAddrCCB), Mbx24.uCmdState); 3857 3891 pHlp->pfnPrintf(pHlp, "%s\n", pThis->uMailboxOutgoingPositionCurrent == i ? " *" : ""); … … 3864 3898 for (i = 0; i < pThis->cMailbox; ++i) 3865 3899 { 3866 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx24, sizeof(Mailbox24));3900 blPhysReadMeta(pDevIns, pThis, GCMailbox, &Mbx24, sizeof(Mailbox24)); 3867 3901 pHlp->pfnPrintf(pHlp, " slot %03d: CCB at %06X completion code %02X", i, ADDR_TO_U32(Mbx24.aPhysAddrCCB), Mbx24.uCmdState); 3868 3902 pHlp->pfnPrintf(pHlp, "%s\n", pThis->uMailboxIncomingPositionCurrent == i ? " *" : ""); … … 3880 3914 for (i = 0; i < pThis->cMailbox; ++i) 3881 3915 { 3882 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx32, sizeof(Mailbox32));3916 blPhysReadMeta(pDevIns, pThis, GCMailbox, &Mbx32, sizeof(Mailbox32)); 3883 3917 pHlp->pfnPrintf(pHlp, " slot %03d: CCB at %08X action code %02X", i, Mbx32.u32PhysAddrCCB, Mbx32.u.out.uActionCode); 3884 3918 pHlp->pfnPrintf(pHlp, "%s\n", pThis->uMailboxOutgoingPositionCurrent == i ? " *" : ""); … … 3891 3925 for (i = 0; i < pThis->cMailbox; ++i) 3892 3926 { 3893 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx32, sizeof(Mailbox32));3927 blPhysReadMeta(pDevIns, pThis, GCMailbox, &Mbx32, sizeof(Mailbox32)); 3894 3928 pHlp->pfnPrintf(pHlp, " slot %03d: CCB at %08X completion code %02X BTSTAT %02X SDSTAT %02X", i, 3895 3929 Mbx32.u32PhysAddrCCB, Mbx32.u.in.uCompletionCode, Mbx32.u.in.uHostAdapterStatus, Mbx32.u.in.uTargetDeviceStatus);
Note:
See TracChangeset
for help on using the changeset viewer.