XenevaOS
Loading...
Searching...
No Matches
PciIo.h
Go to the documentation of this file.
1
16#ifndef __PCI_IO_H__
17#define __PCI_IO_H__
18
22#define EFI_PCI_IO_PROTOCOL_GUID \
23 { \
24 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a } \
25 }
26
28
49
50//
51// Complete PCI address generater
52//
53#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff
54#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f
55#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001
56#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002
57#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004
58#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008
59#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010
60#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
61#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
62#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
63#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100
64#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200
65#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400
66#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800
67#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000
68#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000
69#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000
70#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
71#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000
72#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
73#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000
74
75#define EFI_PCI_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER)
76#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)
77
99
128
151typedef
156 IN UINT8 BarIndex,
157 IN UINT64 Offset,
158 IN UINT64 Mask,
159 IN UINT64 Value,
160 IN UINT64 Delay,
161 OUT UINT64 *Result
162 );
163
184typedef
189 IN UINT8 BarIndex,
190 IN UINT64 Offset,
191 IN UINTN Count,
192 IN OUT VOID *Buffer
193 );
194
205
224typedef
229 IN UINT32 Offset,
230 IN UINTN Count,
231 IN OUT VOID *Buffer
232 );
233
244
273typedef
278 IN UINT8 DestBarIndex,
279 IN UINT64 DestOffset,
280 IN UINT8 SrcBarIndex,
281 IN UINT64 SrcOffset,
282 IN UINTN Count
283 );
284
304typedef
309 IN VOID *HostAddress,
310 IN OUT UINTN *NumberOfBytes,
311 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
312 OUT VOID **Mapping
313 );
314
325typedef
329 IN VOID *Mapping
330 );
331
352typedef
357 IN EFI_MEMORY_TYPE MemoryType,
358 IN UINTN Pages,
359 OUT VOID **HostAddress,
360 IN UINT64 Attributes
361 );
362
375typedef
379 IN UINTN Pages,
380 IN VOID *HostAddress
381 );
382
394typedef
398 );
399
413typedef
417 OUT UINTN *SegmentNumber,
418 OUT UINTN *BusNumber,
419 OUT UINTN *DeviceNumber,
421 );
422
442typedef
447 IN UINT64 Attributes,
448 OUT UINT64 *Result OPTIONAL
449 );
450
472typedef
476 IN UINT8 BarIndex,
477 OUT UINT64 *Supports, OPTIONAL
478 OUT VOID **Resources OPTIONAL
479 );
480
505typedef
509 IN UINT64 Attributes,
510 IN UINT8 BarIndex,
511 IN OUT UINT64 *Offset,
513 );
514
554
556
557#endif
UINT64 UINTN
Definition ProcessorBind.h:118
#define EFIAPI
Definition ProcessorBind.h:172
unsigned int UINT32
Definition ProcessorBind.h:102
UINT16 Mask
Definition Acpi10.h:159
UINT16 FunctionNumber
Definition Acpi62.h:47
#define IN
Definition Base.h:347
#define OUT
Definition Base.h:352
#define OPTIONAL
Definition Base.h:358
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:415
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:226
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_FLUSH)(IN EFI_PCI_IO_PROTOCOL *This)
Definition PciIo.h:396
EFI_PCI_IO_PROTOCOL_WIDTH
Definition PciIo.h:34
@ EfiPciIoWidthFillUint16
Definition PciIo.h:44
@ EfiPciIoWidthUint16
Definition PciIo.h:36
@ EfiPciIoWidthUint8
Definition PciIo.h:35
@ EfiPciIoWidthFillUint32
Definition PciIo.h:45
@ EfiPciIoWidthFillUint8
Definition PciIo.h:43
@ EfiPciIoWidthFillUint64
Definition PciIo.h:46
@ EfiPciIoWidthUint32
Definition PciIo.h:37
@ EfiPciIoWidthFifoUint64
Definition PciIo.h:42
@ EfiPciIoWidthUint64
Definition PciIo.h:38
@ EfiPciIoWidthFifoUint32
Definition PciIo.h:41
@ EfiPciIoWidthMaximum
Definition PciIo.h:47
@ EfiPciIoWidthFifoUint16
Definition PciIo.h:40
@ EfiPciIoWidthFifoUint8
Definition PciIo.h:39
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:306
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:507
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:153
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:354
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:275
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_FREE_BUFFER)(IN EFI_PCI_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
Definition PciIo.h:377
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:444
EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION
Definition PciIo.h:105
@ EfiPciIoAttributeOperationDisable
Definition PciIo.h:121
@ EfiPciIoAttributeOperationMaximum
Definition PciIo.h:126
@ EfiPciIoAttributeOperationGet
Definition PciIo.h:109
@ EfiPciIoAttributeOperationEnable
Definition PciIo.h:117
@ EfiPciIoAttributeOperationSet
Definition PciIo.h:113
@ EfiPciIoAttributeOperationSupported
Definition PciIo.h:125
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:474
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_UNMAP)(IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping)
Definition PciIo.h:327
EFI_PCI_IO_PROTOCOL_OPERATION
Definition PciIo.h:83
@ EfiPciIoOperationMaximum
Definition PciIo.h:97
@ EfiPciIoOperationBusMasterWrite
Definition PciIo.h:91
@ EfiPciIoOperationBusMasterRead
Definition PciIo.h:87
@ EfiPciIoOperationBusMasterCommonBuffer
Definition PciIo.h:96
EFI_GUID gEfiPciIoProtocolGuid
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:186
UINT64 EFI_PHYSICAL_ADDRESS
Definition UefiBaseType.h:54
RETURN_STATUS EFI_STATUS
Definition UefiBaseType.h:33
EFI_MEMORY_TYPE
Definition UefiMultiPhase.h:44
EFI_ALLOCATE_TYPE
Definition UefiSpec.h:32
#define VOID
Definition acefi.h:190
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 Type
Definition acpixf.h:894
ACPI_PHYSICAL_ADDRESS ACPI_SIZE Length
Definition acpixf.h:638
unsigned char UINT8
Definition actypes.h:236
COMPILER_DEPENDENT_UINT64 UINT64
Definition actypes.h:239
Definition PciIo.h:195
EFI_PCI_IO_PROTOCOL_IO_MEM Write
Definition PciIo.h:203
EFI_PCI_IO_PROTOCOL_IO_MEM Read
Definition PciIo.h:199
Definition PciIo.h:234
EFI_PCI_IO_PROTOCOL_CONFIG Read
Definition PciIo.h:238
EFI_PCI_IO_PROTOCOL_CONFIG Write
Definition PciIo.h:242
Definition Base.h:281
Definition PciIo.h:522
EFI_PCI_IO_PROTOCOL_FLUSH Flush
Definition PciIo.h:533
EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci
Definition PciIo.h:527
EFI_PCI_IO_PROTOCOL_ACCESS Mem
Definition PciIo.h:525
EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem
Definition PciIo.h:528
EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo
Definition PciIo.h:524
EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer
Definition PciIo.h:531
VOID * RomImage
Definition PciIo.h:552
EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem
Definition PciIo.h:523
UINT64 RomSize
Definition PciIo.h:542
EFI_PCI_IO_PROTOCOL_ACCESS Io
Definition PciIo.h:526
EFI_PCI_IO_PROTOCOL_UNMAP Unmap
Definition PciIo.h:530
EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes
Definition PciIo.h:535
EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation
Definition PciIo.h:534
EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes
Definition PciIo.h:536
EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes
Definition PciIo.h:537
EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer
Definition PciIo.h:532
EFI_PCI_IO_PROTOCOL_MAP Map
Definition PciIo.h:529