7 Copyright (c) 1998 Intel Corporation
24 * Device Path protocol
27 #define DEVICE_PATH_PROTOCOL \
28 { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
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
39 INTERFACE_DECL(_EFI_BLOCK_IO);
43 (EFIAPI *EFI_BLOCK_RESET) (
44 IN struct _EFI_BLOCK_IO *This,
45 IN BOOLEAN ExtendedVerification
50 (EFIAPI *EFI_BLOCK_READ) (
51 IN struct _EFI_BLOCK_IO *This,
61 (EFIAPI *EFI_BLOCK_WRITE) (
62 IN struct _EFI_BLOCK_IO *This,
72 (EFIAPI *EFI_BLOCK_FLUSH) (
73 IN struct _EFI_BLOCK_IO *This
80 BOOLEAN RemovableMedia;
83 BOOLEAN LogicalPartition;
93 typedef struct _EFI_BLOCK_IO {
96 EFI_BLOCK_IO_MEDIA *Media;
98 EFI_BLOCK_RESET Reset;
99 EFI_BLOCK_READ ReadBlocks;
100 EFI_BLOCK_WRITE WriteBlocks;
101 EFI_BLOCK_FLUSH FlushBlocks;
108 * Disk Block IO protocol
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
115 INTERFACE_DECL(_EFI_DISK_IO);
119 (EFIAPI *EFI_DISK_READ) (
120 IN struct _EFI_DISK_IO *This,
130 (EFIAPI *EFI_DISK_WRITE) (
131 IN struct _EFI_DISK_IO *This,
139 typedef struct _EFI_DISK_IO {
141 EFI_DISK_READ ReadDisk;
142 EFI_DISK_WRITE WriteDisk;
147 * Simple filesystem protocol
150 #define SIMPLE_FILE_SYSTEM_PROTOCOL \
151 { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
153 INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
154 INTERFACE_DECL(_EFI_FILE_HANDLE);
158 (EFIAPI *EFI_VOLUME_OPEN) (
159 IN struct _EFI_FILE_IO_INTERFACE *This,
160 OUT struct _EFI_FILE_HANDLE **Root
163 #define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
165 typedef struct _EFI_FILE_IO_INTERFACE {
167 EFI_VOLUME_OPEN OpenVolume;
168 } EFI_FILE_IO_INTERFACE;
172 (EFIAPI *EFI_FILE_OPEN) (
173 IN struct _EFI_FILE_HANDLE *File,
174 OUT struct _EFI_FILE_HANDLE **NewHandle,
181 #define EFI_FILE_MODE_READ 0x0000000000000001
182 #define EFI_FILE_MODE_WRITE 0x0000000000000002
183 #define EFI_FILE_MODE_CREATE 0x8000000000000000
185 /* 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
196 (EFIAPI *EFI_FILE_CLOSE) (
197 IN struct _EFI_FILE_HANDLE *File
202 (EFIAPI *EFI_FILE_DELETE) (
203 IN struct _EFI_FILE_HANDLE *File
208 (EFIAPI *EFI_FILE_READ) (
209 IN struct _EFI_FILE_HANDLE *File,
210 IN OUT UINTN *BufferSize,
216 (EFIAPI *EFI_FILE_WRITE) (
217 IN struct _EFI_FILE_HANDLE *File,
218 IN OUT UINTN *BufferSize,
224 (EFIAPI *EFI_FILE_SET_POSITION) (
225 IN struct _EFI_FILE_HANDLE *File,
231 (EFIAPI *EFI_FILE_GET_POSITION) (
232 IN struct _EFI_FILE_HANDLE *File,
238 (EFIAPI *EFI_FILE_GET_INFO) (
239 IN struct _EFI_FILE_HANDLE *File,
240 IN EFI_GUID *InformationType,
241 IN OUT UINTN *BufferSize,
247 (EFIAPI *EFI_FILE_SET_INFO) (
248 IN struct _EFI_FILE_HANDLE *File,
249 IN EFI_GUID *InformationType,
256 (EFIAPI *EFI_FILE_FLUSH) (
257 IN struct _EFI_FILE_HANDLE *File
262 #define EFI_FILE_HANDLE_REVISION 0x00010000
263 typedef struct _EFI_FILE_HANDLE {
266 EFI_FILE_CLOSE Close;
267 EFI_FILE_DELETE Delete;
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;
279 * File information types
282 #define EFI_FILE_INFO_ID \
283 { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
290 EFI_TIME LastAccessTime;
291 EFI_TIME ModificationTime;
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.
305 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
307 #define EFI_FILE_SYSTEM_INFO_ID \
308 { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
316 CHAR16 VolumeLabel[1];
317 } EFI_FILE_SYSTEM_INFO;
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
329 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
331 #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
332 { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
335 CHAR16 VolumeLabel[1];
336 } EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
338 #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
344 #define LOAD_FILE_PROTOCOL \
345 { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
347 INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
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
359 typedef struct _EFI_LOAD_FILE_INTERFACE {
360 EFI_LOAD_FILE LoadFile;
361 } EFI_LOAD_FILE_INTERFACE;
368 #define DEVICE_IO_PROTOCOL \
369 { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
371 INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
379 * Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to
388 #define EFI_PCI_ADDRESS(_bus,_dev,_func) \
389 ( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) )
394 (EFIAPI *EFI_DEVICE_IO) (
395 IN struct _EFI_DEVICE_IO_INTERFACE *This,
396 IN EFI_IO_WIDTH Width,
409 (EFIAPI *EFI_PCI_DEVICE_PATH) (
410 IN struct _EFI_DEVICE_IO_INTERFACE *This,
412 IN OUT EFI_DEVICE_PATH **PciDevicePath
418 EfiBusMasterCommonBuffer
419 } EFI_IO_OPERATION_TYPE;
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,
434 (EFIAPI *EFI_IO_UNMAP) (
435 IN struct _EFI_DEVICE_IO_INTERFACE *This,
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,
446 IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
451 (EFIAPI *EFI_IO_FLUSH) (
452 IN struct _EFI_DEVICE_IO_INTERFACE *This
457 (EFIAPI *EFI_IO_FREE_BUFFER) (
458 IN struct _EFI_DEVICE_IO_INTERFACE *This,
460 IN EFI_PHYSICAL_ADDRESS HostAddress
463 typedef struct _EFI_DEVICE_IO_INTERFACE {
468 EFI_PCI_DEVICE_PATH PciDevicePath;
470 EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
472 EFI_IO_FREE_BUFFER FreeBuffer;
473 } EFI_DEVICE_IO_INTERFACE;
477 * Unicode Collation protocol
480 #define UNICODE_COLLATION_PROTOCOL \
481 { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
483 #define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
485 INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
489 (EFIAPI *EFI_UNICODE_STRICOLL) (
490 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
497 (EFIAPI *EFI_UNICODE_METAIMATCH) (
498 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
505 (EFIAPI *EFI_UNICODE_STRLWR) (
506 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
512 (EFIAPI *EFI_UNICODE_STRUPR) (
513 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
519 (EFIAPI *EFI_UNICODE_FATTOSTR) (
520 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
528 (EFIAPI *EFI_UNICODE_STRTOFAT) (
529 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
536 typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
539 EFI_UNICODE_STRICOLL StriColl;
540 EFI_UNICODE_METAIMATCH MetaiMatch;
541 EFI_UNICODE_STRLWR StrLwr;
542 EFI_UNICODE_STRUPR StrUpr;
544 /* for supporting fat volumes */
545 EFI_UNICODE_FATTOSTR FatToStr;
546 EFI_UNICODE_STRTOFAT StrToFat;
548 CHAR8 *SupportedLanguages;
549 } EFI_UNICODE_COLLATION_INTERFACE;