]> git.pld-linux.org Git - packages/gnu-efi.git/blame - gnu-efi-pciio.patch
- updated License note
[packages/gnu-efi.git] / gnu-efi-pciio.patch
CommitLineData
cdccd259
JB
1--- /dev/null
2+++ b/inc/efipciio.h
3@@ -0,0 +1,219 @@
4+#ifndef _EFI_PCI_IO_H
5+#define _EFI_PCI_IO_H
6+
7+#define EFI_PCI_IO_PROTOCOL \
8+ { 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a} }
9+
10+INTERFACE_DECL(_EFI_PCI_IO);
11+
12+typedef enum {
13+ EfiPciIoWidthUint8,
14+ EfiPciIoWidthUint16,
15+ EfiPciIoWidthUint32,
16+ EfiPciIoWidthUint64,
17+ EfiPciIoWidthFifoUint8,
18+ EfiPciIoWidthFifoUint16,
19+ EfiPciIoWidthFifoUint32,
20+ EfiPciIoWidthFifoUint64,
21+ EfiPciIoWidthFillUint8,
22+ EfiPciIoWidthFillUint16,
23+ EfiPciIoWidthFillUint32,
24+ EfiPciIoWidthFillUint64,
25+ EfiPciIoWidthMaximum
26+} EFI_PCI_IO_PROTOCOL_WIDTH;
27+
28+#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff
29+
30+typedef
31+EFI_STATUS
32+(EFIAPI *EFI_PCI_IO_PROTOCOL_POLL_IO_MEM) (
33+ IN struct _EFI_PCI_IO *This,
34+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
35+ IN UINT8 BarIndex,
36+ IN UINT64 Offset,
37+ IN UINT64 Mask,
38+ IN UINT64 Value,
39+ IN UINT64 Delay,
40+ OUT UINT64 *Result
41+ );
42+
43+typedef
44+EFI_STATUS
45+(EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM) (
46+ IN struct _EFI_PCI_IO *This,
47+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
48+ IN UINT8 BarIndex,
49+ IN UINT64 Offset,
50+ IN UINTN Count,
51+ IN OUT VOID *Buffer
52+);
53+
54+typedef struct {
55+ EFI_PCI_IO_PROTOCOL_IO_MEM Read;
56+ EFI_PCI_IO_PROTOCOL_IO_MEM Write;
57+} EFI_PCI_IO_PROTOCOL_ACCESS;
58+
59+typedef
60+EFI_STATUS
61+(EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG) (
62+ IN struct _EFI_PCI_IO *This,
63+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
64+ IN UINT32 Offset,
65+ IN UINTN Count,
66+ IN OUT VOID *Buffer
67+);
68+
69+typedef struct {
70+ EFI_PCI_IO_PROTOCOL_CONFIG Read;
71+ EFI_PCI_IO_PROTOCOL_CONFIG Write;
72+} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
73+
74+typedef
75+EFI_STATUS
76+(EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM) (
77+ IN struct _EFI_PCI_IO *This,
78+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
79+ IN UINT8 DestBarIndex,
80+ IN UINT64 DestOffset,
81+ IN UINT8 SrcBarIndex,
82+ IN UINT64 SrcOffset,
83+ IN UINTN Count
84+ );
85+
86+typedef enum {
87+ EfiPciIoOperationBusMasterRead,
88+ EfiPciIoOperationBusMasterWrite,
89+ EfiPciIoOperationBusMasterCommonBuffer,
90+ EfiPciIoOperationMaximum
91+} EFI_PCI_IO_PROTOCOL_OPERATION;
92+
93+typedef
94+EFI_STATUS
95+(EFIAPI *EFI_PCI_IO_PROTOCOL_MAP) (
96+ IN struct _EFI_PCI_IO *This,
97+ IN EFI_PCI_IO_PROTOCOL_OPERATION Operation,
98+ IN VOID *HostAddress,
99+ IN OUT UINTN *NumberOfBytes,
100+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
101+ OUT VOID **Mapping
102+ );
103+
104+typedef
105+EFI_STATUS
106+(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP) (
107+ IN struct _EFI_PCI_IO *This,
108+ IN VOID *Mapping
109+);
110+
111+typedef
112+EFI_STATUS
113+(EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER) (
114+ IN struct _EFI_PCI_IO *This,
115+ IN EFI_ALLOCATE_TYPE Type,
116+ IN EFI_MEMORY_TYPE MemoryType,
117+ IN UINTN Pages,
118+ OUT VOID **HostAddress,
119+ IN UINT64 Attributes
120+ );
121+
122+typedef
123+EFI_STATUS
124+(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER) (
125+ IN struct _EFI_PCI_IO *This,
126+ IN UINTN Pages,
127+ IN VOID *HostAddress
128+ );
129+
130+typedef
131+EFI_STATUS
132+(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH) (
133+ IN struct _EFI_PCI_IO *This
134+ );
135+
136+typedef
137+EFI_STATUS
138+(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION) (
139+ IN struct _EFI_PCI_IO *This,
140+ OUT UINTN *SegmentNumber,
141+ OUT UINTN *BusNumber,
142+ OUT UINTN *DeviceNumber,
143+ OUT UINTN *FunctionNumber
144+ );
145+
146+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002
147+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004
148+#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008
149+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010
150+#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
151+#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
152+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
153+#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100
154+#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200
155+#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400
156+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800
157+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000
158+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000
159+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000
160+#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
161+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000
162+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
163+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000
164+
165+typedef enum {
166+ EfiPciIoAttributeOperationGet,
167+ EfiPciIoAttributeOperationSet,
168+ EfiPciIoAttributeOperationEnable,
169+ EfiPciIoAttributeOperationDisable,
170+ EfiPciIoAttributeOperationSupported,
171+ EfiPciIoAttributeOperationMaximum
172+} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;
173+
174+typedef
175+EFI_STATUS
176+(EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES) (
177+ IN struct _EFI_PCI_IO *This,
178+ IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation,
179+ IN UINT64 Attributes,
180+ OUT UINT64 *Result OPTIONAL
181+ );
182+
183+typedef
184+EFI_STATUS
185+(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES) (
186+ IN struct _EFI_PCI_IO *This,
187+ IN UINT8 BarIndex,
188+ OUT UINT64 *Supports OPTIONAL,
189+ OUT VOID **Resources OPTIONAL
190+ );
191+
192+typedef
193+EFI_STATUS
194+(EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES) (
195+ IN struct _EFI_PCI_IO *This,
196+ IN UINT64 Attributes,
197+ IN UINT8 BarIndex,
198+ IN OUT UINT64 *Offset,
199+ IN OUT UINT64 *Length
200+ );
201+
202+typedef struct _EFI_PCI_IO {
203+ EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem;
204+ EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo;
205+ EFI_PCI_IO_PROTOCOL_ACCESS Mem;
206+ EFI_PCI_IO_PROTOCOL_ACCESS Io;
207+ EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci;
208+ EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem;
209+ EFI_PCI_IO_PROTOCOL_MAP Map;
210+ EFI_PCI_IO_PROTOCOL_UNMAP Unmap;
211+ EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
212+ EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
213+ EFI_PCI_IO_PROTOCOL_FLUSH Flush;
214+ EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation;
215+ EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes;
216+ EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes;
217+ EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes;
218+ UINT64 RomSize;
219+ VOID *RomImage;
220+} EFI_PCI_IO;
221+
222+#endif /* _EFI_PCI_IO_H */
This page took 0.14181 seconds and 4 git commands to generate.