TianoCore EDK2 master
Loading...
Searching...
No Matches
PciRootBridgeIo.h
Go to the documentation of this file.
1
13#ifndef __PCI_ROOT_BRIDGE_IO_H__
14#define __PCI_ROOT_BRIDGE_IO_H__
15
16#include <Library/BaseLib.h>
17
18#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \
19 { \
20 0x2f707ebb, 0x4a1a, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
21 }
22
24
30typedef enum {
31 EfiPciWidthUint8,
32 EfiPciWidthUint16,
33 EfiPciWidthUint32,
34 EfiPciWidthUint64,
35 EfiPciWidthFifoUint8,
36 EfiPciWidthFifoUint16,
37 EfiPciWidthFifoUint32,
38 EfiPciWidthFifoUint64,
39 EfiPciWidthFillUint8,
40 EfiPciWidthFillUint16,
41 EfiPciWidthFillUint32,
42 EfiPciWidthFillUint64,
43 EfiPciWidthMaximum
45
51typedef enum {
82 EfiPciOperationMaximum
84
85#define EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001
86#define EFI_PCI_ATTRIBUTE_ISA_IO 0x0002
87#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO 0x0004
88#define EFI_PCI_ATTRIBUTE_VGA_MEMORY 0x0008
89#define EFI_PCI_ATTRIBUTE_VGA_IO 0x0010
90#define EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
91#define EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
92#define EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
93#define EFI_PCI_ATTRIBUTE_MEMORY_CACHED 0x0800
94#define EFI_PCI_ATTRIBUTE_MEMORY_DISABLE 0x1000
95#define EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
96#define EFI_PCI_ATTRIBUTE_ISA_IO_16 0x10000
97#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
98#define EFI_PCI_ATTRIBUTE_VGA_IO_16 0x40000
99
100#define EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER (EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE | EFI_PCI_ATTRIBUTE_MEMORY_CACHED | EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE)
101
102#define EFI_PCI_ATTRIBUTE_INVALID_FOR_ALLOCATE_BUFFER (~EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER)
103
104#define EFI_PCI_ADDRESS(bus, dev, func, reg) \
105 (UINT64) ( \
106 (((UINTN) bus) << 24) | \
107 (((UINTN) dev) << 16) | \
108 (((UINTN) func) << 8) | \
109 (((UINTN) (reg)) < 256 ? ((UINTN) (reg)) : (UINT64) (LShiftU64 ((UINT64) (reg), 32))))
110
111typedef struct {
112 UINT8 Register;
113 UINT8 Function;
114 UINT8 Device;
115 UINT8 Bus;
116 UINT32 ExtendedRegister;
118
137typedef
142 IN UINT64 Address,
143 IN UINT64 Mask,
144 IN UINT64 Value,
145 IN UINT64 Delay,
146 OUT UINT64 *Result
147 );
148
164typedef
169 IN UINT64 Address,
170 IN UINTN Count,
171 IN OUT VOID *Buffer
172 );
173
174typedef struct {
184
200typedef
205 IN UINT64 DestAddress,
206 IN UINT64 SrcAddress,
207 IN UINTN Count
208 );
209
230typedef
235 IN VOID *HostAddress,
236 IN OUT UINTN *NumberOfBytes,
237 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
238 OUT VOID **Mapping
239 );
240
252typedef
256 IN VOID *Mapping
257 );
258
279typedef
284 IN EFI_MEMORY_TYPE MemoryType,
285 IN UINTN Pages,
286 IN OUT VOID **HostAddress,
287 IN UINT64 Attributes
288 );
289
302typedef
306 IN UINTN Pages,
307 IN VOID *HostAddress
308 );
309
321typedef
325 );
326
345typedef
349 OUT UINT64 *Supports,
350 OUT UINT64 *Attributes
351 );
352
374typedef
378 IN UINT64 Attributes,
379 IN OUT UINT64 *ResourceBase,
380 IN OUT UINT64 *ResourceLength
381 );
382
397typedef
401 OUT VOID **Resources
402 );
403
427
432};
433
434extern EFI_GUID gEfiPciRootBridgeIoProtocolGuid;
435
436#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION
@ EfiPciOperationBusMasterCommonBuffer
@ EfiPciOperationBusMasterWrite
@ EfiPciOperationBusMasterRead64
@ EfiPciOperationBusMasterWrite64
@ EfiPciOperationBusMasterRead
@ EfiPciOperationBusMasterCommonBuffer64
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN VOID *Mapping)
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN UINT64 Attributes, IN OUT UINT64 *ResourceBase, IN OUT UINT64 *ResourceLength)
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, OUT UINT64 *Supports, OUT UINT64 *Attributes)
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 DestAddress, IN UINT64 SrcAddress, IN UINTN Count)
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, OUT VOID **Resources)
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, IN OUT VOID **HostAddress, IN UINT64 Attributes)
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH
EFI_STATUS(EFIAPI * EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH)(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This)
EFI_STATUS EFIAPI Register(IN EFI_PEI_RSC_HANDLER_CALLBACK Callback)
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
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Write
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Read
Definition: Base.h:213