IntelSiliconPkg/header: update PlatformVtdPolicy
authorJiewen Yao <jiewen.yao@intel.com>
Tue, 22 Aug 2017 03:47:54 +0000 (11:47 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Mon, 28 Aug 2017 08:28:43 +0000 (16:28 +0800)
Add flexible exception list format:
1) Support Device scope based reporting:
Such as, Seg:0/StartBus:0/(Dev:1C|Func:0)/(Dev:0|Func:0)

2) Support PCI VendorId/DeviceId based reporting
Such as, VID:8086|DID:9D2F|Rev:21|SVID:8086|SDID:7270

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
IntelSiliconPkg/Include/Protocol/PlatformVtdPolicy.h

index 29774c1..441da5c 100644 (file)
@@ -16,6 +16,7 @@
 #define __PLATFORM_VTD_POLICY_PROTOCOL_H__\r
 \r
 #include <IndustryStandard/Vtd.h>\r
+#include <IndustryStandard/DmaRemappingReportingTable.h>\r
 \r
 #define EDKII_PLATFORM_VTD_POLICY_PROTOCOL_GUID \\r
     { \\r
@@ -66,6 +67,53 @@ EFI_STATUS
   OUT EDKII_PLATFORM_VTD_DEVICE_INFO           *DeviceInfo\r
   );\r
 \r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  //\r
+  // The segment number of the device\r
+  //\r
+  UINT16                                          SegmentNumber;\r
+  //\r
+  // Device scope definition in DMAR table\r
+  //\r
+  EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER     DeviceScope;\r
+  //\r
+  // Pci path definition in DMAR table\r
+  //\r
+//EFI_ACPI_DMAR_PCI_PATH                          PciPath[];\r
+} EDKII_PLATFORM_VTD_DEVICE_SCOPE;\r
+\r
+typedef struct {\r
+  UINT16                                   VendorId;\r
+  UINT16                                   DeviceId;\r
+  UINT8                                    RevisionId;\r
+  UINT16                                   SubsystemVendorId;\r
+  UINT16                                   SubsystemDeviceId;\r
+} EDKII_PLATFORM_VTD_PCI_DEVICE_ID;\r
+\r
+#define EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO_TYPE_END           0\r
+#define EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO_TYPE_DEVICE_SCOPE  1\r
+#define EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO_TYPE_PCI_DEVICE_ID 2\r
+\r
+typedef struct {\r
+  //\r
+  // EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO_TYPE_xxx defined above.\r
+  //\r
+  UINT8             Type;\r
+  //\r
+  // The length of the full data structure including EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO and Data.\r
+  //\r
+  UINT8             Length;\r
+  //\r
+  // Data can be EDKII_PLATFORM_VTD_DEVICE_SCOPE or EDKII_PLATFORM_VTD_PCI_DEVICE_ID\r
+  //\r
+//UINT8             Data[Length - sizeof(EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO)];\r
+} EDKII_PLATFORM_VTD_EXCEPTION_DEVICE_INFO;\r
+\r
+#pragma pack()\r
+\r
+\r
 /**\r
   Get a list of the exception devices.\r
 \r
@@ -74,6 +122,7 @@ EFI_STATUS
   @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
@@ -85,7 +134,7 @@ EFI_STATUS
 (EFIAPI *EDKII_PLATFORM_VTD_POLICY_GET_EXCEPTION_DEVICE_LIST) (\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
 struct _EDKII_PLATFORM_VTD_POLICY_PROTOCOL {\r