Deleted Added
full compact
efiprot.h (96893) efiprot.h (163898)
1/* $FreeBSD: head/sys/boot/efi/include/efiprot.h 96893 2002-05-19 03:17:22Z marcel $ */
1/* $FreeBSD: head/sys/boot/efi/include/efiprot.h 163898 2006-11-02 02:42:48Z marcel $ */
2#ifndef _EFI_PROT_H
3#define _EFI_PROT_H
4
5/*++
6
2#ifndef _EFI_PROT_H
3#define _EFI_PROT_H
4
5/*++
6
7Copyright (c) 1998 Intel Corporation
7Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
8This software and associated documentation (if any) is furnished
9under a license and may only be used or copied in accordance
10with the terms of the license. Except as permitted by such
11license, no part of this software or documentation may be
12reproduced, stored in a retrieval system, or transmitted in any
13form or by any means without the express written consent of
14Intel Corporation.
8
9Module Name:
10
11 efiprot.h
12
13Abstract:
14
15 EFI Protocols
16
17
18
19Revision History
20
21--*/
22
15
16Module Name:
17
18 efiprot.h
19
20Abstract:
21
22 EFI Protocols
23
24
25
26Revision History
27
28--*/
29
23/*
24 * Device Path protocol
25 */
30//
31// Device Path protocol
32//
26
27#define DEVICE_PATH_PROTOCOL \
28 { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
29
30
33
34#define DEVICE_PATH_PROTOCOL \
35 { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
36
37
31/*
32 * Block IO protocol
33 */
38//
39// Block IO protocol
40//
34
35#define BLOCK_IO_PROTOCOL \
36 { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
37#define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000
38
39INTERFACE_DECL(_EFI_BLOCK_IO);
40
41typedef
42EFI_STATUS
43(EFIAPI *EFI_BLOCK_RESET) (
44 IN struct _EFI_BLOCK_IO *This,
45 IN BOOLEAN ExtendedVerification
46 );
47
48typedef
49EFI_STATUS
50(EFIAPI *EFI_BLOCK_READ) (
51 IN struct _EFI_BLOCK_IO *This,
52 IN UINT32 MediaId,
53 IN EFI_LBA LBA,
54 IN UINTN BufferSize,
55 OUT VOID *Buffer
56 );
57
58
59typedef
60EFI_STATUS
61(EFIAPI *EFI_BLOCK_WRITE) (
62 IN struct _EFI_BLOCK_IO *This,
63 IN UINT32 MediaId,
64 IN EFI_LBA LBA,
65 IN UINTN BufferSize,
66 IN VOID *Buffer
67 );
68
69
70typedef
71EFI_STATUS
72(EFIAPI *EFI_BLOCK_FLUSH) (
73 IN struct _EFI_BLOCK_IO *This
74 );
75
76
77
78typedef struct {
79 UINT32 MediaId;
80 BOOLEAN RemovableMedia;
81 BOOLEAN MediaPresent;
82
83 BOOLEAN LogicalPartition;
84 BOOLEAN ReadOnly;
85 BOOLEAN WriteCaching;
86
87 UINT32 BlockSize;
88 UINT32 IoAlign;
89
90 EFI_LBA LastBlock;
91} EFI_BLOCK_IO_MEDIA;
92
93typedef struct _EFI_BLOCK_IO {
94 UINT64 Revision;
95
96 EFI_BLOCK_IO_MEDIA *Media;
97
98 EFI_BLOCK_RESET Reset;
99 EFI_BLOCK_READ ReadBlocks;
100 EFI_BLOCK_WRITE WriteBlocks;
101 EFI_BLOCK_FLUSH FlushBlocks;
102
103} EFI_BLOCK_IO;
104
105
106
41
42#define BLOCK_IO_PROTOCOL \
43 { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
44#define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000
45
46INTERFACE_DECL(_EFI_BLOCK_IO);
47
48typedef
49EFI_STATUS
50(EFIAPI *EFI_BLOCK_RESET) (
51 IN struct _EFI_BLOCK_IO *This,
52 IN BOOLEAN ExtendedVerification
53 );
54
55typedef
56EFI_STATUS
57(EFIAPI *EFI_BLOCK_READ) (
58 IN struct _EFI_BLOCK_IO *This,
59 IN UINT32 MediaId,
60 IN EFI_LBA LBA,
61 IN UINTN BufferSize,
62 OUT VOID *Buffer
63 );
64
65
66typedef
67EFI_STATUS
68(EFIAPI *EFI_BLOCK_WRITE) (
69 IN struct _EFI_BLOCK_IO *This,
70 IN UINT32 MediaId,
71 IN EFI_LBA LBA,
72 IN UINTN BufferSize,
73 IN VOID *Buffer
74 );
75
76
77typedef
78EFI_STATUS
79(EFIAPI *EFI_BLOCK_FLUSH) (
80 IN struct _EFI_BLOCK_IO *This
81 );
82
83
84
85typedef struct {
86 UINT32 MediaId;
87 BOOLEAN RemovableMedia;
88 BOOLEAN MediaPresent;
89
90 BOOLEAN LogicalPartition;
91 BOOLEAN ReadOnly;
92 BOOLEAN WriteCaching;
93
94 UINT32 BlockSize;
95 UINT32 IoAlign;
96
97 EFI_LBA LastBlock;
98} EFI_BLOCK_IO_MEDIA;
99
100typedef struct _EFI_BLOCK_IO {
101 UINT64 Revision;
102
103 EFI_BLOCK_IO_MEDIA *Media;
104
105 EFI_BLOCK_RESET Reset;
106 EFI_BLOCK_READ ReadBlocks;
107 EFI_BLOCK_WRITE WriteBlocks;
108 EFI_BLOCK_FLUSH FlushBlocks;
109
110} EFI_BLOCK_IO;
111
112
113
107/*
108 * Disk Block IO protocol
109 */
114//
115// Disk Block IO protocol
116//
110
111#define DISK_IO_PROTOCOL \
112 { 0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
113#define EFI_DISK_IO_INTERFACE_REVISION 0x00010000
114
115INTERFACE_DECL(_EFI_DISK_IO);
116
117typedef
118EFI_STATUS
119(EFIAPI *EFI_DISK_READ) (
120 IN struct _EFI_DISK_IO *This,
121 IN UINT32 MediaId,
122 IN UINT64 Offset,
123 IN UINTN BufferSize,
124 OUT VOID *Buffer
125 );
126
127
128typedef
129EFI_STATUS
130(EFIAPI *EFI_DISK_WRITE) (
131 IN struct _EFI_DISK_IO *This,
132 IN UINT32 MediaId,
133 IN UINT64 Offset,
134 IN UINTN BufferSize,
135 IN VOID *Buffer
136 );
137
138
139typedef struct _EFI_DISK_IO {
140 UINT64 Revision;
141 EFI_DISK_READ ReadDisk;
142 EFI_DISK_WRITE WriteDisk;
143} EFI_DISK_IO;
144
145
117
118#define DISK_IO_PROTOCOL \
119 { 0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
120#define EFI_DISK_IO_INTERFACE_REVISION 0x00010000
121
122INTERFACE_DECL(_EFI_DISK_IO);
123
124typedef
125EFI_STATUS
126(EFIAPI *EFI_DISK_READ) (
127 IN struct _EFI_DISK_IO *This,
128 IN UINT32 MediaId,
129 IN UINT64 Offset,
130 IN UINTN BufferSize,
131 OUT VOID *Buffer
132 );
133
134
135typedef
136EFI_STATUS
137(EFIAPI *EFI_DISK_WRITE) (
138 IN struct _EFI_DISK_IO *This,
139 IN UINT32 MediaId,
140 IN UINT64 Offset,
141 IN UINTN BufferSize,
142 IN VOID *Buffer
143 );
144
145
146typedef struct _EFI_DISK_IO {
147 UINT64 Revision;
148 EFI_DISK_READ ReadDisk;
149 EFI_DISK_WRITE WriteDisk;
150} EFI_DISK_IO;
151
152
146/*
147 * Simple filesystem protocol
148 */
153//
154// Simple file system protocol
155//
149
150#define SIMPLE_FILE_SYSTEM_PROTOCOL \
151 { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
152
153INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
154INTERFACE_DECL(_EFI_FILE_HANDLE);
155
156typedef
157EFI_STATUS
158(EFIAPI *EFI_VOLUME_OPEN) (
159 IN struct _EFI_FILE_IO_INTERFACE *This,
160 OUT struct _EFI_FILE_HANDLE **Root
161 );
162
163#define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
164
165typedef struct _EFI_FILE_IO_INTERFACE {
166 UINT64 Revision;
167 EFI_VOLUME_OPEN OpenVolume;
168} EFI_FILE_IO_INTERFACE;
169
156
157#define SIMPLE_FILE_SYSTEM_PROTOCOL \
158 { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
159
160INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
161INTERFACE_DECL(_EFI_FILE_HANDLE);
162
163typedef
164EFI_STATUS
165(EFIAPI *EFI_VOLUME_OPEN) (
166 IN struct _EFI_FILE_IO_INTERFACE *This,
167 OUT struct _EFI_FILE_HANDLE **Root
168 );
169
170#define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
171
172typedef struct _EFI_FILE_IO_INTERFACE {
173 UINT64 Revision;
174 EFI_VOLUME_OPEN OpenVolume;
175} EFI_FILE_IO_INTERFACE;
176
177//
178//
179//
180
170typedef
171EFI_STATUS
172(EFIAPI *EFI_FILE_OPEN) (
173 IN struct _EFI_FILE_HANDLE *File,
174 OUT struct _EFI_FILE_HANDLE **NewHandle,
175 IN CHAR16 *FileName,
176 IN UINT64 OpenMode,
177 IN UINT64 Attributes
178 );
179
181typedef
182EFI_STATUS
183(EFIAPI *EFI_FILE_OPEN) (
184 IN struct _EFI_FILE_HANDLE *File,
185 OUT struct _EFI_FILE_HANDLE **NewHandle,
186 IN CHAR16 *FileName,
187 IN UINT64 OpenMode,
188 IN UINT64 Attributes
189 );
190
180/* Open modes */
191// Open modes
181#define EFI_FILE_MODE_READ 0x0000000000000001
182#define EFI_FILE_MODE_WRITE 0x0000000000000002
183#define EFI_FILE_MODE_CREATE 0x8000000000000000
184
192#define EFI_FILE_MODE_READ 0x0000000000000001
193#define EFI_FILE_MODE_WRITE 0x0000000000000002
194#define EFI_FILE_MODE_CREATE 0x8000000000000000
195
185/* File attributes */
196// File attributes
186#define EFI_FILE_READ_ONLY 0x0000000000000001
187#define EFI_FILE_HIDDEN 0x0000000000000002
188#define EFI_FILE_SYSTEM 0x0000000000000004
189#define EFI_FILE_RESERVIED 0x0000000000000008
190#define EFI_FILE_DIRECTORY 0x0000000000000010
191#define EFI_FILE_ARCHIVE 0x0000000000000020
192#define EFI_FILE_VALID_ATTR 0x0000000000000037
193
194typedef
195EFI_STATUS
196(EFIAPI *EFI_FILE_CLOSE) (
197 IN struct _EFI_FILE_HANDLE *File
198 );
199
200typedef
201EFI_STATUS
202(EFIAPI *EFI_FILE_DELETE) (
203 IN struct _EFI_FILE_HANDLE *File
204 );
205
206typedef
207EFI_STATUS
208(EFIAPI *EFI_FILE_READ) (
209 IN struct _EFI_FILE_HANDLE *File,
210 IN OUT UINTN *BufferSize,
211 OUT VOID *Buffer
212 );
213
214typedef
215EFI_STATUS
216(EFIAPI *EFI_FILE_WRITE) (
217 IN struct _EFI_FILE_HANDLE *File,
218 IN OUT UINTN *BufferSize,
219 IN VOID *Buffer
220 );
221
222typedef
223EFI_STATUS
224(EFIAPI *EFI_FILE_SET_POSITION) (
225 IN struct _EFI_FILE_HANDLE *File,
226 IN UINT64 Position
227 );
228
229typedef
230EFI_STATUS
231(EFIAPI *EFI_FILE_GET_POSITION) (
232 IN struct _EFI_FILE_HANDLE *File,
233 OUT UINT64 *Position
234 );
235
236typedef
237EFI_STATUS
238(EFIAPI *EFI_FILE_GET_INFO) (
239 IN struct _EFI_FILE_HANDLE *File,
240 IN EFI_GUID *InformationType,
241 IN OUT UINTN *BufferSize,
242 OUT VOID *Buffer
243 );
244
245typedef
246EFI_STATUS
247(EFIAPI *EFI_FILE_SET_INFO) (
248 IN struct _EFI_FILE_HANDLE *File,
249 IN EFI_GUID *InformationType,
250 IN UINTN BufferSize,
251 IN VOID *Buffer
252 );
253
254typedef
255EFI_STATUS
256(EFIAPI *EFI_FILE_FLUSH) (
257 IN struct _EFI_FILE_HANDLE *File
258 );
259
260
261
262#define EFI_FILE_HANDLE_REVISION 0x00010000
263typedef struct _EFI_FILE_HANDLE {
264 UINT64 Revision;
265 EFI_FILE_OPEN Open;
266 EFI_FILE_CLOSE Close;
267 EFI_FILE_DELETE Delete;
268 EFI_FILE_READ Read;
269 EFI_FILE_WRITE Write;
270 EFI_FILE_GET_POSITION GetPosition;
271 EFI_FILE_SET_POSITION SetPosition;
272 EFI_FILE_GET_INFO GetInfo;
273 EFI_FILE_SET_INFO SetInfo;
274 EFI_FILE_FLUSH Flush;
275} EFI_FILE, *EFI_FILE_HANDLE;
276
277
197#define EFI_FILE_READ_ONLY 0x0000000000000001
198#define EFI_FILE_HIDDEN 0x0000000000000002
199#define EFI_FILE_SYSTEM 0x0000000000000004
200#define EFI_FILE_RESERVIED 0x0000000000000008
201#define EFI_FILE_DIRECTORY 0x0000000000000010
202#define EFI_FILE_ARCHIVE 0x0000000000000020
203#define EFI_FILE_VALID_ATTR 0x0000000000000037
204
205typedef
206EFI_STATUS
207(EFIAPI *EFI_FILE_CLOSE) (
208 IN struct _EFI_FILE_HANDLE *File
209 );
210
211typedef
212EFI_STATUS
213(EFIAPI *EFI_FILE_DELETE) (
214 IN struct _EFI_FILE_HANDLE *File
215 );
216
217typedef
218EFI_STATUS
219(EFIAPI *EFI_FILE_READ) (
220 IN struct _EFI_FILE_HANDLE *File,
221 IN OUT UINTN *BufferSize,
222 OUT VOID *Buffer
223 );
224
225typedef
226EFI_STATUS
227(EFIAPI *EFI_FILE_WRITE) (
228 IN struct _EFI_FILE_HANDLE *File,
229 IN OUT UINTN *BufferSize,
230 IN VOID *Buffer
231 );
232
233typedef
234EFI_STATUS
235(EFIAPI *EFI_FILE_SET_POSITION) (
236 IN struct _EFI_FILE_HANDLE *File,
237 IN UINT64 Position
238 );
239
240typedef
241EFI_STATUS
242(EFIAPI *EFI_FILE_GET_POSITION) (
243 IN struct _EFI_FILE_HANDLE *File,
244 OUT UINT64 *Position
245 );
246
247typedef
248EFI_STATUS
249(EFIAPI *EFI_FILE_GET_INFO) (
250 IN struct _EFI_FILE_HANDLE *File,
251 IN EFI_GUID *InformationType,
252 IN OUT UINTN *BufferSize,
253 OUT VOID *Buffer
254 );
255
256typedef
257EFI_STATUS
258(EFIAPI *EFI_FILE_SET_INFO) (
259 IN struct _EFI_FILE_HANDLE *File,
260 IN EFI_GUID *InformationType,
261 IN UINTN BufferSize,
262 IN VOID *Buffer
263 );
264
265typedef
266EFI_STATUS
267(EFIAPI *EFI_FILE_FLUSH) (
268 IN struct _EFI_FILE_HANDLE *File
269 );
270
271
272
273#define EFI_FILE_HANDLE_REVISION 0x00010000
274typedef struct _EFI_FILE_HANDLE {
275 UINT64 Revision;
276 EFI_FILE_OPEN Open;
277 EFI_FILE_CLOSE Close;
278 EFI_FILE_DELETE Delete;
279 EFI_FILE_READ Read;
280 EFI_FILE_WRITE Write;
281 EFI_FILE_GET_POSITION GetPosition;
282 EFI_FILE_SET_POSITION SetPosition;
283 EFI_FILE_GET_INFO GetInfo;
284 EFI_FILE_SET_INFO SetInfo;
285 EFI_FILE_FLUSH Flush;
286} EFI_FILE, *EFI_FILE_HANDLE;
287
288
278/*
279 * File information types
280 */
289//
290// File information types
291//
281
282#define EFI_FILE_INFO_ID \
283 { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
284
285typedef struct {
286 UINT64 Size;
287 UINT64 FileSize;
288 UINT64 PhysicalSize;
289 EFI_TIME CreateTime;
290 EFI_TIME LastAccessTime;
291 EFI_TIME ModificationTime;
292 UINT64 Attribute;
293 CHAR16 FileName[1];
294} EFI_FILE_INFO;
295
292
293#define EFI_FILE_INFO_ID \
294 { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
295
296typedef struct {
297 UINT64 Size;
298 UINT64 FileSize;
299 UINT64 PhysicalSize;
300 EFI_TIME CreateTime;
301 EFI_TIME LastAccessTime;
302 EFI_TIME ModificationTime;
303 UINT64 Attribute;
304 CHAR16 FileName[1];
305} EFI_FILE_INFO;
306
296/*
297 * The FileName field of the EFI_FILE_INFO data structure is variable length.
298 * Whenever code needs to know the size of the EFI_FILE_INFO data structure,
299 * it needs to be the size of the data structure without the FileName field.
300 * The following macro computes this size correctly no matter how big the
301 * FileName array is declared. This is required to make the EFI_FILE_INFO
302 * data structure ANSI compliant.
303 */
307//
308// The FileName field of the EFI_FILE_INFO data structure is variable length.
309// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
310// be the size of the data structure without the FileName field. The following macro
311// computes this size correctly no matter how big the FileName array is declared.
312// This is required to make the EFI_FILE_INFO data structure ANSI compilant.
313//
304
305#define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
306
307#define EFI_FILE_SYSTEM_INFO_ID \
308 { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
309
310typedef struct {
311 UINT64 Size;
312 BOOLEAN ReadOnly;
313 UINT64 VolumeSize;
314 UINT64 FreeSpace;
315 UINT32 BlockSize;
316 CHAR16 VolumeLabel[1];
317} EFI_FILE_SYSTEM_INFO;
318
314
315#define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
316
317#define EFI_FILE_SYSTEM_INFO_ID \
318 { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
319
320typedef struct {
321 UINT64 Size;
322 BOOLEAN ReadOnly;
323 UINT64 VolumeSize;
324 UINT64 FreeSpace;
325 UINT32 BlockSize;
326 CHAR16 VolumeLabel[1];
327} EFI_FILE_SYSTEM_INFO;
328
319/*
320 * The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is
321 * variable length. Whenever code needs to know the size of the
322 * EFI_FILE_SYSTEM_INFO data structure, it needs to be the size of the data
323 * structure without the VolumeLable field. The following macro computes
324 * this size correctly no matter how big the VolumeLable array is declared.
325 * This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI
326 * compilant.
327 */
329//
330// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
331// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
332// to be the size of the data structure without the VolumeLable field. The following macro
333// computes this size correctly no matter how big the VolumeLable array is declared.
334// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
335//
328
329#define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
330
331#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
332 { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
333
334typedef struct {
335 CHAR16 VolumeLabel[1];
336} EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
337
338#define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
339
336
337#define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
338
339#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
340 { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
341
342typedef struct {
343 CHAR16 VolumeLabel[1];
344} EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
345
346#define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
347
340/*
341 * Load file protocol
342 */
348//
349// Load file protocol
350//
343
351
352
344#define LOAD_FILE_PROTOCOL \
345 { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
346
347INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
348
349typedef
350EFI_STATUS
351(EFIAPI *EFI_LOAD_FILE) (
352 IN struct _EFI_LOAD_FILE_INTERFACE *This,
353 IN EFI_DEVICE_PATH *FilePath,
354 IN BOOLEAN BootPolicy,
355 IN OUT UINTN *BufferSize,
356 IN VOID *Buffer OPTIONAL
357 );
358
359typedef struct _EFI_LOAD_FILE_INTERFACE {
360 EFI_LOAD_FILE LoadFile;
361} EFI_LOAD_FILE_INTERFACE;
362
363
353#define LOAD_FILE_PROTOCOL \
354 { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
355
356INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
357
358typedef
359EFI_STATUS
360(EFIAPI *EFI_LOAD_FILE) (
361 IN struct _EFI_LOAD_FILE_INTERFACE *This,
362 IN EFI_DEVICE_PATH *FilePath,
363 IN BOOLEAN BootPolicy,
364 IN OUT UINTN *BufferSize,
365 IN VOID *Buffer OPTIONAL
366 );
367
368typedef struct _EFI_LOAD_FILE_INTERFACE {
369 EFI_LOAD_FILE LoadFile;
370} EFI_LOAD_FILE_INTERFACE;
371
372
364/*
365 * Device IO protocol
366 */
373//
374// Device IO protocol
375//
367
368#define DEVICE_IO_PROTOCOL \
369 { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
370
371INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
372
373typedef enum {
374 IO_UINT8,
375 IO_UINT16,
376 IO_UINT32,
377 IO_UINT64,
376
377#define DEVICE_IO_PROTOCOL \
378 { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
379
380INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
381
382typedef enum {
383 IO_UINT8,
384 IO_UINT16,
385 IO_UINT32,
386 IO_UINT64,
378/*
379 * Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to
380 * MMIO
381 */
387//
388// Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO
389//
382 MMIO_COPY_UINT8,
383 MMIO_COPY_UINT16,
384 MMIO_COPY_UINT32,
385 MMIO_COPY_UINT64
386} EFI_IO_WIDTH;
387
390 MMIO_COPY_UINT8,
391 MMIO_COPY_UINT16,
392 MMIO_COPY_UINT32,
393 MMIO_COPY_UINT64
394} EFI_IO_WIDTH;
395
388#define EFI_PCI_ADDRESS(_bus,_dev,_func) \
389 ( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) )
396#define EFI_PCI_ADDRESS(bus,dev,func,reg) \
397 ( (UINT64) ( (((UINTN)bus) << 24) + (((UINTN)dev) << 16) + (((UINTN)func) << 8) + ((UINTN)reg) ))
390
398
391
392typedef
393EFI_STATUS
394(EFIAPI *EFI_DEVICE_IO) (
395 IN struct _EFI_DEVICE_IO_INTERFACE *This,
396 IN EFI_IO_WIDTH Width,
397 IN UINT64 Address,
398 IN UINTN Count,
399 IN OUT VOID *Buffer
400 );
401
402typedef struct {
403 EFI_DEVICE_IO Read;
404 EFI_DEVICE_IO Write;
405} EFI_IO_ACCESS;
406
407typedef
408EFI_STATUS
409(EFIAPI *EFI_PCI_DEVICE_PATH) (
410 IN struct _EFI_DEVICE_IO_INTERFACE *This,
411 IN UINT64 Address,
412 IN OUT EFI_DEVICE_PATH **PciDevicePath
413 );
414
415typedef enum {
416 EfiBusMasterRead,
417 EfiBusMasterWrite,
418 EfiBusMasterCommonBuffer
419} EFI_IO_OPERATION_TYPE;
420
421typedef
422EFI_STATUS
423(EFIAPI *EFI_IO_MAP) (
424 IN struct _EFI_DEVICE_IO_INTERFACE *This,
425 IN EFI_IO_OPERATION_TYPE Operation,
426 IN EFI_PHYSICAL_ADDRESS *HostAddress,
427 IN OUT UINTN *NumberOfBytes,
428 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
429 OUT VOID **Mapping
430 );
431
432typedef
433EFI_STATUS
434(EFIAPI *EFI_IO_UNMAP) (
435 IN struct _EFI_DEVICE_IO_INTERFACE *This,
436 IN VOID *Mapping
437 );
438
439typedef
440EFI_STATUS
441(EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
442 IN struct _EFI_DEVICE_IO_INTERFACE *This,
443 IN EFI_ALLOCATE_TYPE Type,
444 IN EFI_MEMORY_TYPE MemoryType,
445 IN UINTN Pages,
446 IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
447 );
448
449typedef
450EFI_STATUS
451(EFIAPI *EFI_IO_FLUSH) (
452 IN struct _EFI_DEVICE_IO_INTERFACE *This
453 );
454
455typedef
456EFI_STATUS
457(EFIAPI *EFI_IO_FREE_BUFFER) (
458 IN struct _EFI_DEVICE_IO_INTERFACE *This,
459 IN UINTN Pages,
460 IN EFI_PHYSICAL_ADDRESS HostAddress
461 );
462
463typedef struct _EFI_DEVICE_IO_INTERFACE {
464 EFI_IO_ACCESS Mem;
465 EFI_IO_ACCESS Io;
466 EFI_IO_ACCESS Pci;
467 EFI_IO_MAP Map;
468 EFI_PCI_DEVICE_PATH PciDevicePath;
469 EFI_IO_UNMAP Unmap;
470 EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
471 EFI_IO_FLUSH Flush;
472 EFI_IO_FREE_BUFFER FreeBuffer;
473} EFI_DEVICE_IO_INTERFACE;
474
475
399typedef
400EFI_STATUS
401(EFIAPI *EFI_DEVICE_IO) (
402 IN struct _EFI_DEVICE_IO_INTERFACE *This,
403 IN EFI_IO_WIDTH Width,
404 IN UINT64 Address,
405 IN UINTN Count,
406 IN OUT VOID *Buffer
407 );
408
409typedef struct {
410 EFI_DEVICE_IO Read;
411 EFI_DEVICE_IO Write;
412} EFI_IO_ACCESS;
413
414typedef
415EFI_STATUS
416(EFIAPI *EFI_PCI_DEVICE_PATH) (
417 IN struct _EFI_DEVICE_IO_INTERFACE *This,
418 IN UINT64 Address,
419 IN OUT EFI_DEVICE_PATH **PciDevicePath
420 );
421
422typedef enum {
423 EfiBusMasterRead,
424 EfiBusMasterWrite,
425 EfiBusMasterCommonBuffer
426} EFI_IO_OPERATION_TYPE;
427
428typedef
429EFI_STATUS
430(EFIAPI *EFI_IO_MAP) (
431 IN struct _EFI_DEVICE_IO_INTERFACE *This,
432 IN EFI_IO_OPERATION_TYPE Operation,
433 IN EFI_PHYSICAL_ADDRESS *HostAddress,
434 IN OUT UINTN *NumberOfBytes,
435 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
436 OUT VOID **Mapping
437 );
438
439typedef
440EFI_STATUS
441(EFIAPI *EFI_IO_UNMAP) (
442 IN struct _EFI_DEVICE_IO_INTERFACE *This,
443 IN VOID *Mapping
444 );
445
446typedef
447EFI_STATUS
448(EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
449 IN struct _EFI_DEVICE_IO_INTERFACE *This,
450 IN EFI_ALLOCATE_TYPE Type,
451 IN EFI_MEMORY_TYPE MemoryType,
452 IN UINTN Pages,
453 IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
454 );
455
456typedef
457EFI_STATUS
458(EFIAPI *EFI_IO_FLUSH) (
459 IN struct _EFI_DEVICE_IO_INTERFACE *This
460 );
461
462typedef
463EFI_STATUS
464(EFIAPI *EFI_IO_FREE_BUFFER) (
465 IN struct _EFI_DEVICE_IO_INTERFACE *This,
466 IN UINTN Pages,
467 IN EFI_PHYSICAL_ADDRESS HostAddress
468 );
469
470typedef struct _EFI_DEVICE_IO_INTERFACE {
471 EFI_IO_ACCESS Mem;
472 EFI_IO_ACCESS Io;
473 EFI_IO_ACCESS Pci;
474 EFI_IO_MAP Map;
475 EFI_PCI_DEVICE_PATH PciDevicePath;
476 EFI_IO_UNMAP Unmap;
477 EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
478 EFI_IO_FLUSH Flush;
479 EFI_IO_FREE_BUFFER FreeBuffer;
480} EFI_DEVICE_IO_INTERFACE;
481
482
476/*
477 * Unicode Collation protocol
478 */
483//
484// Unicode Collation protocol
485//
479
480#define UNICODE_COLLATION_PROTOCOL \
481 { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
482
483#define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
484
485INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
486
487typedef
488INTN
486
487#define UNICODE_COLLATION_PROTOCOL \
488 { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
489
490#define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
491
492INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
493
494typedef
495INTN
489(EFIAPI *EFI_UNICODE_STRICOLL) (
496(EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) (
490 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
491 IN CHAR16 *s1,
492 IN CHAR16 *s2
493 );
494
495typedef
496BOOLEAN
497 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
498 IN CHAR16 *s1,
499 IN CHAR16 *s2
500 );
501
502typedef
503BOOLEAN
497(EFIAPI *EFI_UNICODE_METAIMATCH) (
504(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) (
498 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
499 IN CHAR16 *String,
500 IN CHAR16 *Pattern
501 );
502
503typedef
504VOID
505 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
506 IN CHAR16 *String,
507 IN CHAR16 *Pattern
508 );
509
510typedef
511VOID
505(EFIAPI *EFI_UNICODE_STRLWR) (
512(EFIAPI *EFI_UNICODE_COLLATION_STRLWR) (
506 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
507 IN OUT CHAR16 *Str
508 );
509
510typedef
511VOID
513 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
514 IN OUT CHAR16 *Str
515 );
516
517typedef
518VOID
512(EFIAPI *EFI_UNICODE_STRUPR) (
519(EFIAPI *EFI_UNICODE_COLLATION_STRUPR) (
513 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
514 IN OUT CHAR16 *Str
515 );
516
517typedef
518VOID
520 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
521 IN OUT CHAR16 *Str
522 );
523
524typedef
525VOID
519(EFIAPI *EFI_UNICODE_FATTOSTR) (
526(EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) (
520 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
521 IN UINTN FatSize,
522 IN CHAR8 *Fat,
523 OUT CHAR16 *String
524 );
525
526typedef
527BOOLEAN
527 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
528 IN UINTN FatSize,
529 IN CHAR8 *Fat,
530 OUT CHAR16 *String
531 );
532
533typedef
534BOOLEAN
528(EFIAPI *EFI_UNICODE_STRTOFAT) (
535(EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) (
529 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
530 IN CHAR16 *String,
531 IN UINTN FatSize,
532 OUT CHAR8 *Fat
533 );
534
535
536typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
537
536 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
537 IN CHAR16 *String,
538 IN UINTN FatSize,
539 OUT CHAR8 *Fat
540 );
541
542
543typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
544
538 /* general */
539 EFI_UNICODE_STRICOLL StriColl;
540 EFI_UNICODE_METAIMATCH MetaiMatch;
541 EFI_UNICODE_STRLWR StrLwr;
542 EFI_UNICODE_STRUPR StrUpr;
545 // general
546 EFI_UNICODE_COLLATION_STRICOLL StriColl;
547 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;
548 EFI_UNICODE_COLLATION_STRLWR StrLwr;
549 EFI_UNICODE_COLLATION_STRUPR StrUpr;
543
550
544 /* for supporting fat volumes */
545 EFI_UNICODE_FATTOSTR FatToStr;
546 EFI_UNICODE_STRTOFAT StrToFat;
551 // for supporting fat volumes
552 EFI_UNICODE_COLLATION_FATTOSTR FatToStr;
553 EFI_UNICODE_COLLATION_STRTOFAT StrToFat;
547
548 CHAR8 *SupportedLanguages;
549} EFI_UNICODE_COLLATION_INTERFACE;
550
551#endif
554
555 CHAR8 *SupportedLanguages;
556} EFI_UNICODE_COLLATION_INTERFACE;
557
558#endif