Changeset 81802 in vbox for trunk/src/VBox
- Timestamp:
- Nov 12, 2019 1:51:27 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r81801 r81802 6862 6862 RT_NOREF1(uPass); 6863 6863 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); 6866 6867 for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aCts); i++) 6867 6868 { 6868 SSMR3PutBool(pSSM, true); /* For controller enabled / disabled. */6869 pHlp->pfnSSMPutBool(pSSM, true); /* For controller enabled / disabled. */ 6869 6870 for (uint32_t j = 0; j < RT_ELEMENTS(pThis->aCts[i].aIfs); j++) 6870 6871 { 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); 6875 6876 } 6876 6877 } … … 6885 6886 { 6886 6887 PCIATAState *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *); 6888 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 6887 6889 6888 6890 ataR3LiveExec(pDevIns, pSSM, SSM_PASS_FINAL); … … 6890 6892 for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aCts); i++) 6891 6893 { 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); 6905 6907 6906 6908 for (uint32_t j = 0; j < RT_ELEMENTS(pThis->aCts[i].aIfs); j++) 6907 6909 { 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); 6952 6954 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); 6954 6956 else 6955 6957 Assert(pThis->aCts[i].aIfs[j].CTX_SUFF(pbIOBuffer) == NULL); … … 6957 6959 } 6958 6960 6959 return SSMR3PutU32(pSSM, UINT32_MAX); /* sanity/terminator */6961 return pHlp->pfnSSMPutU32(pSSM, UINT32_MAX); /* sanity/terminator */ 6960 6962 } 6961 6963 … … 6981 6983 { 6982 6984 PCIATAState *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *); 6985 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 6983 6986 int rc; 6984 6987 uint32_t u32; … … 7000 7003 { 7001 7004 uint8_t u8Type; 7002 rc = SSMR3GetU8(pSSM, &u8Type);7005 rc = pHlp->pfnSSMGetU8(pSSM, &u8Type); 7003 7006 AssertRCReturn(rc, rc); 7004 7007 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); 7006 7009 7007 7010 for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aCts); i++) 7008 7011 { 7009 7012 bool fEnabled; 7010 rc = SSMR3GetBool(pSSM, &fEnabled);7013 rc = pHlp->pfnSSMGetBool(pSSM, &fEnabled); 7011 7014 AssertRCReturn(rc, rc); 7012 7015 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); 7014 7017 7015 7018 for (uint32_t j = 0; j < RT_ELEMENTS(pThis->aCts[i].aIfs); j++) … … 7018 7021 7019 7022 bool fInUse; 7020 rc = SSMR3GetBool(pSSM, &fInUse);7023 rc = pHlp->pfnSSMGetBool(pSSM, &fInUse); 7021 7024 AssertRCReturn(rc, rc); 7022 7025 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) ); 7026 7029 7027 7030 char szSerialNumber[ATA_SERIAL_NUMBER_LENGTH+1]; 7028 rc = SSMR3GetStrZ(pSSM, szSerialNumber, sizeof(szSerialNumber));7031 rc = pHlp->pfnSSMGetStrZ(pSSM, szSerialNumber, sizeof(szSerialNumber)); 7029 7032 AssertRCReturn(rc, rc); 7030 7033 if (strcmp(szSerialNumber, pIf->szSerialNumber)) … … 7033 7036 7034 7037 char szFirmwareRevision[ATA_FIRMWARE_REVISION_LENGTH+1]; 7035 rc = SSMR3GetStrZ(pSSM, szFirmwareRevision, sizeof(szFirmwareRevision));7038 rc = pHlp->pfnSSMGetStrZ(pSSM, szFirmwareRevision, sizeof(szFirmwareRevision)); 7036 7039 AssertRCReturn(rc, rc); 7037 7040 if (strcmp(szFirmwareRevision, pIf->szFirmwareRevision)) … … 7040 7043 7041 7044 char szModelNumber[ATA_MODEL_NUMBER_LENGTH+1]; 7042 rc = SSMR3GetStrZ(pSSM, szModelNumber, sizeof(szModelNumber));7045 rc = pHlp->pfnSSMGetStrZ(pSSM, szModelNumber, sizeof(szModelNumber)); 7043 7046 AssertRCReturn(rc, rc); 7044 7047 if (strcmp(szModelNumber, pIf->szModelNumber)) … … 7063 7066 } 7064 7067 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); 7078 7081 7079 7082 for (uint32_t j = 0; j < RT_ELEMENTS(pThis->aCts[i].aIfs); j++) 7080 7083 { 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); 7113 7116 /* NB: cbPIOTransferLimit could be saved/restored but it's sufficient 7114 7117 * to re-calculate it here, with a tiny risk that it could be … … 7117 7120 */ 7118 7121 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)); 7126 7129 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)); 7130 7131 else 7131 7132 { … … 7134 7135 pThis->aCts[i].aIfs[j].abATAPISense[0] = 0x70 | (1 << 7); 7135 7136 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); 7138 7139 pThis->aCts[i].aIfs[j].abATAPISense[2] = uATAPISenseKey & 0x0f; 7139 7140 pThis->aCts[i].aIfs[j].abATAPISense[12] = uATAPIASC; 7140 7141 } 7141 7142 /** @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); 7143 7144 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); 7145 7146 else 7146 7147 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); 7149 7150 if (pThis->aCts[i].aIfs[j].cbIOBuffer) 7150 7151 { 7151 7152 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); 7153 7154 else 7154 7155 { 7155 7156 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); 7158 7159 7159 7160 /* skip the buffer if we're loading for the debugger / animator. */ … … 7161 7162 size_t cbLeft = pThis->aCts[i].aIfs[j].cbIOBuffer; 7162 7163 while (cbLeft-- > 0) 7163 SSMR3GetU8(pSSM, &u8Ignored);7164 pHlp->pfnSSMGetU8(pSSM, &u8Ignored); 7164 7165 } 7165 7166 } … … 7169 7170 } 7170 7171 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); 7174 7175 if (RT_FAILURE(rc)) 7175 7176 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.