VirtualBox

Changeset 81802 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 12, 2019 1:51:27 PM (5 years ago)
Author:
vboxsync
Message:

DevATA: Working on converting it to new PDM device model. bugref:9218

File:
1 edited

Legend:

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

    r81801 r81802  
    68626862    RT_NOREF1(uPass);
    68636863    PCIATAState *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
    6864 
    6865     SSMR3PutU8(pSSM, pThis->u8Type);
     6864    PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3;
     6865
     6866    pHlp->pfnSSMPutU8(pSSM, pThis->u8Type);
    68666867    for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aCts); i++)
    68676868    {
    6868         SSMR3PutBool(pSSM, true);       /* For controller enabled / disabled. */
     6869        pHlp->pfnSSMPutBool(pSSM, true);       /* For controller enabled / disabled. */
    68696870        for (uint32_t j = 0; j < RT_ELEMENTS(pThis->aCts[i].aIfs); j++)
    68706871        {
    6871             SSMR3PutBool(pSSM, pThis->aCts[i].aIfs[j].pDrvBase != NULL);
    6872             SSMR3PutStrZ(pSSM, pThis->aCts[i].aIfs[j].szSerialNumber);
    6873             SSMR3PutStrZ(pSSM, pThis->aCts[i].aIfs[j].szFirmwareRevision);
    6874             SSMR3PutStrZ(pSSM, pThis->aCts[i].aIfs[j].szModelNumber);
     6872            pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].aIfs[j].pDrvBase != NULL);
     6873            pHlp->pfnSSMPutStrZ(pSSM, pThis->aCts[i].aIfs[j].szSerialNumber);
     6874            pHlp->pfnSSMPutStrZ(pSSM, pThis->aCts[i].aIfs[j].szFirmwareRevision);
     6875            pHlp->pfnSSMPutStrZ(pSSM, pThis->aCts[i].aIfs[j].szModelNumber);
    68756876        }
    68766877    }
     
    68856886{
    68866887    PCIATAState    *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     6888    PCPDMDEVHLPR3   pHlp = pDevIns->pHlpR3;
    68876889
    68886890    ataR3LiveExec(pDevIns, pSSM, SSM_PASS_FINAL);
     
    68906892    for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aCts); i++)
    68916893    {
    6892         SSMR3PutU8(pSSM, pThis->aCts[i].iSelectedIf);
    6893         SSMR3PutU8(pSSM, pThis->aCts[i].iAIOIf);
    6894         SSMR3PutU8(pSSM, pThis->aCts[i].uAsyncIOState);
    6895         SSMR3PutBool(pSSM, pThis->aCts[i].fChainedTransfer);
    6896         SSMR3PutBool(pSSM, pThis->aCts[i].fReset);
    6897         SSMR3PutBool(pSSM, pThis->aCts[i].fRedo);
    6898         SSMR3PutBool(pSSM, pThis->aCts[i].fRedoIdle);
    6899         SSMR3PutBool(pSSM, pThis->aCts[i].fRedoDMALastDesc);
    6900         SSMR3PutMem(pSSM, &pThis->aCts[i].BmDma, sizeof(pThis->aCts[i].BmDma));
    6901         SSMR3PutGCPhys32(pSSM, pThis->aCts[i].GCPhysFirstDMADesc);
    6902         SSMR3PutGCPhys32(pSSM, pThis->aCts[i].GCPhysLastDMADesc);
    6903         SSMR3PutGCPhys32(pSSM, pThis->aCts[i].GCPhysRedoDMABuffer);
    6904         SSMR3PutU32(pSSM, pThis->aCts[i].cbRedoDMABuffer);
     6894        pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].iSelectedIf);
     6895        pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].iAIOIf);
     6896        pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].uAsyncIOState);
     6897        pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].fChainedTransfer);
     6898        pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].fReset);
     6899        pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].fRedo);
     6900        pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].fRedoIdle);
     6901        pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].fRedoDMALastDesc);
     6902        pHlp->pfnSSMPutMem(pSSM, &pThis->aCts[i].BmDma, sizeof(pThis->aCts[i].BmDma));
     6903        pHlp->pfnSSMPutGCPhys32(pSSM, pThis->aCts[i].GCPhysFirstDMADesc);
     6904        pHlp->pfnSSMPutGCPhys32(pSSM, pThis->aCts[i].GCPhysLastDMADesc);
     6905        pHlp->pfnSSMPutGCPhys32(pSSM, pThis->aCts[i].GCPhysRedoDMABuffer);
     6906        pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].cbRedoDMABuffer);
    69056907
    69066908        for (uint32_t j = 0; j < RT_ELEMENTS(pThis->aCts[i].aIfs); j++)
    69076909        {
    6908             SSMR3PutBool(pSSM, pThis->aCts[i].aIfs[j].fLBA48);
    6909             SSMR3PutBool(pSSM, pThis->aCts[i].aIfs[j].fATAPI);
    6910             SSMR3PutBool(pSSM, pThis->aCts[i].aIfs[j].fIrqPending);
    6911             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].cMultSectors);
    6912             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].PCHSGeometry.cCylinders);
    6913             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].PCHSGeometry.cHeads);
    6914             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].PCHSGeometry.cSectors);
    6915             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].cSectorsPerIRQ);
    6916             SSMR3PutU64(pSSM, pThis->aCts[i].aIfs[j].cTotalSectors);
    6917             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegFeature);
    6918             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegFeatureHOB);
    6919             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegError);
    6920             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegNSector);
    6921             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegNSectorHOB);
    6922             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegSector);
    6923             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegSectorHOB);
    6924             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegLCyl);
    6925             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegLCylHOB);
    6926             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegHCyl);
    6927             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegHCylHOB);
    6928             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegSelect);
    6929             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegStatus);
    6930             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegCommand);
    6931             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegDevCtl);
    6932             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uATATransferMode);
    6933             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].uTxDir);
    6934             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].iBeginTransfer);
    6935             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].iSourceSink);
    6936             SSMR3PutBool(pSSM, pThis->aCts[i].aIfs[j].fDMA);
    6937             SSMR3PutBool(pSSM, pThis->aCts[i].aIfs[j].fATAPITransfer);
    6938             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].cbTotalTransfer);
    6939             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].cbElementaryTransfer);
    6940             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].iIOBufferCur);
    6941             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].iIOBufferEnd);
    6942             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].iIOBufferPIODataStart);
    6943             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].iIOBufferPIODataEnd);
    6944             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].iATAPILBA);
    6945             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].cbATAPISector);
    6946             SSMR3PutMem(pSSM, &pThis->aCts[i].aIfs[j].aATAPICmd, sizeof(pThis->aCts[i].aIfs[j].aATAPICmd));
    6947             SSMR3PutMem(pSSM, &pThis->aCts[i].aIfs[j].abATAPISense, sizeof(pThis->aCts[i].aIfs[j].abATAPISense));
    6948             SSMR3PutU8(pSSM, pThis->aCts[i].aIfs[j].cNotifiedMediaChange);
    6949             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].MediaEventStatus);
    6950             SSMR3PutMem(pSSM, &pThis->aCts[i].aIfs[j].Led, sizeof(pThis->aCts[i].aIfs[j].Led));
    6951             SSMR3PutU32(pSSM, pThis->aCts[i].aIfs[j].cbIOBuffer);
     6910            pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].aIfs[j].fLBA48);
     6911            pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].aIfs[j].fATAPI);
     6912            pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].aIfs[j].fIrqPending);
     6913            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].cMultSectors);
     6914            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].PCHSGeometry.cCylinders);
     6915            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].PCHSGeometry.cHeads);
     6916            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].PCHSGeometry.cSectors);
     6917            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].cSectorsPerIRQ);
     6918            pHlp->pfnSSMPutU64(pSSM, pThis->aCts[i].aIfs[j].cTotalSectors);
     6919            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegFeature);
     6920            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegFeatureHOB);
     6921            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegError);
     6922            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegNSector);
     6923            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegNSectorHOB);
     6924            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegSector);
     6925            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegSectorHOB);
     6926            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegLCyl);
     6927            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegLCylHOB);
     6928            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegHCyl);
     6929            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegHCylHOB);
     6930            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegSelect);
     6931            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegStatus);
     6932            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegCommand);
     6933            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATARegDevCtl);
     6934            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uATATransferMode);
     6935            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].uTxDir);
     6936            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].iBeginTransfer);
     6937            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].iSourceSink);
     6938            pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].aIfs[j].fDMA);
     6939            pHlp->pfnSSMPutBool(pSSM, pThis->aCts[i].aIfs[j].fATAPITransfer);
     6940            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].cbTotalTransfer);
     6941            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].cbElementaryTransfer);
     6942            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].iIOBufferCur);
     6943            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].iIOBufferEnd);
     6944            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].iIOBufferPIODataStart);
     6945            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].iIOBufferPIODataEnd);
     6946            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].iATAPILBA);
     6947            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].cbATAPISector);
     6948            pHlp->pfnSSMPutMem(pSSM, &pThis->aCts[i].aIfs[j].aATAPICmd, sizeof(pThis->aCts[i].aIfs[j].aATAPICmd));
     6949            pHlp->pfnSSMPutMem(pSSM, &pThis->aCts[i].aIfs[j].abATAPISense, sizeof(pThis->aCts[i].aIfs[j].abATAPISense));
     6950            pHlp->pfnSSMPutU8(pSSM, pThis->aCts[i].aIfs[j].cNotifiedMediaChange);
     6951            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].MediaEventStatus);
     6952            pHlp->pfnSSMPutMem(pSSM, &pThis->aCts[i].aIfs[j].Led, sizeof(pThis->aCts[i].aIfs[j].Led));
     6953            pHlp->pfnSSMPutU32(pSSM, pThis->aCts[i].aIfs[j].cbIOBuffer);
    69526954            if (pThis->aCts[i].aIfs[j].cbIOBuffer)
    6953                 SSMR3PutMem(pSSM, pThis->aCts[i].aIfs[j].CTX_SUFF(pbIOBuffer), pThis->aCts[i].aIfs[j].cbIOBuffer);
     6955                pHlp->pfnSSMPutMem(pSSM, pThis->aCts[i].aIfs[j].CTX_SUFF(pbIOBuffer), pThis->aCts[i].aIfs[j].cbIOBuffer);
    69546956            else
    69556957                Assert(pThis->aCts[i].aIfs[j].CTX_SUFF(pbIOBuffer) == NULL);
     
    69576959    }
    69586960
    6959     return SSMR3PutU32(pSSM, UINT32_MAX); /* sanity/terminator */
     6961    return pHlp->pfnSSMPutU32(pSSM, UINT32_MAX); /* sanity/terminator */
    69606962}
    69616963
     
    69816983{
    69826984    PCIATAState    *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     6985    PCPDMDEVHLPR3   pHlp = pDevIns->pHlpR3;
    69836986    int             rc;
    69846987    uint32_t        u32;
     
    70007003    {
    70017004        uint8_t u8Type;
    7002         rc = SSMR3GetU8(pSSM, &u8Type);
     7005        rc = pHlp->pfnSSMGetU8(pSSM, &u8Type);
    70037006        AssertRCReturn(rc, rc);
    70047007        if (u8Type != pThis->u8Type)
    7005             return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch: u8Type - saved=%u config=%u"), u8Type, pThis->u8Type);
     7008            return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch: u8Type - saved=%u config=%u"), u8Type, pThis->u8Type);
    70067009
    70077010        for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aCts); i++)
    70087011        {
    70097012            bool fEnabled;
    7010             rc = SSMR3GetBool(pSSM, &fEnabled);
     7013            rc = pHlp->pfnSSMGetBool(pSSM, &fEnabled);
    70117014            AssertRCReturn(rc, rc);
    70127015            if (!fEnabled)
    7013                 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Ctr#%u onfig mismatch: fEnabled != true"), i);
     7016                return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Ctr#%u onfig mismatch: fEnabled != true"), i);
    70147017
    70157018            for (uint32_t j = 0; j < RT_ELEMENTS(pThis->aCts[i].aIfs); j++)
     
    70187021
    70197022                bool fInUse;
    7020                 rc = SSMR3GetBool(pSSM, &fInUse);
     7023                rc = pHlp->pfnSSMGetBool(pSSM, &fInUse);
    70217024                AssertRCReturn(rc, rc);
    70227025                if (fInUse != (pIf->pDrvBase != NULL))
    7023                     return SSMR3SetCfgError(pSSM, RT_SRC_POS,
    7024                                             N_("The %s VM is missing a %s device. Please make sure the source and target VMs have compatible storage configurations"),
    7025                                             fInUse ? "target" : "source", ataR3StringifyLun(pIf->iLUN) );
     7026                    return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS,
     7027                                                   N_("The %s VM is missing a %s device. Please make sure the source and target VMs have compatible storage configurations"),
     7028                                                   fInUse ? "target" : "source", ataR3StringifyLun(pIf->iLUN) );
    70267029
    70277030                char szSerialNumber[ATA_SERIAL_NUMBER_LENGTH+1];
    7028                 rc = SSMR3GetStrZ(pSSM, szSerialNumber,     sizeof(szSerialNumber));
     7031                rc = pHlp->pfnSSMGetStrZ(pSSM, szSerialNumber,     sizeof(szSerialNumber));
    70297032                AssertRCReturn(rc, rc);
    70307033                if (strcmp(szSerialNumber, pIf->szSerialNumber))
     
    70337036
    70347037                char szFirmwareRevision[ATA_FIRMWARE_REVISION_LENGTH+1];
    7035                 rc = SSMR3GetStrZ(pSSM, szFirmwareRevision, sizeof(szFirmwareRevision));
     7038                rc = pHlp->pfnSSMGetStrZ(pSSM, szFirmwareRevision, sizeof(szFirmwareRevision));
    70367039                AssertRCReturn(rc, rc);
    70377040                if (strcmp(szFirmwareRevision, pIf->szFirmwareRevision))
     
    70407043
    70417044                char szModelNumber[ATA_MODEL_NUMBER_LENGTH+1];
    7042                 rc = SSMR3GetStrZ(pSSM, szModelNumber,      sizeof(szModelNumber));
     7045                rc = pHlp->pfnSSMGetStrZ(pSSM, szModelNumber,      sizeof(szModelNumber));
    70437046                AssertRCReturn(rc, rc);
    70447047                if (strcmp(szModelNumber, pIf->szModelNumber))
     
    70637066        }
    70647067
    7065         SSMR3GetU8(pSSM, &pThis->aCts[i].iSelectedIf);
    7066         SSMR3GetU8(pSSM, &pThis->aCts[i].iAIOIf);
    7067         SSMR3GetU8(pSSM, &pThis->aCts[i].uAsyncIOState);
    7068         SSMR3GetBool(pSSM, &pThis->aCts[i].fChainedTransfer);
    7069         SSMR3GetBool(pSSM, &pThis->aCts[i].fReset);
    7070         SSMR3GetBool(pSSM, &pThis->aCts[i].fRedo);
    7071         SSMR3GetBool(pSSM, &pThis->aCts[i].fRedoIdle);
    7072         SSMR3GetBool(pSSM, &pThis->aCts[i].fRedoDMALastDesc);
    7073         SSMR3GetMem(pSSM, &pThis->aCts[i].BmDma, sizeof(pThis->aCts[i].BmDma));
    7074         SSMR3GetGCPhys32(pSSM, &pThis->aCts[i].GCPhysFirstDMADesc);
    7075         SSMR3GetGCPhys32(pSSM, &pThis->aCts[i].GCPhysLastDMADesc);
    7076         SSMR3GetGCPhys32(pSSM, &pThis->aCts[i].GCPhysRedoDMABuffer);
    7077         SSMR3GetU32(pSSM, &pThis->aCts[i].cbRedoDMABuffer);
     7068        pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].iSelectedIf);
     7069        pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].iAIOIf);
     7070        pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].uAsyncIOState);
     7071        pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].fChainedTransfer);
     7072        pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].fReset);
     7073        pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].fRedo);
     7074        pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].fRedoIdle);
     7075        pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].fRedoDMALastDesc);
     7076        pHlp->pfnSSMGetMem(pSSM, &pThis->aCts[i].BmDma, sizeof(pThis->aCts[i].BmDma));
     7077        pHlp->pfnSSMGetGCPhys32(pSSM, &pThis->aCts[i].GCPhysFirstDMADesc);
     7078        pHlp->pfnSSMGetGCPhys32(pSSM, &pThis->aCts[i].GCPhysLastDMADesc);
     7079        pHlp->pfnSSMGetGCPhys32(pSSM, &pThis->aCts[i].GCPhysRedoDMABuffer);
     7080        pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].cbRedoDMABuffer);
    70787081
    70797082        for (uint32_t j = 0; j < RT_ELEMENTS(pThis->aCts[i].aIfs); j++)
    70807083        {
    7081             SSMR3GetBool(pSSM, &pThis->aCts[i].aIfs[j].fLBA48);
    7082             SSMR3GetBool(pSSM, &pThis->aCts[i].aIfs[j].fATAPI);
    7083             SSMR3GetBool(pSSM, &pThis->aCts[i].aIfs[j].fIrqPending);
    7084             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].cMultSectors);
    7085             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].PCHSGeometry.cCylinders);
    7086             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].PCHSGeometry.cHeads);
    7087             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].PCHSGeometry.cSectors);
    7088             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].cSectorsPerIRQ);
    7089             SSMR3GetU64(pSSM, &pThis->aCts[i].aIfs[j].cTotalSectors);
    7090             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegFeature);
    7091             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegFeatureHOB);
    7092             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegError);
    7093             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegNSector);
    7094             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegNSectorHOB);
    7095             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegSector);
    7096             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegSectorHOB);
    7097             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegLCyl);
    7098             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegLCylHOB);
    7099             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegHCyl);
    7100             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegHCylHOB);
    7101             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegSelect);
    7102             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegStatus);
    7103             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegCommand);
    7104             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegDevCtl);
    7105             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uATATransferMode);
    7106             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].uTxDir);
    7107             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].iBeginTransfer);
    7108             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].iSourceSink);
    7109             SSMR3GetBool(pSSM, &pThis->aCts[i].aIfs[j].fDMA);
    7110             SSMR3GetBool(pSSM, &pThis->aCts[i].aIfs[j].fATAPITransfer);
    7111             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].cbTotalTransfer);
    7112             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].cbElementaryTransfer);
     7084            pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].aIfs[j].fLBA48);
     7085            pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].aIfs[j].fATAPI);
     7086            pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].aIfs[j].fIrqPending);
     7087            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].cMultSectors);
     7088            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].PCHSGeometry.cCylinders);
     7089            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].PCHSGeometry.cHeads);
     7090            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].PCHSGeometry.cSectors);
     7091            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].cSectorsPerIRQ);
     7092            pHlp->pfnSSMGetU64(pSSM, &pThis->aCts[i].aIfs[j].cTotalSectors);
     7093            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegFeature);
     7094            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegFeatureHOB);
     7095            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegError);
     7096            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegNSector);
     7097            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegNSectorHOB);
     7098            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegSector);
     7099            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegSectorHOB);
     7100            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegLCyl);
     7101            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegLCylHOB);
     7102            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegHCyl);
     7103            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegHCylHOB);
     7104            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegSelect);
     7105            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegStatus);
     7106            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegCommand);
     7107            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATARegDevCtl);
     7108            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uATATransferMode);
     7109            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].uTxDir);
     7110            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].iBeginTransfer);
     7111            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].iSourceSink);
     7112            pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].aIfs[j].fDMA);
     7113            pHlp->pfnSSMGetBool(pSSM, &pThis->aCts[i].aIfs[j].fATAPITransfer);
     7114            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].cbTotalTransfer);
     7115            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].cbElementaryTransfer);
    71137116            /* NB: cbPIOTransferLimit could be saved/restored but it's sufficient
    71147117             * to re-calculate it here, with a tiny risk that it could be
     
    71177120             */
    71187121            pThis->aCts[i].aIfs[j].cbPIOTransferLimit = (pThis->aCts[i].aIfs[j].uATARegHCyl << 8) | pThis->aCts[i].aIfs[j].uATARegLCyl;
    7119             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].iIOBufferCur);
    7120             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].iIOBufferEnd);
    7121             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].iIOBufferPIODataStart);
    7122             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].iIOBufferPIODataEnd);
    7123             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].iATAPILBA);
    7124             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].cbATAPISector);
    7125             SSMR3GetMem(pSSM, &pThis->aCts[i].aIfs[j].aATAPICmd, sizeof(pThis->aCts[i].aIfs[j].aATAPICmd));
     7122            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].iIOBufferCur);
     7123            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].iIOBufferEnd);
     7124            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].iIOBufferPIODataStart);
     7125            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].iIOBufferPIODataEnd);
     7126            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].iATAPILBA);
     7127            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].cbATAPISector);
     7128            pHlp->pfnSSMGetMem(pSSM, &pThis->aCts[i].aIfs[j].aATAPICmd, sizeof(pThis->aCts[i].aIfs[j].aATAPICmd));
    71267129            if (uVersion > ATA_SAVED_STATE_VERSION_WITHOUT_FULL_SENSE)
    7127             {
    7128                 SSMR3GetMem(pSSM, pThis->aCts[i].aIfs[j].abATAPISense, sizeof(pThis->aCts[i].aIfs[j].abATAPISense));
    7129             }
     7130                pHlp->pfnSSMGetMem(pSSM, pThis->aCts[i].aIfs[j].abATAPISense, sizeof(pThis->aCts[i].aIfs[j].abATAPISense));
    71307131            else
    71317132            {
     
    71347135                pThis->aCts[i].aIfs[j].abATAPISense[0] = 0x70 | (1 << 7);
    71357136                pThis->aCts[i].aIfs[j].abATAPISense[7] = 10;
    7136                 SSMR3GetU8(pSSM, &uATAPISenseKey);
    7137                 SSMR3GetU8(pSSM, &uATAPIASC);
     7137                pHlp->pfnSSMGetU8(pSSM, &uATAPISenseKey);
     7138                pHlp->pfnSSMGetU8(pSSM, &uATAPIASC);
    71387139                pThis->aCts[i].aIfs[j].abATAPISense[2] = uATAPISenseKey & 0x0f;
    71397140                pThis->aCts[i].aIfs[j].abATAPISense[12] = uATAPIASC;
    71407141            }
    71417142            /** @todo triple-check this hack after passthrough is working */
    7142             SSMR3GetU8(pSSM, &pThis->aCts[i].aIfs[j].cNotifiedMediaChange);
     7143            pHlp->pfnSSMGetU8(pSSM, &pThis->aCts[i].aIfs[j].cNotifiedMediaChange);
    71437144            if (uVersion > ATA_SAVED_STATE_VERSION_WITHOUT_EVENT_STATUS)
    7144                 SSMR3GetU32V(pSSM, &pThis->aCts[i].aIfs[j].MediaEventStatus);
     7145                pHlp->pfnSSMGetU32V(pSSM, &pThis->aCts[i].aIfs[j].MediaEventStatus);
    71457146            else
    71467147                pThis->aCts[i].aIfs[j].MediaEventStatus = ATA_EVENT_STATUS_UNCHANGED;
    7147             SSMR3GetMem(pSSM, &pThis->aCts[i].aIfs[j].Led, sizeof(pThis->aCts[i].aIfs[j].Led));
    7148             SSMR3GetU32(pSSM, &pThis->aCts[i].aIfs[j].cbIOBuffer);
     7148            pHlp->pfnSSMGetMem(pSSM, &pThis->aCts[i].aIfs[j].Led, sizeof(pThis->aCts[i].aIfs[j].Led));
     7149            pHlp->pfnSSMGetU32(pSSM, &pThis->aCts[i].aIfs[j].cbIOBuffer);
    71497150            if (pThis->aCts[i].aIfs[j].cbIOBuffer)
    71507151            {
    71517152                if (pThis->aCts[i].aIfs[j].CTX_SUFF(pbIOBuffer))
    7152                     SSMR3GetMem(pSSM, pThis->aCts[i].aIfs[j].CTX_SUFF(pbIOBuffer), pThis->aCts[i].aIfs[j].cbIOBuffer);
     7153                    pHlp->pfnSSMGetMem(pSSM, pThis->aCts[i].aIfs[j].CTX_SUFF(pbIOBuffer), pThis->aCts[i].aIfs[j].cbIOBuffer);
    71537154                else
    71547155                {
    71557156                    LogRel(("ATA: No buffer for %d/%d\n", i, j));
    7156                     if (SSMR3HandleGetAfter(pSSM) != SSMAFTER_DEBUG_IT)
    7157                         return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("No buffer for %d/%d"), i, j);
     7157                    if (pHlp->pfnSSMHandleGetAfter(pSSM) != SSMAFTER_DEBUG_IT)
     7158                        return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("No buffer for %d/%d"), i, j);
    71587159
    71597160                    /* skip the buffer if we're loading for the debugger / animator. */
     
    71617162                    size_t cbLeft = pThis->aCts[i].aIfs[j].cbIOBuffer;
    71627163                    while (cbLeft-- > 0)
    7163                         SSMR3GetU8(pSSM, &u8Ignored);
     7164                        pHlp->pfnSSMGetU8(pSSM, &u8Ignored);
    71647165                }
    71657166            }
     
    71697170    }
    71707171    if (uVersion <= ATA_SAVED_STATE_VERSION_VBOX_30)
    7171         SSMR3GetU8(pSSM, &pThis->u8Type);
    7172 
    7173     rc = SSMR3GetU32(pSSM, &u32);
     7172        pHlp->pfnSSMGetU8(pSSM, &pThis->u8Type);
     7173
     7174    rc = pHlp->pfnSSMGetU32(pSSM, &u32);
    71747175    if (RT_FAILURE(rc))
    71757176        return rc;
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