#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/DevicePathLib.h>\r
\r
+#include <IndustryStandard/DmaRemappingReportingTable.h>\r
+\r
typedef struct {\r
ACPI_EXTENDED_HID_DEVICE_PATH I2cController;\r
UINT8 HidStr[8];\r
PLATFORM_END_ENTIRE\r
};\r
\r
-EDKII_PLATFORM_VTD_DEVICE_INFO mExceptionDeviceList[] = {\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+ EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO ExceptionDeviceInfo;\r
+ EDKII_PLATFORM_VTD_DEVICE_SCOPE DeviceScope;\r
+ EFI_ACPI_DMAR_PCI_PATH PciBridge;\r
+ EFI_ACPI_DMAR_PCI_PATH PciDevice;\r
+} PLATFORM_EXCEPTION_DEVICE_SCOPE_STRUCT;\r
+\r
+typedef struct {\r
+ EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO ExceptionDeviceInfo;\r
+ EDKII_PLATFORM_VTD_PCI_DEVICE_ID PciDeviceId;\r
+} PLATFORM_EXCEPTION_PCI_DEVICE_ID_STRUCT;\r
+\r
+#pragma pack()\r
+\r
+PLATFORM_EXCEPTION_DEVICE_SCOPE_STRUCT mExceptionDeviceScopeList[] = {\r
{\r
- 0x0, // Segment\r
- {{0x00, 0x00, 0x02}} // Function, Device, Bus\r
+ {\r
+ EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO_TYPE_DEVICE_SCOPE,\r
+ sizeof(PLATFORM_EXCEPTION_DEVICE_SCOPE_STRUCT)\r
+ }, // ExceptionDeviceInfo\r
+ {\r
+ 0, // SegmentNumber\r
+ {\r
+ EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_PCI_ENDPOINT, // Type\r
+ sizeof(EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER) +\r
+ 2 * sizeof(EFI_ACPI_DMAR_PCI_PATH), // Length\r
+ 0, // Reserved2\r
+ 0, // EnumerationId\r
+ 0, // StartBusNumber\r
+ },\r
+ }, // DeviceScope\r
+ { 0x1C, 1 }, // PciBridge\r
+ { 0x0, 0 }, // PciDevice\r
+ },\r
+};\r
+\r
+PLATFORM_EXCEPTION_PCI_DEVICE_ID_STRUCT mExceptionPciDeviceIdList[] = {\r
+ {\r
+ {\r
+ EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO_TYPE_PCI_DEVICE_ID,\r
+ sizeof(PLATFORM_EXCEPTION_PCI_DEVICE_ID_STRUCT)\r
+ }, // ExceptionDeviceInfo\r
+ {\r
+ 0x8086, // VendorId\r
+ 0x9D2F, // DeviceId\r
+ 0x21, // RevisionId\r
+ 0x8086, // SubsystemVendorId\r
+ 0x7270, // SubsystemDeviceId\r
+ },\r
},\r
};\r
\r
@param[in] This The protocol instance pointer.\r
@param[out] DeviceInfoCount The count of the list of DeviceInfo.\r
@param[out] DeviceInfo A callee allocated buffer to hold a list of DeviceInfo.\r
+ Each DeviceInfo pointer points to EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO.\r
\r
@retval EFI_SUCCESS The DeviceInfoCount and DeviceInfo are returned.\r
@retval EFI_INVALID_PARAMETER DeviceInfoCount is NULL, or DeviceInfo is NULL.\r
PlatformVTdGetExceptionDeviceList (\r
IN EDKII_PLATFORM_VTD_POLICY_PROTOCOL *This,\r
OUT UINTN *DeviceInfoCount,\r
- OUT EDKII_PLATFORM_VTD_DEVICE_INFO **DeviceInfo\r
+ OUT VOID **DeviceInfo\r
)\r
{\r
DEBUG ((DEBUG_VERBOSE, "PlatformVTdGetExceptionDeviceList\n"));\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- *DeviceInfo = AllocateZeroPool (sizeof(mExceptionDeviceList));\r
- if (*DeviceInfo == NULL) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
- CopyMem (*DeviceInfo, mExceptionDeviceList, sizeof(mExceptionDeviceList));\r
+ if (0) {\r
+ *DeviceInfo = AllocateZeroPool (sizeof(mExceptionDeviceScopeList));\r
+ if (*DeviceInfo == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+ CopyMem (*DeviceInfo, mExceptionDeviceScopeList, sizeof(mExceptionDeviceScopeList));\r
+\r
+ *DeviceInfoCount = ARRAY_SIZE(mExceptionDeviceScopeList);\r
+ } else {\r
+ *DeviceInfo = AllocateZeroPool (sizeof(mExceptionPciDeviceIdList));\r
+ if (*DeviceInfo == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+ CopyMem (*DeviceInfo, mExceptionPciDeviceIdList, sizeof(mExceptionPciDeviceIdList));\r
\r
- *DeviceInfoCount = ARRAY_SIZE(mExceptionDeviceList);\r
+ *DeviceInfoCount = ARRAY_SIZE(mExceptionPciDeviceIdList);\r
+ }\r
\r
return EFI_SUCCESS;\r
}\r