TianoCore EDK2 master
Loading...
Searching...
No Matches
IoMmu.h
Go to the documentation of this file.
1
9#ifndef __IOMMU_H__
10#define __IOMMU_H__
11
12//
13// IOMMU Protocol GUID value
14//
15#define EDKII_IOMMU_PROTOCOL_GUID \
16 { \
17 0x4e939de9, 0xd948, 0x4b0f, { 0x88, 0xed, 0xe6, 0xe1, 0xce, 0x51, 0x7c, 0x1e } \
18 }
19
20//
21// Forward reference for pure ANSI compatability
22//
24
25//
26// Revision The revision to which the IOMMU interface adheres.
27// All future revisions must be backwards compatible.
28// If a future version is not back wards compatible it is not the same GUID.
29//
30#define EDKII_IOMMU_PROTOCOL_REVISION 0x00010000
31
32//
33// IOMMU Access for SetAttribute
34//
35// These types can be "ORed" together as needed.
36// Any undefined bits are reserved and must be zero.
37//
38#define EDKII_IOMMU_ACCESS_READ 0x1
39#define EDKII_IOMMU_ACCESS_WRITE 0x2
40
41//
42// IOMMU Operation for Map
43//
44typedef enum {
75 EdkiiIoMmuOperationMaximum
77
78//
79// IOMMU attribute for AllocateBuffer
80// Any undefined bits are reserved and must be zero.
81//
82#define EDKII_IOMMU_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
83#define EDKII_IOMMU_ATTRIBUTE_MEMORY_CACHED 0x0800
84#define EDKII_IOMMU_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
85
86#define EDKII_IOMMU_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER (EDKII_IOMMU_ATTRIBUTE_MEMORY_WRITE_COMBINE | EDKII_IOMMU_ATTRIBUTE_MEMORY_CACHED | EDKII_IOMMU_ATTRIBUTE_DUAL_ADDRESS_CYCLE)
87
88#define EDKII_IOMMU_ATTRIBUTE_INVALID_FOR_ALLOCATE_BUFFER (~EDKII_IOMMU_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER)
89
127typedef
131 IN EFI_HANDLE DeviceHandle,
132 IN VOID *Mapping,
133 IN UINT64 IoMmuAccess
134 );
135
156typedef
158(EFIAPI *EDKII_IOMMU_MAP)(
160 IN EDKII_IOMMU_OPERATION Operation,
161 IN VOID *HostAddress,
162 IN OUT UINTN *NumberOfBytes,
163 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
164 OUT VOID **Mapping
165 );
166
177typedef
179(EFIAPI *EDKII_IOMMU_UNMAP)(
181 IN VOID *Mapping
182 );
183
204typedef
209 IN EFI_MEMORY_TYPE MemoryType,
210 IN UINTN Pages,
211 IN OUT VOID **HostAddress,
212 IN UINT64 Attributes
213 );
214
227typedef
231 IN UINTN Pages,
232 IN VOID *HostAddress
233 );
234
239 UINT64 Revision;
240 EDKII_IOMMU_SET_ATTRIBUTE SetAttribute;
241 EDKII_IOMMU_MAP Map;
242 EDKII_IOMMU_UNMAP Unmap;
243 EDKII_IOMMU_ALLOCATE_BUFFER AllocateBuffer;
244 EDKII_IOMMU_FREE_BUFFER FreeBuffer;
245};
246
251
252#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_GUID gEdkiiIoMmuProtocolGuid
EFI_STATUS(EFIAPI * EDKII_IOMMU_MAP)(IN EDKII_IOMMU_PROTOCOL *This, IN EDKII_IOMMU_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
Definition: IoMmu.h:158
EFI_STATUS(EFIAPI * EDKII_IOMMU_FREE_BUFFER)(IN EDKII_IOMMU_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
Definition: IoMmu.h:229
EFI_STATUS(EFIAPI * EDKII_IOMMU_UNMAP)(IN EDKII_IOMMU_PROTOCOL *This, IN VOID *Mapping)
Definition: IoMmu.h:179
EFI_STATUS(EFIAPI * EDKII_IOMMU_SET_ATTRIBUTE)(IN EDKII_IOMMU_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN VOID *Mapping, IN UINT64 IoMmuAccess)
Definition: IoMmu.h:129
EFI_STATUS(EFIAPI * EDKII_IOMMU_ALLOCATE_BUFFER)(IN EDKII_IOMMU_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, IN OUT VOID **HostAddress, IN UINT64 Attributes)
Definition: IoMmu.h:206
EDKII_IOMMU_OPERATION
Definition: IoMmu.h:44
@ EdkiiIoMmuOperationBusMasterWrite
Definition: IoMmu.h:54
@ EdkiiIoMmuOperationBusMasterWrite64
Definition: IoMmu.h:69
@ EdkiiIoMmuOperationBusMasterCommonBuffer
Definition: IoMmu.h:59
@ EdkiiIoMmuOperationBusMasterRead64
Definition: IoMmu.h:64
@ EdkiiIoMmuOperationBusMasterRead
Definition: IoMmu.h:49
@ EdkiiIoMmuOperationBusMasterCommonBuffer64
Definition: IoMmu.h:74
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
EFI_MEMORY_TYPE
EFI_ALLOCATE_TYPE
Definition: UefiSpec.h:29
Definition: Base.h:213