VirtualBox

Changeset 81745 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 7, 2019 8:55:19 PM (5 years ago)
Author:
vboxsync
Message:

DevLsiLogicSCSI: Use dev helpers for SSM and CFGM. Dropped the wakeup-up-worker-thread-queue in favor of signalling the ring-0 event semaphore. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r81591 r81745  
    199199    /** Flag whether the R0 part of the device is enabled. */
    200200    bool                 fR0Enabled;
     201    bool                 afPaddingMinus1[2+4];
    201202
    202203    /** The state the controller is currently in. */
     
    214215    /** Flag whether the diagnostic address and RW registers are enabled. */
    215216    bool                 fDiagRegsEnabled;
    216 
    217     /** Queue to send tasks to R3. - R3 ptr */
    218     R3PTRTYPE(PPDMQUEUE) pNotificationQueueR3;
    219     /** Queue to send tasks to R3. - R0 ptr */
    220     R0PTRTYPE(PPDMQUEUE) pNotificationQueueR0;
    221     /** Queue to send tasks to R3. - RC ptr */
    222     RCPTRTYPE(PPDMQUEUE) pNotificationQueueRC;
    223217
    224218    /** Number of device states allocated. */
     
    13171311                if (ASMAtomicReadBool(&pThis->fWrkThreadSleeping))
    13181312                {
    1319 #ifdef IN_RC
    1320                     PPDMQUEUEITEMCORE pNotificationItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotificationQueue));
    1321                     AssertPtr(pNotificationItem);
    1322                     PDMQueueInsert(pThis->CTX_SUFF(pNotificationQueue), pNotificationItem);
    1323 #else
    13241313                    LogFlowFunc(("Signal event semaphore\n"));
    13251314                    rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess);
    13261315                    AssertRC(rc);
    1327 #endif
    13281316                }
    13291317            }
     
    38043792
    38053793/**
    3806  * @callback_method_impl{FNPDMQUEUEDEV, Transmit queue consumer.}
    3807  */
    3808 static DECLCALLBACK(bool) lsilogicR3NotifyQueueConsumer(PPDMDEVINS pDevIns, PPDMQUEUEITEMCORE pItem)
    3809 {
    3810     RT_NOREF(pItem);
    3811     PLSILOGICSCSI pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI);
    3812     int rc = VINF_SUCCESS;
    3813 
    3814     LogFlowFunc(("pDevIns=%#p pItem=%#p\n", pDevIns, pItem));
    3815 
    3816     rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess);
    3817     AssertRC(rc);
    3818 
    3819     return true;
    3820 }
    3821 
    3822 /**
    38233794 * Sets the emulated controller type from a given string.
    38243795 *
     
    39603931    {
    39613932        ASMAtomicXchgBool(&pThis->fBiosReqPending, true);
    3962         /* Send a notifier to the PDM queue that there are pending requests. */
    3963         PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotificationQueue));
    3964         AssertMsg(pItem, ("Allocating item for queue failed\n"));
    3965         PDMQueueInsert(pThis->CTX_SUFF(pNotificationQueue), (PPDMQUEUEITEMCORE)pItem);
     3933        /* Notify the worker thread that there are pending requests. */
     3934        LogFlowFunc(("Signal event semaphore\n"));
     3935        rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess);
     3936        AssertRC(rc);
    39663937    }
    39673938    else if (RT_FAILURE(rc))
     
    39893960    {
    39903961        ASMAtomicXchgBool(&pThis->fBiosReqPending, true);
    3991         /* Send a notifier to the PDM queue that there are pending requests. */
    3992         PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotificationQueue));
    3993         AssertMsg(pItem, ("Allocating item for queue failed\n"));
    3994         PDMQueueInsert(pThis->CTX_SUFF(pNotificationQueue), (PPDMQUEUEITEMCORE)pItem);
     3962        /* Notify the worker thread that there are pending requests. */
     3963        LogFlowFunc(("Signal event semaphore\n"));
     3964        rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess);
     3965        AssertRC(rc);
    39953966    }
    39963967    else if (RT_FAILURE(rc))
     
    44304401    if (pThis->fNotificationSent)
    44314402    {
    4432         /* Send a notifier to the PDM queue that there are pending requests. */
    4433         PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotificationQueue));
    4434         AssertMsg(pItem, ("Allocating item for queue failed\n"));
    4435         PDMQueueInsert(pThis->CTX_SUFF(pNotificationQueue), (PPDMQUEUEITEMCORE)pItem);
     4403        /* Notify the worker thread that there are pending requests. */
     4404        LogFlowFunc(("Signal event semaphore\n"));
     4405        int rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess);
     4406        AssertRC(rc);
    44364407    }
    44374408}
     
    44494420    RT_NOREF(uPass);
    44504421    PLSILOGICSCSI pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI);
    4451 
    4452     SSMR3PutU32(pSSM, pThis->enmCtrlType);
    4453     SSMR3PutU32(pSSM, pThis->cDeviceStates);
    4454     SSMR3PutU32(pSSM, pThis->cPorts);
     4422    PCPDMDEVHLPR3 pHlp  = pDevIns->pHlpR3;
     4423
     4424    pHlp->pfnSSMPutU32(pSSM, pThis->enmCtrlType);
     4425    pHlp->pfnSSMPutU32(pSSM, pThis->cDeviceStates);
     4426    pHlp->pfnSSMPutU32(pSSM, pThis->cPorts);
    44554427
    44564428    /* Save the device config. */
    44574429    for (unsigned i = 0; i < pThis->cDeviceStates; i++)
    4458         SSMR3PutBool(pSSM, pThis->paDeviceStates[i].pDrvBase != NULL);
     4430        pHlp->pfnSSMPutBool(pSSM, pThis->paDeviceStates[i].pDrvBase != NULL);
    44594431
    44604432    return VINF_SSM_DONT_CALL_AGAIN;
     
    44674439{
    44684440    PLSILOGICSCSI pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI);
     4441    PCPDMDEVHLPR3 pHlp  = pDevIns->pHlpR3;
    44694442
    44704443    /* Every device first. */
     
    44764449        AssertMsg(!pDevice->cOutstandingRequests,
    44774450                  ("There are still outstanding requests on this device\n"));
    4478         SSMR3PutU32(pSSM, pDevice->cOutstandingRequests);
     4451        pHlp->pfnSSMPutU32(pSSM, pDevice->cOutstandingRequests);
    44794452
    44804453        /* Query all suspended requests and store them in the request queue. */
     
    45204493
    45214494    /* Now the main device state. */
    4522     SSMR3PutU32   (pSSM, pThis->enmState);
    4523     SSMR3PutU32   (pSSM, pThis->enmWhoInit);
    4524     SSMR3PutU32   (pSSM, pThis->enmDoorbellState);
    4525     SSMR3PutBool  (pSSM, pThis->fDiagnosticEnabled);
    4526     SSMR3PutBool  (pSSM, pThis->fNotificationSent);
    4527     SSMR3PutBool  (pSSM, pThis->fEventNotificationEnabled);
    4528     SSMR3PutU32   (pSSM, pThis->uInterruptMask);
    4529     SSMR3PutU32   (pSSM, pThis->uInterruptStatus);
     4495    pHlp->pfnSSMPutU32(pSSM, pThis->enmState);
     4496    pHlp->pfnSSMPutU32(pSSM, pThis->enmWhoInit);
     4497    pHlp->pfnSSMPutU32(pSSM, pThis->enmDoorbellState);
     4498    pHlp->pfnSSMPutBool(pSSM, pThis->fDiagnosticEnabled);
     4499    pHlp->pfnSSMPutBool(pSSM, pThis->fNotificationSent);
     4500    pHlp->pfnSSMPutBool(pSSM, pThis->fEventNotificationEnabled);
     4501    pHlp->pfnSSMPutU32(pSSM, pThis->uInterruptMask);
     4502    pHlp->pfnSSMPutU32(pSSM, pThis->uInterruptStatus);
    45304503    for (unsigned i = 0; i < RT_ELEMENTS(pThis->aMessage); i++)
    4531         SSMR3PutU32   (pSSM, pThis->aMessage[i]);
    4532     SSMR3PutU32   (pSSM, pThis->iMessage);
    4533     SSMR3PutU32   (pSSM, pThis->cMessage);
    4534     SSMR3PutMem   (pSSM, &pThis->ReplyBuffer, sizeof(pThis->ReplyBuffer));
    4535     SSMR3PutU32   (pSSM, pThis->uNextReplyEntryRead);
    4536     SSMR3PutU32   (pSSM, pThis->cReplySize);
    4537     SSMR3PutU16   (pSSM, pThis->u16IOCFaultCode);
    4538     SSMR3PutU32   (pSSM, pThis->u32HostMFAHighAddr);
    4539     SSMR3PutU32   (pSSM, pThis->u32SenseBufferHighAddr);
    4540     SSMR3PutU8    (pSSM, pThis->cMaxDevices);
    4541     SSMR3PutU8    (pSSM, pThis->cMaxBuses);
    4542     SSMR3PutU16   (pSSM, pThis->cbReplyFrame);
    4543     SSMR3PutU32   (pSSM, pThis->iDiagnosticAccess);
    4544     SSMR3PutU32   (pSSM, pThis->cReplyQueueEntries);
    4545     SSMR3PutU32   (pSSM, pThis->cRequestQueueEntries);
    4546     SSMR3PutU32   (pSSM, pThis->uReplyFreeQueueNextEntryFreeWrite);
    4547     SSMR3PutU32   (pSSM, pThis->uReplyFreeQueueNextAddressRead);
    4548     SSMR3PutU32   (pSSM, pThis->uReplyPostQueueNextEntryFreeWrite);
    4549     SSMR3PutU32   (pSSM, pThis->uReplyPostQueueNextAddressRead);
    4550     SSMR3PutU32   (pSSM, pThis->uRequestQueueNextEntryFreeWrite);
    4551     SSMR3PutU32   (pSSM, pThis->uRequestQueueNextAddressRead);
     4504        pHlp->pfnSSMPutU32(pSSM, pThis->aMessage[i]);
     4505    pHlp->pfnSSMPutU32(pSSM, pThis->iMessage);
     4506    pHlp->pfnSSMPutU32(pSSM, pThis->cMessage);
     4507    pHlp->pfnSSMPutMem(pSSM, &pThis->ReplyBuffer, sizeof(pThis->ReplyBuffer));
     4508    pHlp->pfnSSMPutU32(pSSM, pThis->uNextReplyEntryRead);
     4509    pHlp->pfnSSMPutU32(pSSM, pThis->cReplySize);
     4510    pHlp->pfnSSMPutU16(pSSM, pThis->u16IOCFaultCode);
     4511    pHlp->pfnSSMPutU32(pSSM, pThis->u32HostMFAHighAddr);
     4512    pHlp->pfnSSMPutU32(pSSM, pThis->u32SenseBufferHighAddr);
     4513    pHlp->pfnSSMPutU8(pSSM, pThis->cMaxDevices);
     4514    pHlp->pfnSSMPutU8(pSSM, pThis->cMaxBuses);
     4515    pHlp->pfnSSMPutU16(pSSM, pThis->cbReplyFrame);
     4516    pHlp->pfnSSMPutU32(pSSM, pThis->iDiagnosticAccess);
     4517    pHlp->pfnSSMPutU32(pSSM, pThis->cReplyQueueEntries);
     4518    pHlp->pfnSSMPutU32(pSSM, pThis->cRequestQueueEntries);
     4519    pHlp->pfnSSMPutU32(pSSM, pThis->uReplyFreeQueueNextEntryFreeWrite);
     4520    pHlp->pfnSSMPutU32(pSSM, pThis->uReplyFreeQueueNextAddressRead);
     4521    pHlp->pfnSSMPutU32(pSSM, pThis->uReplyPostQueueNextEntryFreeWrite);
     4522    pHlp->pfnSSMPutU32(pSSM, pThis->uReplyPostQueueNextAddressRead);
     4523    pHlp->pfnSSMPutU32(pSSM, pThis->uRequestQueueNextEntryFreeWrite);
     4524    pHlp->pfnSSMPutU32(pSSM, pThis->uRequestQueueNextAddressRead);
    45524525
    45534526    for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++)
    4554         SSMR3PutU32(pSSM, pThis->pReplyFreeQueueBaseR3[i]);
     4527        pHlp->pfnSSMPutU32(pSSM, pThis->pReplyFreeQueueBaseR3[i]);
    45554528    for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++)
    4556         SSMR3PutU32(pSSM, pThis->pReplyPostQueueBaseR3[i]);
     4529        pHlp->pfnSSMPutU32(pSSM, pThis->pReplyPostQueueBaseR3[i]);
    45574530    for (unsigned i = 0; i < pThis->cRequestQueueEntries; i++)
    4558         SSMR3PutU32(pSSM, pThis->pRequestQueueBaseR3[i]);
    4559 
    4560     SSMR3PutU16   (pSSM, pThis->u16NextHandle);
     4531        pHlp->pfnSSMPutU32(pSSM, pThis->pRequestQueueBaseR3[i]);
     4532
     4533    pHlp->pfnSSMPutU16(pSSM, pThis->u16NextHandle);
    45614534
    45624535    /* Save diagnostic memory register and data regions. */
    4563     SSMR3PutU32   (pSSM, pThis->u32DiagMemAddr);
    4564     SSMR3PutU32   (pSSM, lsilogicR3MemRegionsCount(pThis));
     4536    pHlp->pfnSSMPutU32(pSSM, pThis->u32DiagMemAddr);
     4537    pHlp->pfnSSMPutU32(pSSM, lsilogicR3MemRegionsCount(pThis));
    45654538
    45664539    PLSILOGICMEMREGN pIt;
    45674540    RTListForEach(&pThis->ListMemRegns, pIt, LSILOGICMEMREGN, NodeList)
    45684541    {
    4569         SSMR3PutU32(pSSM, pIt->u32AddrStart);
    4570         SSMR3PutU32(pSSM, pIt->u32AddrEnd);
    4571         SSMR3PutMem(pSSM, &pIt->au32Data[0], (pIt->u32AddrEnd - pIt->u32AddrStart + 1) * sizeof(uint32_t));
     4542        pHlp->pfnSSMPutU32(pSSM, pIt->u32AddrStart);
     4543        pHlp->pfnSSMPutU32(pSSM, pIt->u32AddrEnd);
     4544        pHlp->pfnSSMPutMem(pSSM, &pIt->au32Data[0], (pIt->u32AddrEnd - pIt->u32AddrStart + 1) * sizeof(uint32_t));
    45724545    }
    45734546
    45744547    PMptConfigurationPagesSupported pPages = pThis->pConfigurationPages;
    45754548
    4576     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage0, sizeof(MptConfigurationPageManufacturing0));
    4577     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage1, sizeof(MptConfigurationPageManufacturing1));
    4578     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage2, sizeof(MptConfigurationPageManufacturing2));
    4579     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage3, sizeof(MptConfigurationPageManufacturing3));
    4580     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage4, sizeof(MptConfigurationPageManufacturing4));
    4581     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage5, sizeof(MptConfigurationPageManufacturing5));
    4582     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage6, sizeof(MptConfigurationPageManufacturing6));
    4583     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage8, sizeof(MptConfigurationPageManufacturing8));
    4584     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage9, sizeof(MptConfigurationPageManufacturing9));
    4585     SSMR3PutMem   (pSSM, &pPages->ManufacturingPage10, sizeof(MptConfigurationPageManufacturing10));
    4586     SSMR3PutMem   (pSSM, &pPages->IOUnitPage0, sizeof(MptConfigurationPageIOUnit0));
    4587     SSMR3PutMem   (pSSM, &pPages->IOUnitPage1, sizeof(MptConfigurationPageIOUnit1));
    4588     SSMR3PutMem   (pSSM, &pPages->IOUnitPage2, sizeof(MptConfigurationPageIOUnit2));
    4589     SSMR3PutMem   (pSSM, &pPages->IOUnitPage3, sizeof(MptConfigurationPageIOUnit3));
    4590     SSMR3PutMem   (pSSM, &pPages->IOUnitPage4, sizeof(MptConfigurationPageIOUnit4));
    4591     SSMR3PutMem   (pSSM, &pPages->IOCPage0, sizeof(MptConfigurationPageIOC0));
    4592     SSMR3PutMem   (pSSM, &pPages->IOCPage1, sizeof(MptConfigurationPageIOC1));
    4593     SSMR3PutMem   (pSSM, &pPages->IOCPage2, sizeof(MptConfigurationPageIOC2));
    4594     SSMR3PutMem   (pSSM, &pPages->IOCPage3, sizeof(MptConfigurationPageIOC3));
    4595     SSMR3PutMem   (pSSM, &pPages->IOCPage4, sizeof(MptConfigurationPageIOC4));
    4596     SSMR3PutMem   (pSSM, &pPages->IOCPage6, sizeof(MptConfigurationPageIOC6));
    4597     SSMR3PutMem   (pSSM, &pPages->BIOSPage1, sizeof(MptConfigurationPageBIOS1));
    4598     SSMR3PutMem   (pSSM, &pPages->BIOSPage2, sizeof(MptConfigurationPageBIOS2));
    4599     SSMR3PutMem   (pSSM, &pPages->BIOSPage4, sizeof(MptConfigurationPageBIOS4));
     4549    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage0, sizeof(MptConfigurationPageManufacturing0));
     4550    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage1, sizeof(MptConfigurationPageManufacturing1));
     4551    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage2, sizeof(MptConfigurationPageManufacturing2));
     4552    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage3, sizeof(MptConfigurationPageManufacturing3));
     4553    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage4, sizeof(MptConfigurationPageManufacturing4));
     4554    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage5, sizeof(MptConfigurationPageManufacturing5));
     4555    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage6, sizeof(MptConfigurationPageManufacturing6));
     4556    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage8, sizeof(MptConfigurationPageManufacturing8));
     4557    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage9, sizeof(MptConfigurationPageManufacturing9));
     4558    pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage10, sizeof(MptConfigurationPageManufacturing10));
     4559    pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage0, sizeof(MptConfigurationPageIOUnit0));
     4560    pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage1, sizeof(MptConfigurationPageIOUnit1));
     4561    pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage2, sizeof(MptConfigurationPageIOUnit2));
     4562    pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage3, sizeof(MptConfigurationPageIOUnit3));
     4563    pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage4, sizeof(MptConfigurationPageIOUnit4));
     4564    pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage0, sizeof(MptConfigurationPageIOC0));
     4565    pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage1, sizeof(MptConfigurationPageIOC1));
     4566    pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage2, sizeof(MptConfigurationPageIOC2));
     4567    pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage3, sizeof(MptConfigurationPageIOC3));
     4568    pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage4, sizeof(MptConfigurationPageIOC4));
     4569    pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage6, sizeof(MptConfigurationPageIOC6));
     4570    pHlp->pfnSSMPutMem(pSSM, &pPages->BIOSPage1, sizeof(MptConfigurationPageBIOS1));
     4571    pHlp->pfnSSMPutMem(pSSM, &pPages->BIOSPage2, sizeof(MptConfigurationPageBIOS2));
     4572    pHlp->pfnSSMPutMem(pSSM, &pPages->BIOSPage4, sizeof(MptConfigurationPageBIOS4));
    46004573
    46014574    /* Device dependent pages */
     
    46044577        PMptConfigurationPagesSpi pSpiPages = &pPages->u.SpiPages;
    46054578
    4606         SSMR3PutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage0, sizeof(MptConfigurationPageSCSISPIPort0));
    4607         SSMR3PutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage1, sizeof(MptConfigurationPageSCSISPIPort1));
    4608         SSMR3PutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage2, sizeof(MptConfigurationPageSCSISPIPort2));
     4579        pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage0, sizeof(MptConfigurationPageSCSISPIPort0));
     4580        pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage1, sizeof(MptConfigurationPageSCSISPIPort1));
     4581        pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage2, sizeof(MptConfigurationPageSCSISPIPort2));
    46094582
    46104583        for (unsigned i = 0; i < RT_ELEMENTS(pSpiPages->aBuses[0].aDevicePages); i++)
    46114584        {
    4612             SSMR3PutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage0, sizeof(MptConfigurationPageSCSISPIDevice0));
    4613             SSMR3PutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage1, sizeof(MptConfigurationPageSCSISPIDevice1));
    4614             SSMR3PutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage2, sizeof(MptConfigurationPageSCSISPIDevice2));
    4615             SSMR3PutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage3, sizeof(MptConfigurationPageSCSISPIDevice3));
     4585            pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage0, sizeof(MptConfigurationPageSCSISPIDevice0));
     4586            pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage1, sizeof(MptConfigurationPageSCSISPIDevice1));
     4587            pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage2, sizeof(MptConfigurationPageSCSISPIDevice2));
     4588            pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage3, sizeof(MptConfigurationPageSCSISPIDevice3));
    46164589        }
    46174590    }
     
    46204593        PMptConfigurationPagesSas pSasPages = &pPages->u.SasPages;
    46214594
    4622         SSMR3PutU32(pSSM, pSasPages->cbManufacturingPage7);
    4623         SSMR3PutU32(pSSM, pSasPages->cbSASIOUnitPage0);
    4624         SSMR3PutU32(pSSM, pSasPages->cbSASIOUnitPage1);
    4625 
    4626         SSMR3PutMem(pSSM, pSasPages->pManufacturingPage7, pSasPages->cbManufacturingPage7);
    4627         SSMR3PutMem(pSSM, pSasPages->pSASIOUnitPage0, pSasPages->cbSASIOUnitPage0);
    4628         SSMR3PutMem(pSSM, pSasPages->pSASIOUnitPage1, pSasPages->cbSASIOUnitPage1);
    4629 
    4630         SSMR3PutMem(pSSM, &pSasPages->SASIOUnitPage2, sizeof(MptConfigurationPageSASIOUnit2));
    4631         SSMR3PutMem(pSSM, &pSasPages->SASIOUnitPage3, sizeof(MptConfigurationPageSASIOUnit3));
    4632 
    4633         SSMR3PutU32(pSSM, pSasPages->cPHYs);
     4595        pHlp->pfnSSMPutU32(pSSM, pSasPages->cbManufacturingPage7);
     4596        pHlp->pfnSSMPutU32(pSSM, pSasPages->cbSASIOUnitPage0);
     4597        pHlp->pfnSSMPutU32(pSSM, pSasPages->cbSASIOUnitPage1);
     4598
     4599        pHlp->pfnSSMPutMem(pSSM, pSasPages->pManufacturingPage7, pSasPages->cbManufacturingPage7);
     4600        pHlp->pfnSSMPutMem(pSSM, pSasPages->pSASIOUnitPage0, pSasPages->cbSASIOUnitPage0);
     4601        pHlp->pfnSSMPutMem(pSSM, pSasPages->pSASIOUnitPage1, pSasPages->cbSASIOUnitPage1);
     4602
     4603        pHlp->pfnSSMPutMem(pSSM, &pSasPages->SASIOUnitPage2, sizeof(MptConfigurationPageSASIOUnit2));
     4604        pHlp->pfnSSMPutMem(pSSM, &pSasPages->SASIOUnitPage3, sizeof(MptConfigurationPageSASIOUnit3));
     4605
     4606        pHlp->pfnSSMPutU32(pSSM, pSasPages->cPHYs);
    46344607        for (unsigned i = 0; i < pSasPages->cPHYs; i++)
    46354608        {
    4636             SSMR3PutMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage0, sizeof(MptConfigurationPageSASPHY0));
    4637             SSMR3PutMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage1, sizeof(MptConfigurationPageSASPHY1));
     4609            pHlp->pfnSSMPutMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage0, sizeof(MptConfigurationPageSASPHY0));
     4610            pHlp->pfnSSMPutMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage1, sizeof(MptConfigurationPageSASPHY1));
    46384611        }
    46394612
    46404613        /* The number of devices first. */
    4641         SSMR3PutU32(pSSM, pSasPages->cDevices);
    4642 
    4643         PMptSASDevice pCurr = pSasPages->pSASDeviceHead;
    4644 
    4645         while (pCurr)
    4646         {
    4647             SSMR3PutMem(pSSM, &pCurr->SASDevicePage0, sizeof(MptConfigurationPageSASDevice0));
    4648             SSMR3PutMem(pSSM, &pCurr->SASDevicePage1, sizeof(MptConfigurationPageSASDevice1));
    4649             SSMR3PutMem(pSSM, &pCurr->SASDevicePage2, sizeof(MptConfigurationPageSASDevice2));
    4650 
    4651             pCurr = pCurr->pNext;
     4614        pHlp->pfnSSMPutU32(pSSM, pSasPages->cDevices);
     4615
     4616        for (PMptSASDevice pCurr = pSasPages->pSASDeviceHead; pCurr; pCurr = pCurr->pNext)
     4617        {
     4618            pHlp->pfnSSMPutMem(pSSM, &pCurr->SASDevicePage0, sizeof(MptConfigurationPageSASDevice0));
     4619            pHlp->pfnSSMPutMem(pSSM, &pCurr->SASDevicePage1, sizeof(MptConfigurationPageSASDevice1));
     4620            pHlp->pfnSSMPutMem(pSSM, &pCurr->SASDevicePage2, sizeof(MptConfigurationPageSASDevice2));
    46524621        }
    46534622    }
     
    46564625
    46574626    vboxscsiR3SaveExec(&pThis->VBoxSCSI, pSSM);
    4658     return SSMR3PutU32(pSSM, UINT32_MAX);
     4627    return pHlp->pfnSSMPutU32(pSSM, UINT32_MAX);
    46594628}
    46604629
     
    46774646{
    46784647    PLSILOGICSCSI   pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI);
     4648    PCPDMDEVHLPR3   pHlp  = pDevIns->pHlpR3;
    46794649    int             rc;
    46804650
     
    46924662        uint32_t cDeviceStates, cPorts;
    46934663
    4694         rc = SSMR3GetU32(pSSM, (uint32_t *)&enmCtrlType);
     4664        pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&enmCtrlType);
     4665        pHlp->pfnSSMGetU32(pSSM, &cDeviceStates);
     4666        rc = pHlp->pfnSSMGetU32(pSSM, &cPorts);
    46954667        AssertRCReturn(rc, rc);
    4696         rc = SSMR3GetU32(pSSM, &cDeviceStates);
    4697         AssertRCReturn(rc, rc);
    4698         rc = SSMR3GetU32(pSSM, &cPorts);
    4699         AssertRCReturn(rc, rc);
    47004668
    47014669        if (enmCtrlType != pThis->enmCtrlType)
    4702             return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Controller type): config=%d state=%d"),
    4703                                     pThis->enmCtrlType, enmCtrlType);
     4670            return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Controller type): config=%d state=%d"),
     4671                                           pThis->enmCtrlType, enmCtrlType);
    47044672        if (cDeviceStates != pThis->cDeviceStates)
    4705             return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Device states): config=%u state=%u"),
    4706                                     pThis->cDeviceStates, cDeviceStates);
     4673            return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Device states): config=%u state=%u"),
     4674                                           pThis->cDeviceStates, cDeviceStates);
    47074675        if (cPorts != pThis->cPorts)
    4708             return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Ports): config=%u state=%u"),
    4709                                     pThis->cPorts, cPorts);
     4676            return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Ports): config=%u state=%u"),
     4677                                           pThis->cPorts, cPorts);
    47104678    }
    47114679    if (uVersion > LSILOGIC_SAVED_STATE_VERSION_VBOX_30)
     
    47144682        {
    47154683            bool fPresent;
    4716             rc = SSMR3GetBool(pSSM, &fPresent);
     4684            rc = pHlp->pfnSSMGetBool(pSSM, &fPresent);
    47174685            AssertRCReturn(rc, rc);
    47184686            if (fPresent != (pThis->paDeviceStates[i].pDrvBase != NULL))
    4719                 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Target %u config mismatch: config=%RTbool state=%RTbool"),
    4720                                          i, pThis->paDeviceStates[i].pDrvBase != NULL, fPresent);
     4687                return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Target %u config mismatch: config=%RTbool state=%RTbool"),
     4688                                               i, pThis->paDeviceStates[i].pDrvBase != NULL, fPresent);
    47214689        }
    47224690    }
     
    47314699        AssertMsg(!pDevice->cOutstandingRequests,
    47324700                  ("There are still outstanding requests on this device\n"));
    4733         SSMR3GetU32(pSSM, (uint32_t *)&pDevice->cOutstandingRequests);
     4701        pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pDevice->cOutstandingRequests);
    47344702    }
    47354703    /* Now the main device state. */
    4736     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->enmState);
    4737     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->enmWhoInit);
     4704    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->enmState);
     4705    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->enmWhoInit);
    47384706    if (uVersion <= LSILOGIC_SAVED_STATE_VERSION_BOOL_DOORBELL)
    47394707    {
     
    47444712         * doorbell not in use or a Function handshake is currently in progress.
    47454713         */
    4746         SSMR3GetBool  (pSSM, &fDoorbellInProgress);
     4714        pHlp->pfnSSMGetBool  (pSSM, &fDoorbellInProgress);
    47474715        if (fDoorbellInProgress)
    47484716            pThis->enmDoorbellState = LSILOGICDOORBELLSTATE_FN_HANDSHAKE;
     
    47514719    }
    47524720    else
    4753         SSMR3GetU32(pSSM, (uint32_t *)&pThis->enmDoorbellState);
    4754     SSMR3GetBool  (pSSM, &pThis->fDiagnosticEnabled);
    4755     SSMR3GetBool  (pSSM, &pThis->fNotificationSent);
    4756     SSMR3GetBool  (pSSM, &pThis->fEventNotificationEnabled);
    4757     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->uInterruptMask);
    4758     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->uInterruptStatus);
     4721        pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->enmDoorbellState);
     4722    pHlp->pfnSSMGetBool(pSSM, &pThis->fDiagnosticEnabled);
     4723    pHlp->pfnSSMGetBool(pSSM, &pThis->fNotificationSent);
     4724    pHlp->pfnSSMGetBool(pSSM, &pThis->fEventNotificationEnabled);
     4725    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uInterruptMask);
     4726    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uInterruptStatus);
    47594727    for (unsigned i = 0; i < RT_ELEMENTS(pThis->aMessage); i++)
    4760         SSMR3GetU32   (pSSM, &pThis->aMessage[i]);
    4761     SSMR3GetU32   (pSSM, &pThis->iMessage);
    4762     SSMR3GetU32   (pSSM, &pThis->cMessage);
    4763     SSMR3GetMem   (pSSM, &pThis->ReplyBuffer, sizeof(pThis->ReplyBuffer));
    4764     SSMR3GetU32   (pSSM, &pThis->uNextReplyEntryRead);
    4765     SSMR3GetU32   (pSSM, &pThis->cReplySize);
    4766     SSMR3GetU16   (pSSM, &pThis->u16IOCFaultCode);
    4767     SSMR3GetU32   (pSSM, &pThis->u32HostMFAHighAddr);
    4768     SSMR3GetU32   (pSSM, &pThis->u32SenseBufferHighAddr);
    4769     SSMR3GetU8    (pSSM, &pThis->cMaxDevices);
    4770     SSMR3GetU8    (pSSM, &pThis->cMaxBuses);
    4771     SSMR3GetU16   (pSSM, &pThis->cbReplyFrame);
    4772     SSMR3GetU32   (pSSM, &pThis->iDiagnosticAccess);
     4728        pHlp->pfnSSMGetU32   (pSSM, &pThis->aMessage[i]);
     4729    pHlp->pfnSSMGetU32(pSSM, &pThis->iMessage);
     4730    pHlp->pfnSSMGetU32(pSSM, &pThis->cMessage);
     4731    pHlp->pfnSSMGetMem(pSSM, &pThis->ReplyBuffer, sizeof(pThis->ReplyBuffer));
     4732    pHlp->pfnSSMGetU32(pSSM, &pThis->uNextReplyEntryRead);
     4733    pHlp->pfnSSMGetU32(pSSM, &pThis->cReplySize);
     4734    pHlp->pfnSSMGetU16(pSSM, &pThis->u16IOCFaultCode);
     4735    pHlp->pfnSSMGetU32(pSSM, &pThis->u32HostMFAHighAddr);
     4736    pHlp->pfnSSMGetU32(pSSM, &pThis->u32SenseBufferHighAddr);
     4737    pHlp->pfnSSMGetU8(pSSM, &pThis->cMaxDevices);
     4738    pHlp->pfnSSMGetU8(pSSM, &pThis->cMaxBuses);
     4739    pHlp->pfnSSMGetU16(pSSM, &pThis->cbReplyFrame);
     4740    pHlp->pfnSSMGetU32(pSSM, &pThis->iDiagnosticAccess);
    47734741
    47744742    uint32_t cReplyQueueEntries, cRequestQueueEntries;
    4775     SSMR3GetU32   (pSSM, &cReplyQueueEntries);
    4776     SSMR3GetU32   (pSSM, &cRequestQueueEntries);
     4743    pHlp->pfnSSMGetU32(pSSM, &cReplyQueueEntries);
     4744    rc = pHlp->pfnSSMGetU32(pSSM, &cRequestQueueEntries);
     4745    AssertRCReturn(rc, rc);
    47774746
    47784747    if (   cReplyQueueEntries != pThis->cReplyQueueEntries
     
    47894758    }
    47904759
    4791     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->uReplyFreeQueueNextEntryFreeWrite);
    4792     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->uReplyFreeQueueNextAddressRead);
    4793     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->uReplyPostQueueNextEntryFreeWrite);
    4794     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->uReplyPostQueueNextAddressRead);
    4795     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->uRequestQueueNextEntryFreeWrite);
    4796     SSMR3GetU32   (pSSM, (uint32_t *)&pThis->uRequestQueueNextAddressRead);
     4760    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uReplyFreeQueueNextEntryFreeWrite);
     4761    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uReplyFreeQueueNextAddressRead);
     4762    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uReplyPostQueueNextEntryFreeWrite);
     4763    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uReplyPostQueueNextAddressRead);
     4764    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uRequestQueueNextEntryFreeWrite);
     4765    pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uRequestQueueNextAddressRead);
    47974766
    47984767    PMptConfigurationPagesSupported pPages = pThis->pConfigurationPages;
     
    48044773
    48054774        if (pThis->enmCtrlType != LSILOGICCTRLTYPE_SCSI_SPI)
    4806             return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch: Expected SPI SCSI controller"));
    4807 
    4808         SSMR3GetMem(pSSM, &ConfigPagesV2,
     4775            return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch: Expected SPI SCSI controller"));
     4776
     4777        pHlp->pfnSSMGetMem(pSSM, &ConfigPagesV2,
    48094778                    sizeof(MptConfigurationPagesSupported_SSM_V2));
    48104779
     
    48414810        /* Queue content */
    48424811        for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++)
    4843             SSMR3GetU32(pSSM, (uint32_t *)&pThis->pReplyFreeQueueBaseR3[i]);
     4812            pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->pReplyFreeQueueBaseR3[i]);
    48444813        for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++)
    4845             SSMR3GetU32(pSSM, (uint32_t *)&pThis->pReplyPostQueueBaseR3[i]);
     4814            pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->pReplyPostQueueBaseR3[i]);
    48464815        for (unsigned i = 0; i < pThis->cRequestQueueEntries; i++)
    4847             SSMR3GetU32(pSSM, (uint32_t *)&pThis->pRequestQueueBaseR3[i]);
    4848 
    4849         SSMR3GetU16(pSSM, &pThis->u16NextHandle);
     4816            pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->pRequestQueueBaseR3[i]);
     4817
     4818        pHlp->pfnSSMGetU16(pSSM, &pThis->u16NextHandle);
    48504819
    48514820        if (uVersion > LSILOGIC_SAVED_STATE_VERSION_PRE_DIAG_MEM)
     
    48534822
    48544823            /* Save diagnostic memory register and data regions. */
    4855             SSMR3GetU32(pSSM, &pThis->u32DiagMemAddr);
     4824            pHlp->pfnSSMGetU32(pSSM, &pThis->u32DiagMemAddr);
    48564825            uint32_t cMemRegions = 0;
    4857             rc = SSMR3GetU32(pSSM, &cMemRegions);
     4826            rc = pHlp->pfnSSMGetU32(pSSM, &cMemRegions);
    48584827            AssertLogRelRCReturn(rc, rc);
    48594828
     
    48614830            {
    48624831                uint32_t u32AddrStart = 0;
    4863                 SSMR3GetU32(pSSM, &u32AddrStart);
     4832                pHlp->pfnSSMGetU32(pSSM, &u32AddrStart);
    48644833                uint32_t u32AddrEnd = 0;
    4865                 rc = SSMR3GetU32(pSSM, &u32AddrEnd);
     4834                rc = pHlp->pfnSSMGetU32(pSSM, &u32AddrEnd);
    48664835                AssertLogRelRCReturn(rc, rc);
    48674836
     
    48724841                    pRegion->u32AddrStart = u32AddrStart;
    48734842                    pRegion->u32AddrEnd = u32AddrEnd;
    4874                     SSMR3GetMem(pSSM, &pRegion->au32Data[0], cRegion * sizeof(uint32_t));
     4843                    pHlp->pfnSSMGetMem(pSSM, &pRegion->au32Data[0], cRegion * sizeof(uint32_t));
    48754844                    lsilogicR3MemRegionInsert(pThis, pRegion);
    48764845                    pThis->cbMemRegns += cRegion * sizeof(uint32_t);
     
    48804849                    /* Leave a log message but continue. */
    48814850                    LogRel(("LsiLogic: Out of memory while restoring the state, might not work as expected\n"));
    4882                     SSMR3Skip(pSSM, cRegion * sizeof(uint32_t));
     4851                    pHlp->pfnSSMSkip(pSSM, cRegion * sizeof(uint32_t));
    48834852                }
    48844853                cMemRegions--;
     
    48874856
    48884857        /* Configuration pages */
    4889         SSMR3GetMem(pSSM, &pPages->ManufacturingPage0, sizeof(MptConfigurationPageManufacturing0));
    4890         SSMR3GetMem(pSSM, &pPages->ManufacturingPage1, sizeof(MptConfigurationPageManufacturing1));
    4891         SSMR3GetMem(pSSM, &pPages->ManufacturingPage2, sizeof(MptConfigurationPageManufacturing2));
    4892         SSMR3GetMem(pSSM, &pPages->ManufacturingPage3, sizeof(MptConfigurationPageManufacturing3));
    4893         SSMR3GetMem(pSSM, &pPages->ManufacturingPage4, sizeof(MptConfigurationPageManufacturing4));
    4894         SSMR3GetMem(pSSM, &pPages->ManufacturingPage5, sizeof(MptConfigurationPageManufacturing5));
    4895         SSMR3GetMem(pSSM, &pPages->ManufacturingPage6, sizeof(MptConfigurationPageManufacturing6));
    4896         SSMR3GetMem(pSSM, &pPages->ManufacturingPage8, sizeof(MptConfigurationPageManufacturing8));
    4897         SSMR3GetMem(pSSM, &pPages->ManufacturingPage9, sizeof(MptConfigurationPageManufacturing9));
    4898         SSMR3GetMem(pSSM, &pPages->ManufacturingPage10, sizeof(MptConfigurationPageManufacturing10));
    4899         SSMR3GetMem(pSSM, &pPages->IOUnitPage0, sizeof(MptConfigurationPageIOUnit0));
    4900         SSMR3GetMem(pSSM, &pPages->IOUnitPage1, sizeof(MptConfigurationPageIOUnit1));
    4901         SSMR3GetMem(pSSM, &pPages->IOUnitPage2, sizeof(MptConfigurationPageIOUnit2));
    4902         SSMR3GetMem(pSSM, &pPages->IOUnitPage3, sizeof(MptConfigurationPageIOUnit3));
    4903         SSMR3GetMem(pSSM, &pPages->IOUnitPage4, sizeof(MptConfigurationPageIOUnit4));
    4904         SSMR3GetMem(pSSM, &pPages->IOCPage0, sizeof(MptConfigurationPageIOC0));
    4905         SSMR3GetMem(pSSM, &pPages->IOCPage1, sizeof(MptConfigurationPageIOC1));
    4906         SSMR3GetMem(pSSM, &pPages->IOCPage2, sizeof(MptConfigurationPageIOC2));
    4907         SSMR3GetMem(pSSM, &pPages->IOCPage3, sizeof(MptConfigurationPageIOC3));
    4908         SSMR3GetMem(pSSM, &pPages->IOCPage4, sizeof(MptConfigurationPageIOC4));
    4909         SSMR3GetMem(pSSM, &pPages->IOCPage6, sizeof(MptConfigurationPageIOC6));
    4910         SSMR3GetMem(pSSM, &pPages->BIOSPage1, sizeof(MptConfigurationPageBIOS1));
    4911         SSMR3GetMem(pSSM, &pPages->BIOSPage2, sizeof(MptConfigurationPageBIOS2));
    4912         SSMR3GetMem(pSSM, &pPages->BIOSPage4, sizeof(MptConfigurationPageBIOS4));
     4858        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage0, sizeof(MptConfigurationPageManufacturing0));
     4859        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage1, sizeof(MptConfigurationPageManufacturing1));
     4860        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage2, sizeof(MptConfigurationPageManufacturing2));
     4861        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage3, sizeof(MptConfigurationPageManufacturing3));
     4862        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage4, sizeof(MptConfigurationPageManufacturing4));
     4863        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage5, sizeof(MptConfigurationPageManufacturing5));
     4864        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage6, sizeof(MptConfigurationPageManufacturing6));
     4865        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage8, sizeof(MptConfigurationPageManufacturing8));
     4866        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage9, sizeof(MptConfigurationPageManufacturing9));
     4867        pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage10, sizeof(MptConfigurationPageManufacturing10));
     4868        pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage0, sizeof(MptConfigurationPageIOUnit0));
     4869        pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage1, sizeof(MptConfigurationPageIOUnit1));
     4870        pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage2, sizeof(MptConfigurationPageIOUnit2));
     4871        pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage3, sizeof(MptConfigurationPageIOUnit3));
     4872        pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage4, sizeof(MptConfigurationPageIOUnit4));
     4873        pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage0, sizeof(MptConfigurationPageIOC0));
     4874        pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage1, sizeof(MptConfigurationPageIOC1));
     4875        pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage2, sizeof(MptConfigurationPageIOC2));
     4876        pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage3, sizeof(MptConfigurationPageIOC3));
     4877        pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage4, sizeof(MptConfigurationPageIOC4));
     4878        pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage6, sizeof(MptConfigurationPageIOC6));
     4879        pHlp->pfnSSMGetMem(pSSM, &pPages->BIOSPage1, sizeof(MptConfigurationPageBIOS1));
     4880        pHlp->pfnSSMGetMem(pSSM, &pPages->BIOSPage2, sizeof(MptConfigurationPageBIOS2));
     4881        pHlp->pfnSSMGetMem(pSSM, &pPages->BIOSPage4, sizeof(MptConfigurationPageBIOS4));
    49134882
    49144883        /* Device dependent pages */
     
    49174886            PMptConfigurationPagesSpi pSpiPages = &pPages->u.SpiPages;
    49184887
    4919             SSMR3GetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage0, sizeof(MptConfigurationPageSCSISPIPort0));
    4920             SSMR3GetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage1, sizeof(MptConfigurationPageSCSISPIPort1));
    4921             SSMR3GetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage2, sizeof(MptConfigurationPageSCSISPIPort2));
     4888            pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage0, sizeof(MptConfigurationPageSCSISPIPort0));
     4889            pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage1, sizeof(MptConfigurationPageSCSISPIPort1));
     4890            pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage2, sizeof(MptConfigurationPageSCSISPIPort2));
    49224891
    49234892            for (unsigned i = 0; i < RT_ELEMENTS(pSpiPages->aBuses[0].aDevicePages); i++)
    49244893            {
    4925                 SSMR3GetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage0, sizeof(MptConfigurationPageSCSISPIDevice0));
    4926                 SSMR3GetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage1, sizeof(MptConfigurationPageSCSISPIDevice1));
    4927                 SSMR3GetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage2, sizeof(MptConfigurationPageSCSISPIDevice2));
    4928                 SSMR3GetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage3, sizeof(MptConfigurationPageSCSISPIDevice3));
     4894                pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage0, sizeof(MptConfigurationPageSCSISPIDevice0));
     4895                pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage1, sizeof(MptConfigurationPageSCSISPIDevice1));
     4896                pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage2, sizeof(MptConfigurationPageSCSISPIDevice2));
     4897                pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage3, sizeof(MptConfigurationPageSCSISPIDevice3));
    49294898            }
    49304899        }
     
    49344903            PMptConfigurationPagesSas pSasPages = &pPages->u.SasPages;
    49354904
    4936             SSMR3GetU32(pSSM, &cbManufacturingPage7);
    4937             SSMR3GetU32(pSSM, &cbPage0);
    4938             SSMR3GetU32(pSSM, &cbPage1);
     4905            pHlp->pfnSSMGetU32(pSSM, &cbManufacturingPage7);
     4906            pHlp->pfnSSMGetU32(pSSM, &cbPage0);
     4907            rc = pHlp->pfnSSMGetU32(pSSM, &cbPage1);
     4908            AssertRCReturn(rc, rc);
    49394909
    49404910            if (   (cbPage0 != pSasPages->cbSASIOUnitPage0)
     
    49474917            AssertPtr(pSasPages->pSASIOUnitPage1);
    49484918
    4949             SSMR3GetMem(pSSM, pSasPages->pManufacturingPage7, pSasPages->cbManufacturingPage7);
    4950             SSMR3GetMem(pSSM, pSasPages->pSASIOUnitPage0, pSasPages->cbSASIOUnitPage0);
    4951             SSMR3GetMem(pSSM, pSasPages->pSASIOUnitPage1, pSasPages->cbSASIOUnitPage1);
    4952 
    4953             SSMR3GetMem(pSSM, &pSasPages->SASIOUnitPage2, sizeof(MptConfigurationPageSASIOUnit2));
    4954             SSMR3GetMem(pSSM, &pSasPages->SASIOUnitPage3, sizeof(MptConfigurationPageSASIOUnit3));
    4955 
    4956             SSMR3GetU32(pSSM, &cPHYs);
     4919            pHlp->pfnSSMGetMem(pSSM, pSasPages->pManufacturingPage7, pSasPages->cbManufacturingPage7);
     4920            pHlp->pfnSSMGetMem(pSSM, pSasPages->pSASIOUnitPage0, pSasPages->cbSASIOUnitPage0);
     4921            pHlp->pfnSSMGetMem(pSSM, pSasPages->pSASIOUnitPage1, pSasPages->cbSASIOUnitPage1);
     4922
     4923            pHlp->pfnSSMGetMem(pSSM, &pSasPages->SASIOUnitPage2, sizeof(MptConfigurationPageSASIOUnit2));
     4924            pHlp->pfnSSMGetMem(pSSM, &pSasPages->SASIOUnitPage3, sizeof(MptConfigurationPageSASIOUnit3));
     4925
     4926            rc = pHlp->pfnSSMGetU32(pSSM, &cPHYs);
     4927            AssertRCReturn(rc, rc);
    49574928            if (cPHYs != pSasPages->cPHYs)
    49584929                return VERR_SSM_LOAD_CONFIG_MISMATCH;
     
    49614932            for (unsigned i = 0; i < pSasPages->cPHYs; i++)
    49624933            {
    4963                 SSMR3GetMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage0, sizeof(MptConfigurationPageSASPHY0));
    4964                 SSMR3GetMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage1, sizeof(MptConfigurationPageSASPHY1));
     4934                pHlp->pfnSSMGetMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage0, sizeof(MptConfigurationPageSASPHY0));
     4935                pHlp->pfnSSMGetMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage1, sizeof(MptConfigurationPageSASPHY1));
    49654936            }
    49664937
    49674938            /* The number of devices first. */
    4968             SSMR3GetU32(pSSM, &pSasPages->cDevices);
     4939            rc = pHlp->pfnSSMGetU32(pSSM, &pSasPages->cDevices);
     4940            AssertRCReturn(rc, rc);
    49694941
    49704942            PMptSASDevice pCurr = pSasPages->pSASDeviceHead;
     
    49724944            for (unsigned i = 0; i < pSasPages->cDevices; i++)
    49734945            {
    4974                 SSMR3GetMem(pSSM, &pCurr->SASDevicePage0, sizeof(MptConfigurationPageSASDevice0));
    4975                 SSMR3GetMem(pSSM, &pCurr->SASDevicePage1, sizeof(MptConfigurationPageSASDevice1));
    4976                 SSMR3GetMem(pSSM, &pCurr->SASDevicePage2, sizeof(MptConfigurationPageSASDevice2));
     4946                AssertReturn(pCurr, VERR_SSM_LOAD_CONFIG_MISMATCH);
     4947
     4948                pHlp->pfnSSMGetMem(pSSM, &pCurr->SASDevicePage0, sizeof(MptConfigurationPageSASDevice0));
     4949                pHlp->pfnSSMGetMem(pSSM, &pCurr->SASDevicePage1, sizeof(MptConfigurationPageSASDevice1));
     4950                rc = pHlp->pfnSSMGetMem(pSSM, &pCurr->SASDevicePage2, sizeof(MptConfigurationPageSASDevice2));
     4951                AssertRCReturn(rc, rc);
    49774952
    49784953                pCurr = pCurr->pNext;
     
    49894964    {
    49904965        LogRel(("LsiLogic: Failed to restore BIOS state: %Rrc.\n", rc));
    4991         return PDMDEV_SET_ERROR(pDevIns, rc,
    4992                                 N_("LsiLogic: Failed to restore BIOS state\n"));
     4966        return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic: Failed to restore BIOS state\n"));
    49934967    }
    49944968
    49954969    uint32_t u32;
    4996     rc = SSMR3GetU32(pSSM, &u32);
     4970    rc = pHlp->pfnSSMGetU32(pSSM, &u32);
    49974971    if (RT_FAILURE(rc))
    49984972        return rc;
     
    53075281
    53085282    pThis->pDevInsRC        = PDMDEVINS_2_RCPTR(pDevIns);
    5309     pThis->pNotificationQueueRC = PDMQueueRCPtr(pThis->pNotificationQueueR3);
    53105283
    53115284    /* Relocate queues. */
     
    53585331{
    53595332    PLSILOGICSCSI pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI);
     5333    PCPDMDEVHLPR3 pHlp  = pDevIns->pHlpR3;
    53605334    int           rc    = VINF_SUCCESS;
    53615335    PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
     
    53715345     * Validate and read configuration.
    53725346     */
    5373     rc = CFGMR3AreValuesValid(pCfg, "GCEnabled\0"
    5374                                     "R0Enabled\0"
    5375                                     "ReplyQueueDepth\0"
    5376                                     "RequestQueueDepth\0"
    5377                                     "ControllerType\0"
    5378                                     "NumPorts\0"
    5379                                     "Bootable\0");
    5380     if (RT_FAILURE(rc))
    5381         return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    5382                                 N_("LsiLogic configuration error: unknown option specified"));
    5383     rc = CFGMR3QueryBoolDef(pCfg, "GCEnabled", &pThis->fGCEnabled, true);
    5384     if (RT_FAILURE(rc))
    5385         return PDMDEV_SET_ERROR(pDevIns, rc,
    5386                                 N_("LsiLogic configuration error: failed to read GCEnabled as boolean"));
    5387     Log(("%s: fGCEnabled=%d\n", __FUNCTION__, pThis->fGCEnabled));
    5388 
    5389     rc = CFGMR3QueryBoolDef(pCfg, "R0Enabled", &pThis->fR0Enabled, true);
    5390     if (RT_FAILURE(rc))
    5391         return PDMDEV_SET_ERROR(pDevIns, rc,
    5392                                 N_("LsiLogic configuration error: failed to read R0Enabled as boolean"));
    5393     Log(("%s: fR0Enabled=%d\n", __FUNCTION__, pThis->fR0Enabled));
    5394 
    5395     rc = CFGMR3QueryU32Def(pCfg, "ReplyQueueDepth",
    5396                            &pThis->cReplyQueueEntries,
    5397                            LSILOGICSCSI_REPLY_QUEUE_DEPTH_DEFAULT);
     5347    PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns,
     5348                                  "ReplyQueueDepth|"
     5349                                  "RequestQueueDepth|"
     5350                                  "ControllerType|"
     5351                                  "NumPorts|"
     5352                                  "Bootable",
     5353                                  "");
     5354
     5355    pThis->fGCEnabled = pDevIns->fRCEnabled;
     5356    pThis->fR0Enabled = pDevIns->fR0Enabled;
     5357
     5358    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "ReplyQueueDepth",
     5359                                  &pThis->cReplyQueueEntries, LSILOGICSCSI_REPLY_QUEUE_DEPTH_DEFAULT);
    53985360    if (RT_FAILURE(rc))
    53995361        return PDMDEV_SET_ERROR(pDevIns, rc,
     
    54015363    Log(("%s: ReplyQueueDepth=%u\n", __FUNCTION__, pThis->cReplyQueueEntries));
    54025364
    5403     rc = CFGMR3QueryU32Def(pCfg, "RequestQueueDepth",
    5404                            &pThis->cRequestQueueEntries,
    5405                            LSILOGICSCSI_REQUEST_QUEUE_DEPTH_DEFAULT);
     5365    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "RequestQueueDepth",
     5366                                  &pThis->cRequestQueueEntries, LSILOGICSCSI_REQUEST_QUEUE_DEPTH_DEFAULT);
    54065367    if (RT_FAILURE(rc))
    54075368        return PDMDEV_SET_ERROR(pDevIns, rc,
     
    54105371
    54115372    char *pszCtrlType;
    5412     rc = CFGMR3QueryStringAllocDef(pCfg, "ControllerType",
    5413                                    &pszCtrlType, LSILOGICSCSI_PCI_SPI_CTRLNAME);
     5373    rc = pHlp->pfnCFGMQueryStringAllocDef(pCfg, "ControllerType", &pszCtrlType, LSILOGICSCSI_PCI_SPI_CTRLNAME);
    54145374    if (RT_FAILURE(rc))
    54155375        return PDMDEV_SET_ERROR(pDevIns, rc,
     
    54255385                iInstance);
    54265386
    5427 
    54285387    if (RT_FAILURE(rc))
    5429         return PDMDEV_SET_ERROR(pDevIns, rc,
    5430                                 N_("LsiLogic configuration error: failed to determine controller type from string"));
    5431 
    5432     rc = CFGMR3QueryU8(pCfg, "NumPorts",
    5433                        &pThis->cPorts);
     5388        return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic configuration error: failed to determine controller type from string"));
     5389
     5390    rc = pHlp->pfnCFGMQueryU8(pCfg, "NumPorts", &pThis->cPorts);
    54345391    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    54355392    {
     
    54465403
    54475404    bool fBootable;
    5448     rc = CFGMR3QueryBoolDef(pCfg, "Bootable", &fBootable, true);
     5405    rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "Bootable", &fBootable, true);
    54495406    if (RT_FAILURE(rc))
    54505407        return PDMDEV_SET_ERROR(pDevIns, rc,
     
    55535510    if (RT_FAILURE(rc))
    55545511        return rc;
    5555 
    5556     /* Initialize task queue. (Need two items to handle SMP guest concurrency.) */
    5557     char szTaggedText[64];
    5558     RTStrPrintf(szTaggedText, sizeof(szTaggedText), "%s-Task", szDevTag);
    5559     rc = PDMDevHlpQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 2, 0,
    5560                               lsilogicR3NotifyQueueConsumer, true,
    5561                               szTaggedText,
    5562                               &pThis->pNotificationQueueR3);
    5563     if (RT_FAILURE(rc))
    5564         return rc;
    5565     pThis->pNotificationQueueR0 = PDMQueueR0Ptr(pThis->pNotificationQueueR3);
    5566     pThis->pNotificationQueueRC = PDMQueueRCPtr(pThis->pNotificationQueueR3);
    55675512
    55685513    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette