TianoCore EDK2 master
Loading...
Searching...
No Matches
PciIo.h
Go to the documentation of this file.
1
10#ifndef __PCI_IO_H__
11#define __PCI_IO_H__
12
16#define EFI_PCI_IO_PROTOCOL_GUID \
17 { \
18 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a } \
19 }
20
22
28typedef enum {
29 EfiPciIoWidthUint8 = 0,
30 EfiPciIoWidthUint16,
31 EfiPciIoWidthUint32,
32 EfiPciIoWidthUint64,
33 EfiPciIoWidthFifoUint8,
34 EfiPciIoWidthFifoUint16,
35 EfiPciIoWidthFifoUint32,
36 EfiPciIoWidthFifoUint64,
37 EfiPciIoWidthFillUint8,
38 EfiPciIoWidthFillUint16,
39 EfiPciIoWidthFillUint32,
40 EfiPciIoWidthFillUint64,
41 EfiPciIoWidthMaximum
43
44//
45// Complete PCI address generater
46//
47#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff
48#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f
49#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001
50#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002
51#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004
52#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008
53#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010
54#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
55#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
56#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
57#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100
58#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200
59#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400
60#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800
61#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000
62#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000
63#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000
64#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
65#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000
66#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
67#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000
68
69#define EFI_PCI_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER)
70#define EFI_VGA_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_IO)
71
77typedef enum {
91 EfiPciIoOperationMaximum
93
99typedef enum {
120 EfiPciIoAttributeOperationMaximum
122
145typedef
150 IN UINT8 BarIndex,
151 IN UINT64 Offset,
152 IN UINT64 Mask,
153 IN UINT64 Value,
154 IN UINT64 Delay,
155 OUT UINT64 *Result
156 );
157
178typedef
183 IN UINT8 BarIndex,
184 IN UINT64 Offset,
185 IN UINTN Count,
186 IN OUT VOID *Buffer
187 );
188
189typedef struct {
199
218typedef
223 IN UINT32 Offset,
224 IN UINTN Count,
225 IN OUT VOID *Buffer
226 );
227
228typedef struct {
238
267typedef
272 IN UINT8 DestBarIndex,
273 IN UINT64 DestOffset,
274 IN UINT8 SrcBarIndex,
275 IN UINT64 SrcOffset,
276 IN UINTN Count
277 );
278
298typedef
303 IN VOID *HostAddress,
304 IN OUT UINTN *NumberOfBytes,
305 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
306 OUT VOID **Mapping
307 );
308
319typedef
323 IN VOID *Mapping
324 );
325
346typedef
351 IN EFI_MEMORY_TYPE MemoryType,
352 IN UINTN Pages,
353 OUT VOID **HostAddress,
354 IN UINT64 Attributes
355 );
356
369typedef
373 IN UINTN Pages,
374 IN VOID *HostAddress
375 );
376
388typedef
392 );
393
407typedef
411 OUT UINTN *SegmentNumber,
412 OUT UINTN *BusNumber,
413 OUT UINTN *DeviceNumber,
414 OUT UINTN *FunctionNumber
415 );
416
436typedef
441 IN UINT64 Attributes,
442 OUT UINT64 *Result OPTIONAL
443 );
444
466typedef
470 IN UINT8 BarIndex,
471 OUT UINT64 *Supports OPTIONAL,
472 OUT VOID **Resources OPTIONAL
473 );
474
499typedef
503 IN UINT64 Attributes,
504 IN UINT8 BarIndex,
505 IN OUT UINT64 *Offset,
506 IN OUT UINT64 *Length
507 );
508
532
536 UINT64 RomSize;
537
546 VOID *RomImage;
547};
548
549extern EFI_GUID gEfiPciIoProtocolGuid;
550
551#endif
UINT64 UINTN
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_GET_LOCATION)(IN EFI_PCI_IO_PROTOCOL *This, OUT UINTN *SegmentNumber, OUT UINTN *BusNumber, OUT UINTN *DeviceNumber, OUT UINTN *FunctionNumber)
Definition: PciIo.h:409
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_CONFIG)(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)
Definition: PciIo.h:220
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_FLUSH)(IN EFI_PCI_IO_PROTOCOL *This)
Definition: PciIo.h:390
EFI_PCI_IO_PROTOCOL_WIDTH
Definition: PciIo.h:28
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_MAP)(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
Definition: PciIo.h:300
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES)(IN EFI_PCI_IO_PROTOCOL *This, IN UINT64 Attributes, IN UINT8 BarIndex, IN OUT UINT64 *Offset, IN OUT UINT64 *Length)
Definition: PciIo.h:501
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES)(IN EFI_PCI_IO_PROTOCOL *This, IN UINT8 BarIndex, OUT UINT64 *Supports OPTIONAL, OUT VOID **Resources OPTIONAL)
Definition: PciIo.h:468
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_POLL_IO_MEM)(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
Definition: PciIo.h:147
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER)(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)
Definition: PciIo.h:348
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_COPY_MEM)(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 DestBarIndex, IN UINT64 DestOffset, IN UINT8 SrcBarIndex, IN UINT64 SrcOffset, IN UINTN Count)
Definition: PciIo.h:269
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_FREE_BUFFER)(IN EFI_PCI_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
Definition: PciIo.h:371
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_ATTRIBUTES)(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, IN UINT64 Attributes, OUT UINT64 *Result OPTIONAL)
Definition: PciIo.h:438
EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION
Definition: PciIo.h:99
@ EfiPciIoAttributeOperationDisable
Definition: PciIo.h:115
@ EfiPciIoAttributeOperationGet
Definition: PciIo.h:103
@ EfiPciIoAttributeOperationEnable
Definition: PciIo.h:111
@ EfiPciIoAttributeOperationSet
Definition: PciIo.h:107
@ EfiPciIoAttributeOperationSupported
Definition: PciIo.h:119
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_UNMAP)(IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping)
Definition: PciIo.h:321
EFI_PCI_IO_PROTOCOL_OPERATION
Definition: PciIo.h:77
@ EfiPciIoOperationBusMasterWrite
Definition: PciIo.h:85
@ EfiPciIoOperationBusMasterRead
Definition: PciIo.h:81
@ EfiPciIoOperationBusMasterCommonBuffer
Definition: PciIo.h:90
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_IO_MEM)(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
Definition: PciIo.h:180
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_MEMORY_TYPE
EFI_ALLOCATE_TYPE
Definition: UefiSpec.h:29
EFI_PCI_IO_PROTOCOL_IO_MEM Write
Definition: PciIo.h:197
EFI_PCI_IO_PROTOCOL_IO_MEM Read
Definition: PciIo.h:193
EFI_PCI_IO_PROTOCOL_CONFIG Read
Definition: PciIo.h:232
EFI_PCI_IO_PROTOCOL_CONFIG Write
Definition: PciIo.h:236
Definition: Base.h:213