2 The definition for DMA access Library.
4 Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __DMA_ACCESS_LIB_H__
10 #define __DMA_ACCESS_LIB_H__
13 EFI_ACPI_DMAR_HEADER
*AcpiDmarTable
;
15 UINT8 HostAddressWidth
;
17 UINT64 VTdEngineAddress
[1];
21 Set DMA protected region.
23 @param VTdInfo The VTd engine context information.
24 @param EngineMask The mask of the VTd engine to be accessed.
25 @param LowMemoryBase The protected low memory region base.
26 @param LowMemoryLength The protected low memory region length.
27 @param HighMemoryBase The protected high memory region base.
28 @param HighMemoryLength The protected high memory region length.
30 @retval EFI_SUCCESS The DMA protection is set.
31 @retval EFI_UNSUPPORTED The DMA protection is not set.
34 SetDmaProtectedRange (
37 IN UINT32 LowMemoryBase
,
38 IN UINT32 LowMemoryLength
,
39 IN UINT64 HighMemoryBase
,
40 IN UINT64 HighMemoryLength
44 Diable DMA protection.
46 @param VTdInfo The VTd engine context information.
47 @param EngineMask The mask of the VTd engine to be accessed.
49 @retval DMA protection is disabled.
52 DisableDmaProtection (
58 Return if the DMA protection is enabled.
60 @param VTdInfo The VTd engine context information.
61 @param EngineMask The mask of the VTd engine to be accessed.
63 @retval TRUE DMA protection is enabled in at least one VTd engine.
64 @retval FALSE DMA protection is disabled in all VTd engines.
67 GetDmaProtectionEnabledEngineMask (
73 Get protected low memory alignment.
75 @param VTdInfo The VTd engine context information.
76 @param EngineMask The mask of the VTd engine to be accessed.
78 @return protected low memory alignment.
81 GetLowMemoryAlignment (
87 Get protected high memory alignment.
89 @param VTdInfo The VTd engine context information.
90 @param EngineMask The mask of the VTd engine to be accessed.
92 @return protected high memory alignment.
95 GetHighMemoryAlignment (
101 Enable VTd translation table protection.
103 @param VTdInfo The VTd engine context information.
104 @param EngineMask The mask of the VTd engine to be accessed.
107 EnableVTdTranslationProtection (
108 IN VTD_INFO
*VTdInfo
,
113 Disable VTd translation table protection.
115 @param VTdInfo The VTd engine context information.
116 @param EngineMask The mask of the VTd engine to be accessed.
119 DisableVTdTranslationProtection (
120 IN VTD_INFO
*VTdInfo
,
125 Parse DMAR DRHD table.
127 @param[in] AcpiDmarTable DMAR ACPI table
129 @return EFI_SUCCESS The DMAR DRHD table is parsed.
132 ParseDmarAcpiTableDrhd (
133 IN EFI_ACPI_DMAR_HEADER
*AcpiDmarTable
137 Parse DMAR DRHD table.
139 @param VTdInfo The VTd engine context information.
142 ParseDmarAcpiTableRmrr (
147 Dump DMAR ACPI table.
149 @param[in] Dmar DMAR ACPI table
153 IN EFI_ACPI_DMAR_HEADER
*Dmar
156 extern EFI_GUID mVTdInfoGuid
;