TianoCore EDK2 master
DeviceIo.h
Go to the documentation of this file.
1
12#ifndef __DEVICE_IO_H__
13#define __DEVICE_IO_H__
14
15#define EFI_DEVICE_IO_PROTOCOL_GUID \
16 { \
17 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
18 }
19
21
25#define DEVICE_IO_PROTOCOL EFI_DEVICE_IO_PROTOCOL_GUID
26
31
35typedef enum {
36 IO_UINT8 = 0,
37 IO_UINT16 = 1,
38 IO_UINT32 = 2,
39 IO_UINT64 = 3,
40 //
41 // Below enumerations are added in "Extensible Firmware Interface Specification,
42 // Version 1.10, Specification Update, Version 001".
43 //
44 MMIO_COPY_UINT8 = 4,
45 MMIO_COPY_UINT16 = 5,
46 MMIO_COPY_UINT32 = 6,
47 MMIO_COPY_UINT64 = 7
49
68typedef
70(EFIAPI *EFI_DEVICE_IO)(
72 IN EFI_IO_WIDTH Width,
73 IN UINT64 Address,
74 IN UINTN Count,
75 IN OUT VOID *Buffer
76 );
77
78typedef struct {
79 EFI_DEVICE_IO Read;
80 EFI_DEVICE_IO Write;
82
97typedef
99(EFIAPI *EFI_PCI_DEVICE_PATH)(
101 IN UINT64 PciAddress,
102 IN OUT EFI_DEVICE_PATH_PROTOCOL **PciDevicePath
103 );
104
105typedef enum {
110
115
124
144typedef
146(EFIAPI *EFI_IO_MAP)(
148 IN EFI_IO_OPERATION_TYPE Operation,
149 IN EFI_PHYSICAL_ADDRESS *HostAddress,
150 IN OUT UINTN *NumberOfBytes,
151 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
152 OUT VOID **Mapping
153 );
154
165typedef
167(EFIAPI *EFI_IO_UNMAP)(
169 IN VOID *Mapping
170 );
171
189typedef
191(EFIAPI *EFI_IO_ALLOCATE_BUFFER)(
194 IN EFI_MEMORY_TYPE MemoryType,
195 IN UINTN Pages,
196 IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
197 );
198
208typedef
210(EFIAPI *EFI_IO_FLUSH)(
212 );
213
227typedef
229(EFIAPI *EFI_IO_FREE_BUFFER)(
231 IN UINTN Pages,
232 IN EFI_PHYSICAL_ADDRESS HostAddress
233 );
234
252 EFI_IO_MAP Map;
253 EFI_PCI_DEVICE_PATH PciDevicePath;
254 EFI_IO_UNMAP Unmap;
255 EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
256 EFI_IO_FLUSH Flush;
257 EFI_IO_FREE_BUFFER FreeBuffer;
258};
259
260extern EFI_GUID gEfiDeviceIoProtocolGuid;
261
262#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_IO_UNMAP)(IN EFI_DEVICE_IO_PROTOCOL *This, IN VOID *Mapping)
Definition: DeviceIo.h:167
EFI_STATUS(EFIAPI * EFI_DEVICE_IO)(IN EFI_DEVICE_IO_PROTOCOL *This, IN EFI_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
Definition: DeviceIo.h:70
EFI_STATUS(EFIAPI * EFI_IO_FLUSH)(IN EFI_DEVICE_IO_PROTOCOL *This)
Definition: DeviceIo.h:210
EFI_IO_WIDTH
Definition: DeviceIo.h:35
EFI_IO_OPERATION_TYPE
Definition: DeviceIo.h:105
@ EfiBusMasterWrite
Definition: DeviceIo.h:114
@ EfiBusMasterCommonBuffer
Definition: DeviceIo.h:122
@ EfiBusMasterRead
Definition: DeviceIo.h:109
EFI_STATUS(EFIAPI * EFI_IO_MAP)(IN EFI_DEVICE_IO_PROTOCOL *This, IN EFI_IO_OPERATION_TYPE Operation, IN EFI_PHYSICAL_ADDRESS *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
Definition: DeviceIo.h:146
EFI_STATUS(EFIAPI * EFI_PCI_DEVICE_PATH)(IN EFI_DEVICE_IO_PROTOCOL *This, IN UINT64 PciAddress, IN OUT EFI_DEVICE_PATH_PROTOCOL **PciDevicePath)
Definition: DeviceIo.h:99
EFI_STATUS(EFIAPI * EFI_IO_ALLOCATE_BUFFER)(IN EFI_DEVICE_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, IN OUT EFI_PHYSICAL_ADDRESS *HostAddress)
Definition: DeviceIo.h:191
EFI_STATUS(EFIAPI * EFI_IO_FREE_BUFFER)(IN EFI_DEVICE_IO_PROTOCOL *This, IN UINTN Pages, IN EFI_PHYSICAL_ADDRESS HostAddress)
Definition: DeviceIo.h:229
EFI_DEVICE_IO_PROTOCOL EFI_DEVICE_IO_INTERFACE
Definition: DeviceIo.h:30
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:49
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:28
EFI_MEMORY_TYPE
EFI_ALLOCATE_TYPE
Definition: UefiSpec.h:28
EFI_IO_ACCESS Mem
Definition: DeviceIo.h:243
EFI_IO_ACCESS Io
Definition: DeviceIo.h:247
EFI_IO_ACCESS Pci
Definition: DeviceIo.h:251
Definition: Base.h:213