6
Copyright (c) 1998 Intel Corporation
23
// FPSWA library protocol
25
#define FPSWA_PROTOCOL \
26
{ 0xc41b6531, 0x97b9, 0x11d3, {0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
29
// Device Path protocol
32
#define DEVICE_PATH_PROTOCOL \
33
{ 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
40
#define BLOCK_IO_PROTOCOL \
41
{ 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
42
#define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000
44
INTERFACE_DECL(_EFI_BLOCK_IO);
48
(EFIAPI *EFI_BLOCK_RESET) (
49
IN struct _EFI_BLOCK_IO *This,
50
IN BOOLEAN ExtendedVerification
55
(EFIAPI *EFI_BLOCK_READ) (
56
IN struct _EFI_BLOCK_IO *This,
66
(EFIAPI *EFI_BLOCK_WRITE) (
67
IN struct _EFI_BLOCK_IO *This,
77
(EFIAPI *EFI_BLOCK_FLUSH) (
78
IN struct _EFI_BLOCK_IO *This
85
BOOLEAN RemovableMedia;
88
BOOLEAN LogicalPartition;
98
typedef struct _EFI_BLOCK_IO {
101
EFI_BLOCK_IO_MEDIA *Media;
103
EFI_BLOCK_RESET Reset;
104
EFI_BLOCK_READ ReadBlocks;
105
EFI_BLOCK_WRITE WriteBlocks;
106
EFI_BLOCK_FLUSH FlushBlocks;
113
// Disk Block IO protocol
116
#define DISK_IO_PROTOCOL \
117
{ 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
118
#define EFI_DISK_IO_INTERFACE_REVISION 0x00010000
120
INTERFACE_DECL(_EFI_DISK_IO);
124
(EFIAPI *EFI_DISK_READ) (
125
IN struct _EFI_DISK_IO *This,
135
(EFIAPI *EFI_DISK_WRITE) (
136
IN struct _EFI_DISK_IO *This,
144
typedef struct _EFI_DISK_IO {
146
EFI_DISK_READ ReadDisk;
147
EFI_DISK_WRITE WriteDisk;
152
// Simple file system protocol
155
#define SIMPLE_FILE_SYSTEM_PROTOCOL \
156
{ 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
158
INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
159
INTERFACE_DECL(_EFI_FILE_HANDLE);
163
(EFIAPI *EFI_VOLUME_OPEN) (
164
IN struct _EFI_FILE_IO_INTERFACE *This,
165
OUT struct _EFI_FILE_HANDLE **Root
168
#define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
170
typedef struct _EFI_FILE_IO_INTERFACE {
172
EFI_VOLUME_OPEN OpenVolume;
173
} EFI_FILE_IO_INTERFACE;
181
(EFIAPI *EFI_FILE_OPEN) (
182
IN struct _EFI_FILE_HANDLE *File,
183
OUT struct _EFI_FILE_HANDLE **NewHandle,
190
#define EFI_FILE_MODE_READ 0x0000000000000001
191
#define EFI_FILE_MODE_WRITE 0x0000000000000002
192
#define EFI_FILE_MODE_CREATE 0x8000000000000000
195
#define EFI_FILE_READ_ONLY 0x0000000000000001
196
#define EFI_FILE_HIDDEN 0x0000000000000002
197
#define EFI_FILE_SYSTEM 0x0000000000000004
198
#define EFI_FILE_RESERVIED 0x0000000000000008
199
#define EFI_FILE_DIRECTORY 0x0000000000000010
200
#define EFI_FILE_ARCHIVE 0x0000000000000020
201
#define EFI_FILE_VALID_ATTR 0x0000000000000037
205
(EFIAPI *EFI_FILE_CLOSE) (
206
IN struct _EFI_FILE_HANDLE *File
211
(EFIAPI *EFI_FILE_DELETE) (
212
IN struct _EFI_FILE_HANDLE *File
217
(EFIAPI *EFI_FILE_READ) (
218
IN struct _EFI_FILE_HANDLE *File,
219
IN OUT UINTN *BufferSize,
225
(EFIAPI *EFI_FILE_WRITE) (
226
IN struct _EFI_FILE_HANDLE *File,
227
IN OUT UINTN *BufferSize,
233
(EFIAPI *EFI_FILE_SET_POSITION) (
234
IN struct _EFI_FILE_HANDLE *File,
240
(EFIAPI *EFI_FILE_GET_POSITION) (
241
IN struct _EFI_FILE_HANDLE *File,
247
(EFIAPI *EFI_FILE_GET_INFO) (
248
IN struct _EFI_FILE_HANDLE *File,
249
IN EFI_GUID *InformationType,
250
IN OUT UINTN *BufferSize,
256
(EFIAPI *EFI_FILE_SET_INFO) (
257
IN struct _EFI_FILE_HANDLE *File,
258
IN EFI_GUID *InformationType,
265
(EFIAPI *EFI_FILE_FLUSH) (
266
IN struct _EFI_FILE_HANDLE *File
271
#define EFI_FILE_HANDLE_REVISION 0x00010000
272
typedef struct _EFI_FILE_HANDLE {
275
EFI_FILE_CLOSE Close;
276
EFI_FILE_DELETE Delete;
278
EFI_FILE_WRITE Write;
279
EFI_FILE_GET_POSITION GetPosition;
280
EFI_FILE_SET_POSITION SetPosition;
281
EFI_FILE_GET_INFO GetInfo;
282
EFI_FILE_SET_INFO SetInfo;
283
EFI_FILE_FLUSH Flush;
284
} EFI_FILE, *EFI_FILE_HANDLE;
288
// File information types
291
#define EFI_FILE_INFO_ID \
292
{ 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
299
EFI_TIME LastAccessTime;
300
EFI_TIME ModificationTime;
306
// The FileName field of the EFI_FILE_INFO data structure is variable length.
307
// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
308
// be the size of the data structure without the FileName field. The following macro
309
// computes this size correctly no matter how big the FileName array is declared.
310
// This is required to make the EFI_FILE_INFO data structure ANSI compilant.
313
#define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
315
#define EFI_FILE_SYSTEM_INFO_ID \
316
{ 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
324
CHAR16 VolumeLabel[1];
325
} EFI_FILE_SYSTEM_INFO;
328
// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
329
// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
330
// to be the size of the data structure without the VolumeLable field. The following macro
331
// computes this size correctly no matter how big the VolumeLable array is declared.
332
// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
335
#define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
337
#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
338
{ 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
341
CHAR16 VolumeLabel[1];
342
} EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
344
#define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
347
// Load file protocol
351
#define LOAD_FILE_PROTOCOL \
352
{ 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
354
INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
358
(EFIAPI *EFI_LOAD_FILE) (
359
IN struct _EFI_LOAD_FILE_INTERFACE *This,
360
IN EFI_DEVICE_PATH *FilePath,
361
IN BOOLEAN BootPolicy,
362
IN OUT UINTN *BufferSize,
363
IN VOID *Buffer OPTIONAL
366
typedef struct _EFI_LOAD_FILE_INTERFACE {
367
EFI_LOAD_FILE LoadFile;
368
} EFI_LOAD_FILE_INTERFACE;
372
// Device IO protocol
375
#define DEVICE_IO_PROTOCOL \
376
{ 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
378
INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
386
// Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO
394
#define EFI_PCI_ADDRESS(_bus,_dev,_func) \
395
( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) )
400
(EFIAPI *EFI_DEVICE_IO) (
401
IN struct _EFI_DEVICE_IO_INTERFACE *This,
402
IN EFI_IO_WIDTH Width,
415
(EFIAPI *EFI_PCI_DEVICE_PATH) (
416
IN struct _EFI_DEVICE_IO_INTERFACE *This,
418
IN OUT EFI_DEVICE_PATH **PciDevicePath
424
EfiBusMasterCommonBuffer
425
} EFI_IO_OPERATION_TYPE;
429
(EFIAPI *EFI_IO_MAP) (
430
IN struct _EFI_DEVICE_IO_INTERFACE *This,
431
IN EFI_IO_OPERATION_TYPE Operation,
432
IN EFI_PHYSICAL_ADDRESS *HostAddress,
433
IN OUT UINTN *NumberOfBytes,
434
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
440
(EFIAPI *EFI_IO_UNMAP) (
441
IN struct _EFI_DEVICE_IO_INTERFACE *This,
447
(EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
448
IN struct _EFI_DEVICE_IO_INTERFACE *This,
449
IN EFI_ALLOCATE_TYPE Type,
450
IN EFI_MEMORY_TYPE MemoryType,
452
IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
457
(EFIAPI *EFI_IO_FLUSH) (
458
IN struct _EFI_DEVICE_IO_INTERFACE *This
463
(EFIAPI *EFI_IO_FREE_BUFFER) (
464
IN struct _EFI_DEVICE_IO_INTERFACE *This,
466
IN EFI_PHYSICAL_ADDRESS HostAddress
469
typedef struct _EFI_DEVICE_IO_INTERFACE {
474
EFI_PCI_DEVICE_PATH PciDevicePath;
476
EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
478
EFI_IO_FREE_BUFFER FreeBuffer;
479
} EFI_DEVICE_IO_INTERFACE;
483
// Unicode Collation protocol
486
#define UNICODE_COLLATION_PROTOCOL \
487
{ 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
489
#define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
491
INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
495
(EFIAPI *EFI_UNICODE_STRICOLL) (
496
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
503
(EFIAPI *EFI_UNICODE_METAIMATCH) (
504
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
511
(EFIAPI *EFI_UNICODE_STRLWR) (
512
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
518
(EFIAPI *EFI_UNICODE_STRUPR) (
519
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
525
(EFIAPI *EFI_UNICODE_FATTOSTR) (
526
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
534
(EFIAPI *EFI_UNICODE_STRTOFAT) (
535
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
542
typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
545
EFI_UNICODE_STRICOLL StriColl;
546
EFI_UNICODE_METAIMATCH MetaiMatch;
547
EFI_UNICODE_STRLWR StrLwr;
548
EFI_UNICODE_STRUPR StrUpr;
550
// for supporting fat volumes
551
EFI_UNICODE_FATTOSTR FatToStr;
552
EFI_UNICODE_STRTOFAT StrToFat;
554
CHAR8 *SupportedLanguages;
555
} EFI_UNICODE_COLLATION_INTERFACE;