]> git.proxmox.com Git - mirror_edk2.git/blame - IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.h
IntelSiliconPkg/IntelVTdPmrPei: Parse RMRR table.
[mirror_edk2.git] / IntelSiliconPkg / Feature / VTd / IntelVTdPmrPei / IntelVTdPmrPei.h
CommitLineData
3f5ed3fa
JY
1/** @file\r
2 The definition for DMA access Library.\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 __DMA_ACCESS_LIB_H__\r
16#define __DMA_ACCESS_LIB_H__\r
17\r
8e9da4ba
JY
18typedef struct {\r
19 UINT8 HostAddressWidth;\r
20 UINTN VTdEngineCount;\r
21 UINT64 VTdEngineAddress[1];\r
22} VTD_INFO;\r
23\r
3f5ed3fa
JY
24/**\r
25 Set DMA protected region.\r
26\r
8e9da4ba 27 @param EngineMask The mask of the VTd engine to be accessed.\r
3f5ed3fa
JY
28 @param LowMemoryBase The protected low memory region base.\r
29 @param LowMemoryLength The protected low memory region length.\r
30 @param HighMemoryBase The protected high memory region base.\r
31 @param HighMemoryLength The protected high memory region length.\r
32\r
33 @retval EFI_SUCCESS The DMA protection is set.\r
34 @retval EFI_UNSUPPORTED The DMA protection is not set.\r
35**/\r
36EFI_STATUS\r
37SetDmaProtectedRange (\r
8e9da4ba 38 IN UINT64 EngineMask,\r
3f5ed3fa
JY
39 IN UINT32 LowMemoryBase,\r
40 IN UINT32 LowMemoryLength,\r
41 IN UINT64 HighMemoryBase,\r
42 IN UINT64 HighMemoryLength\r
43 );\r
44\r
45/**\r
46 Diable DMA protection.\r
47\r
8e9da4ba
JY
48 @param EngineMask The mask of the VTd engine to be accessed.\r
49\r
3f5ed3fa
JY
50 @retval DMA protection is disabled.\r
51**/\r
52EFI_STATUS\r
53DisableDmaProtection (\r
8e9da4ba 54 IN UINT64 EngineMask\r
3f5ed3fa
JY
55 );\r
56\r
57/**\r
58 Get protected low memory alignment.\r
59\r
8e9da4ba
JY
60 @param EngineMask The mask of the VTd engine to be accessed.\r
61\r
3f5ed3fa
JY
62 @return protected low memory alignment.\r
63**/\r
64UINT32\r
65GetLowMemoryAlignment (\r
8e9da4ba 66 IN UINT64 EngineMask\r
3f5ed3fa
JY
67 );\r
68\r
69/**\r
70 Get protected high memory alignment.\r
71\r
8e9da4ba
JY
72 @param EngineMask The mask of the VTd engine to be accessed.\r
73\r
3f5ed3fa
JY
74 @return protected high memory alignment.\r
75**/\r
76UINT64\r
77GetHighMemoryAlignment (\r
8e9da4ba 78 IN UINT64 EngineMask\r
3f5ed3fa
JY
79 );\r
80\r
81#endif\r
82\r