]> git.proxmox.com Git - mirror_edk2.git/blame - IntelSiliconPkg/Include/Protocol/PlatformVtdPolicy.h
UefiCpuPkg/CpuCommonFeaturesLib: Merge machine check code to same file.
[mirror_edk2.git] / IntelSiliconPkg / Include / Protocol / PlatformVtdPolicy.h
CommitLineData
4fd8eda9
JY
1/** @file\r
2 The definition for platform VTD policy.\r
3\r
4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php.\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __PLATFORM_VTD_POLICY_PROTOCOL_H__\r
16#define __PLATFORM_VTD_POLICY_PROTOCOL_H__\r
17\r
18#include <IndustryStandard/Vtd.h>\r
19\r
20#define EDKII_PLATFORM_VTD_POLICY_PROTOCOL_GUID \\r
21 { \\r
22 0x3d17e448, 0x466, 0x4e20, { 0x99, 0x9f, 0xb2, 0xe1, 0x34, 0x88, 0xee, 0x22 } \\r
23 }\r
24\r
25typedef struct _EDKII_PLATFORM_VTD_POLICY_PROTOCOL EDKII_PLATFORM_VTD_POLICY_PROTOCOL;\r
26\r
27#define EDKII_PLATFORM_VTD_POLICY_PROTOCOL_REVISION 0x00010000\r
28\r
29typedef struct {\r
30 UINT16 Segment;\r
31 VTD_SOURCE_ID SourceId;\r
32} EDKII_PLATFORM_VTD_DEVICE_INFO;\r
33\r
34/**\r
35 Get the VTD SourceId from the device handler.\r
36 This function is required for non PCI device handler.\r
37\r
38 Pseudo-algo in Intel VTd driver:\r
39 Status = PlatformGetVTdDeviceId ();\r
40 if (EFI_ERROR(Status)) {\r
41 if (DeviceHandle is PCI) {\r
42 Get SourceId from Bus/Device/Function\r
43 } else {\r
44 return EFI_UNSUPPORTED\r
45 }\r
46 }\r
47 Get VTd engine by Segment/Bus/Device/Function.\r
48\r
49 @param[in] This The protocol instance pointer.\r
50 @param[in] DeviceHandle Device Identifier in UEFI.\r
51 @param[out] DeviceInfo DeviceInfo for indentify the VTd engine in ACPI Table\r
52 and the VTd page entry.\r
53\r
54 @retval EFI_SUCCESS The VtdIndex and SourceId are returned.\r
55 @retval EFI_INVALID_PARAMETER DeviceHandle is not a valid handler.\r
56 @retval EFI_INVALID_PARAMETER DeviceInfo is NULL.\r
57 @retval EFI_NOT_FOUND The Segment or SourceId information is NOT found.\r
58 @retval EFI_UNSUPPORTED This function is not supported.\r
59\r
60**/\r
61typedef\r
62EFI_STATUS\r
63(EFIAPI *EDKII_PLATFORM_VTD_POLICY_GET_DEVICE_ID) (\r
64 IN EDKII_PLATFORM_VTD_POLICY_PROTOCOL *This,\r
65 IN EFI_HANDLE DeviceHandle,\r
66 OUT EDKII_PLATFORM_VTD_DEVICE_INFO *DeviceInfo\r
67 );\r
68\r
69/**\r
70 Get a list of the exception devices.\r
71\r
72 The VTd driver should always set ALLOW for the device in this list.\r
73\r
74 @param[in] This The protocol instance pointer.\r
75 @param[out] DeviceInfoCount The count of the list of DeviceInfo.\r
76 @param[out] DeviceInfo A callee allocated buffer to hold a list of DeviceInfo.\r
77\r
78 @retval EFI_SUCCESS The DeviceInfoCount and DeviceInfo are returned.\r
79 @retval EFI_INVALID_PARAMETER DeviceInfoCount is NULL, or DeviceInfo is NULL.\r
80 @retval EFI_UNSUPPORTED This function is not supported.\r
81\r
82**/\r
83typedef\r
84EFI_STATUS\r
85(EFIAPI *EDKII_PLATFORM_VTD_POLICY_GET_EXCEPTION_DEVICE_LIST) (\r
86 IN EDKII_PLATFORM_VTD_POLICY_PROTOCOL *This,\r
87 OUT UINTN *DeviceInfoCount,\r
88 OUT EDKII_PLATFORM_VTD_DEVICE_INFO **DeviceInfo\r
89 );\r
90\r
91struct _EDKII_PLATFORM_VTD_POLICY_PROTOCOL {\r
92 UINT64 Revision;\r
93 EDKII_PLATFORM_VTD_POLICY_GET_DEVICE_ID GetDeviceId;\r
94 EDKII_PLATFORM_VTD_POLICY_GET_EXCEPTION_DEVICE_LIST GetExceptionDeviceList;\r
95};\r
96\r
97extern EFI_GUID gEdkiiPlatformVTdPolicyProtocolGuid;\r
98\r
99#endif\r
100\r