2 The definition for platform VTD policy.
4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __PLATFORM_VTD_POLICY_PROTOCOL_H__
16 #define __PLATFORM_VTD_POLICY_PROTOCOL_H__
18 #include <IndustryStandard/Vtd.h>
20 #define EDKII_PLATFORM_VTD_POLICY_PROTOCOL_GUID \
22 0x3d17e448, 0x466, 0x4e20, { 0x99, 0x9f, 0xb2, 0xe1, 0x34, 0x88, 0xee, 0x22 } \
25 typedef struct _EDKII_PLATFORM_VTD_POLICY_PROTOCOL EDKII_PLATFORM_VTD_POLICY_PROTOCOL
;
27 #define EDKII_PLATFORM_VTD_POLICY_PROTOCOL_REVISION 0x00010000
31 VTD_SOURCE_ID SourceId
;
32 } EDKII_PLATFORM_VTD_DEVICE_INFO
;
35 Get the VTD SourceId from the device handler.
36 This function is required for non PCI device handler.
38 Pseudo-algo in Intel VTd driver:
39 Status = PlatformGetVTdDeviceId ();
40 if (EFI_ERROR(Status)) {
41 if (DeviceHandle is PCI) {
42 Get SourceId from Bus/Device/Function
44 return EFI_UNSUPPORTED
47 Get VTd engine by Segment/Bus/Device/Function.
49 @param[in] This The protocol instance pointer.
50 @param[in] DeviceHandle Device Identifier in UEFI.
51 @param[out] DeviceInfo DeviceInfo for indentify the VTd engine in ACPI Table
52 and the VTd page entry.
54 @retval EFI_SUCCESS The VtdIndex and SourceId are returned.
55 @retval EFI_INVALID_PARAMETER DeviceHandle is not a valid handler.
56 @retval EFI_INVALID_PARAMETER DeviceInfo is NULL.
57 @retval EFI_NOT_FOUND The Segment or SourceId information is NOT found.
58 @retval EFI_UNSUPPORTED This function is not supported.
63 (EFIAPI
*EDKII_PLATFORM_VTD_POLICY_GET_DEVICE_ID
) (
64 IN EDKII_PLATFORM_VTD_POLICY_PROTOCOL
*This
,
65 IN EFI_HANDLE DeviceHandle
,
66 OUT EDKII_PLATFORM_VTD_DEVICE_INFO
*DeviceInfo
70 Get a list of the exception devices.
72 The VTd driver should always set ALLOW for the device in this list.
74 @param[in] This The protocol instance pointer.
75 @param[out] DeviceInfoCount The count of the list of DeviceInfo.
76 @param[out] DeviceInfo A callee allocated buffer to hold a list of DeviceInfo.
78 @retval EFI_SUCCESS The DeviceInfoCount and DeviceInfo are returned.
79 @retval EFI_INVALID_PARAMETER DeviceInfoCount is NULL, or DeviceInfo is NULL.
80 @retval EFI_UNSUPPORTED This function is not supported.
85 (EFIAPI
*EDKII_PLATFORM_VTD_POLICY_GET_EXCEPTION_DEVICE_LIST
) (
86 IN EDKII_PLATFORM_VTD_POLICY_PROTOCOL
*This
,
87 OUT UINTN
*DeviceInfoCount
,
88 OUT EDKII_PLATFORM_VTD_DEVICE_INFO
**DeviceInfo
91 struct _EDKII_PLATFORM_VTD_POLICY_PROTOCOL
{
93 EDKII_PLATFORM_VTD_POLICY_GET_DEVICE_ID GetDeviceId
;
94 EDKII_PLATFORM_VTD_POLICY_GET_EXCEPTION_DEVICE_LIST GetExceptionDeviceList
;
97 extern EFI_GUID gEdkiiPlatformVTdPolicyProtocolGuid
;