13#ifndef __PCI_ROOT_BRIDGE_IO_H__
14#define __PCI_ROOT_BRIDGE_IO_H__
18#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \
20 0x2f707ebb, 0x4a1a, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
36 EfiPciWidthFifoUint16,
37 EfiPciWidthFifoUint32,
38 EfiPciWidthFifoUint64,
40 EfiPciWidthFillUint16,
41 EfiPciWidthFillUint32,
42 EfiPciWidthFillUint64,
82 EfiPciOperationMaximum
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
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)
102#define EFI_PCI_ATTRIBUTE_INVALID_FOR_ALLOCATE_BUFFER (~EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER)
104#define EFI_PCI_ADDRESS(bus, dev, func, reg) \
106 (((UINTN) bus) << 24) | \
107 (((UINTN) dev) << 16) | \
108 (((UINTN) func) << 8) | \
109 (((UINTN) (reg)) < 256 ? ((UINTN) (reg)) : (UINT64) (LShiftU64 ((UINT64) (reg), 32))))
116 UINT32 ExtendedRegister;
205 IN UINT64 DestAddress,
206 IN UINT64 SrcAddress,
235 IN VOID *HostAddress,
286 IN OUT VOID **HostAddress,
349 OUT UINT64 *Supports,
350 OUT UINT64 *Attributes
378 IN UINT64 Attributes,
379 IN OUT UINT64 *ResourceBase,
380 IN OUT UINT64 *ResourceLength
434extern EFI_GUID gEfiPciRootBridgeIoProtocolGuid;
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
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Write
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Read