2 The definition for DMA access Library.
4 Copyright (c) 2017 - 2018, 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 __DMA_ACCESS_LIB_H__
16 #define __DMA_ACCESS_LIB_H__
19 EFI_ACPI_DMAR_HEADER
*AcpiDmarTable
;
21 UINT8 HostAddressWidth
;
23 UINT64 VTdEngineAddress
[1];
27 Set DMA protected region.
29 @param VTdInfo The VTd engine context information.
30 @param EngineMask The mask of the VTd engine to be accessed.
31 @param LowMemoryBase The protected low memory region base.
32 @param LowMemoryLength The protected low memory region length.
33 @param HighMemoryBase The protected high memory region base.
34 @param HighMemoryLength The protected high memory region length.
36 @retval EFI_SUCCESS The DMA protection is set.
37 @retval EFI_UNSUPPORTED The DMA protection is not set.
40 SetDmaProtectedRange (
43 IN UINT32 LowMemoryBase
,
44 IN UINT32 LowMemoryLength
,
45 IN UINT64 HighMemoryBase
,
46 IN UINT64 HighMemoryLength
50 Diable DMA protection.
52 @param VTdInfo The VTd engine context information.
53 @param EngineMask The mask of the VTd engine to be accessed.
55 @retval DMA protection is disabled.
58 DisableDmaProtection (
64 Return if the DMA protection is enabled.
66 @param VTdInfo The VTd engine context information.
67 @param EngineMask The mask of the VTd engine to be accessed.
69 @retval TRUE DMA protection is enabled in at least one VTd engine.
70 @retval FALSE DMA protection is disabled in all VTd engines.
73 GetDmaProtectionEnabledEngineMask (
79 Get protected low memory alignment.
81 @param VTdInfo The VTd engine context information.
82 @param EngineMask The mask of the VTd engine to be accessed.
84 @return protected low memory alignment.
87 GetLowMemoryAlignment (
93 Get protected high memory alignment.
95 @param VTdInfo The VTd engine context information.
96 @param EngineMask The mask of the VTd engine to be accessed.
98 @return protected high memory alignment.
101 GetHighMemoryAlignment (
102 IN VTD_INFO
*VTdInfo
,
107 Enable VTd translation table protection.
109 @param VTdInfo The VTd engine context information.
110 @param EngineMask The mask of the VTd engine to be accessed.
113 EnableVTdTranslationProtection (
114 IN VTD_INFO
*VTdInfo
,
119 Disable VTd translation table protection.
121 @param VTdInfo The VTd engine context information.
122 @param EngineMask The mask of the VTd engine to be accessed.
125 DisableVTdTranslationProtection (
126 IN VTD_INFO
*VTdInfo
,
131 Parse DMAR DRHD table.
133 @param[in] AcpiDmarTable DMAR ACPI table
135 @return EFI_SUCCESS The DMAR DRHD table is parsed.
138 ParseDmarAcpiTableDrhd (
139 IN EFI_ACPI_DMAR_HEADER
*AcpiDmarTable
143 Parse DMAR DRHD table.
145 @param VTdInfo The VTd engine context information.
148 ParseDmarAcpiTableRmrr (
153 Dump DMAR ACPI table.
155 @param[in] Dmar DMAR ACPI table
159 IN EFI_ACPI_DMAR_HEADER
*Dmar
162 extern EFI_GUID mVTdInfoGuid
;