Changeset 85007 in vbox for trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
- Timestamp:
- Jun 30, 2020 5:19:25 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r84858 r85007 5868 5868 static DECLCALLBACK(int) iommuAmdR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg) 5869 5869 { 5870 NOREF(iInstance);5871 5872 5870 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 5873 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); 5874 PIOMMUCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PIOMMUCC); 5875 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 5876 int rc; 5871 RT_NOREF2(iInstance, pCfg); 5877 5872 LogFlowFunc(("\n")); 5878 5873 5874 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); 5875 PIOMMUCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PIOMMUCC); 5879 5876 pThisCC->pDevInsR3 = pDevIns; 5880 5881 /*5882 * Validate and read the configuration.5883 */5884 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Device|Function", "");5885 5886 uint8_t uPciDevice;5887 rc = pHlp->pfnCFGMQueryU8Def(pCfg, "Device", &uPciDevice, 0);5888 if (RT_FAILURE(rc))5889 return PDMDEV_SET_ERROR(pDevIns, rc, N_("IOMMU: Failed to query \"Device\""));5890 5891 uint8_t uPciFunction;5892 rc = pHlp->pfnCFGMQueryU8Def(pCfg, "Function", &uPciFunction, 2);5893 if (RT_FAILURE(rc))5894 return PDMDEV_SET_ERROR(pDevIns, rc, N_("IOMMU: Failed to query \"Function\""));5895 5877 5896 5878 /* … … 5904 5886 IommuReg.pfnMsiRemap = iommuAmdDeviceMsiRemap; 5905 5887 IommuReg.u32TheEnd = PDM_IOMMUREGCC_VERSION; 5906 rc = PDMDevHlpIommuRegister(pDevIns, &IommuReg, &pThisCC->CTX_SUFF(pIommuHlp), &pThis->idxIommu);5888 int rc = PDMDevHlpIommuRegister(pDevIns, &IommuReg, &pThisCC->CTX_SUFF(pIommuHlp), &pThis->idxIommu); 5907 5889 if (RT_FAILURE(rc)) 5908 5890 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to register ourselves as an IOMMU device")); … … 6007 5989 * Register the PCI function with PDM. 6008 5990 */ 6009 rc = PDMDevHlpPCIRegister Ex(pDevIns, pPciDev, 0 /* fFlags */, uPciDevice, uPciFunction, "amd-iommu");5991 rc = PDMDevHlpPCIRegister(pDevIns, pPciDev); 6010 5992 AssertLogRelRCReturn(rc, rc); 6011 5993 … … 6160 6142 /* .szName = */ "iommu-amd", 6161 6143 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RZ | PDM_DEVREG_FLAGS_NEW_STYLE, 6162 /* .fClass = */ PDM_DEVREG_CLASS_ BUS_ISA, /* Instantiate after PDM_DEVREG_CLASS_BUS_PCI */6144 /* .fClass = */ PDM_DEVREG_CLASS_PCI_BUILTIN, 6163 6145 /* .cMaxInstances = */ ~0U, 6164 6146 /* .uSharedVersion = */ 42,
Note:
See TracChangeset
for help on using the changeset viewer.