7 Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
8 This software and associated documentation (if any) is furnished
9 under a license and may only be used or copied in accordance
10 with the terms of the license. Except as permitted by such
11 license, no part of this software or documentation may be
12 reproduced, stored in a retrieval system, or transmitted in any
13 form or by any means without the express written consent of
31 // Device Path protocol
34 #define DEVICE_PATH_PROTOCOL \
35 { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
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
46 INTERFACE_DECL(_EFI_BLOCK_IO);
50 (EFIAPI *EFI_BLOCK_RESET) (
51 IN struct _EFI_BLOCK_IO *This,
52 IN BOOLEAN ExtendedVerification
57 (EFIAPI *EFI_BLOCK_READ) (
58 IN struct _EFI_BLOCK_IO *This,
68 (EFIAPI *EFI_BLOCK_WRITE) (
69 IN struct _EFI_BLOCK_IO *This,
79 (EFIAPI *EFI_BLOCK_FLUSH) (
80 IN struct _EFI_BLOCK_IO *This
87 BOOLEAN RemovableMedia;
90 BOOLEAN LogicalPartition;
100 typedef struct _EFI_BLOCK_IO {
103 EFI_BLOCK_IO_MEDIA *Media;
105 EFI_BLOCK_RESET Reset;
106 EFI_BLOCK_READ ReadBlocks;
107 EFI_BLOCK_WRITE WriteBlocks;
108 EFI_BLOCK_FLUSH FlushBlocks;
115 // Disk Block IO protocol
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
122 INTERFACE_DECL(_EFI_DISK_IO);
126 (EFIAPI *EFI_DISK_READ) (
127 IN struct _EFI_DISK_IO *This,
137 (EFIAPI *EFI_DISK_WRITE) (
138 IN struct _EFI_DISK_IO *This,
146 typedef struct _EFI_DISK_IO {
148 EFI_DISK_READ ReadDisk;
149 EFI_DISK_WRITE WriteDisk;
154 // Simple file system protocol
157 #define SIMPLE_FILE_SYSTEM_PROTOCOL \
158 { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
160 INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
161 INTERFACE_DECL(_EFI_FILE_HANDLE);
165 (EFIAPI *EFI_VOLUME_OPEN) (
166 IN struct _EFI_FILE_IO_INTERFACE *This,
167 OUT struct _EFI_FILE_HANDLE **Root
170 #define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
172 typedef struct _EFI_FILE_IO_INTERFACE {
174 EFI_VOLUME_OPEN OpenVolume;
175 } EFI_FILE_IO_INTERFACE;
183 (EFIAPI *EFI_FILE_OPEN) (
184 IN struct _EFI_FILE_HANDLE *File,
185 OUT struct _EFI_FILE_HANDLE **NewHandle,
192 #define EFI_FILE_MODE_READ 0x0000000000000001
193 #define EFI_FILE_MODE_WRITE 0x0000000000000002
194 #define EFI_FILE_MODE_CREATE 0x8000000000000000
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
207 (EFIAPI *EFI_FILE_CLOSE) (
208 IN struct _EFI_FILE_HANDLE *File
213 (EFIAPI *EFI_FILE_DELETE) (
214 IN struct _EFI_FILE_HANDLE *File
219 (EFIAPI *EFI_FILE_READ) (
220 IN struct _EFI_FILE_HANDLE *File,
221 IN OUT UINTN *BufferSize,
227 (EFIAPI *EFI_FILE_WRITE) (
228 IN struct _EFI_FILE_HANDLE *File,
229 IN OUT UINTN *BufferSize,
235 (EFIAPI *EFI_FILE_SET_POSITION) (
236 IN struct _EFI_FILE_HANDLE *File,
242 (EFIAPI *EFI_FILE_GET_POSITION) (
243 IN struct _EFI_FILE_HANDLE *File,
249 (EFIAPI *EFI_FILE_GET_INFO) (
250 IN struct _EFI_FILE_HANDLE *File,
251 IN EFI_GUID *InformationType,
252 IN OUT UINTN *BufferSize,
258 (EFIAPI *EFI_FILE_SET_INFO) (
259 IN struct _EFI_FILE_HANDLE *File,
260 IN EFI_GUID *InformationType,
267 (EFIAPI *EFI_FILE_FLUSH) (
268 IN struct _EFI_FILE_HANDLE *File
273 #define EFI_FILE_HANDLE_REVISION 0x00010000
274 typedef struct _EFI_FILE_HANDLE {
277 EFI_FILE_CLOSE Close;
278 EFI_FILE_DELETE Delete;
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;
290 // File information types
293 #define EFI_FILE_INFO_ID \
294 { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
301 EFI_TIME LastAccessTime;
302 EFI_TIME ModificationTime;
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.
315 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
317 #define EFI_FILE_SYSTEM_INFO_ID \
318 { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
326 CHAR16 VolumeLabel[1];
327 } EFI_FILE_SYSTEM_INFO;
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.
337 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
339 #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
340 { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
343 CHAR16 VolumeLabel[1];
344 } EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
346 #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
349 // Load file protocol
353 #define LOAD_FILE_PROTOCOL \
354 { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
356 INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
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
368 typedef struct _EFI_LOAD_FILE_INTERFACE {
369 EFI_LOAD_FILE LoadFile;
370 } EFI_LOAD_FILE_INTERFACE;
374 // Device IO protocol
377 #define DEVICE_IO_PROTOCOL \
378 { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
380 INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
388 // Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO
396 #define EFI_PCI_ADDRESS(bus,dev,func,reg) \
397 ( (UINT64) ( (((UINTN)bus) << 24) + (((UINTN)dev) << 16) + (((UINTN)func) << 8) + ((UINTN)reg) ))
401 (EFIAPI *EFI_DEVICE_IO) (
402 IN struct _EFI_DEVICE_IO_INTERFACE *This,
403 IN EFI_IO_WIDTH Width,
416 (EFIAPI *EFI_PCI_DEVICE_PATH) (
417 IN struct _EFI_DEVICE_IO_INTERFACE *This,
419 IN OUT EFI_DEVICE_PATH **PciDevicePath
425 EfiBusMasterCommonBuffer
426 } EFI_IO_OPERATION_TYPE;
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,
441 (EFIAPI *EFI_IO_UNMAP) (
442 IN struct _EFI_DEVICE_IO_INTERFACE *This,
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,
453 IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
458 (EFIAPI *EFI_IO_FLUSH) (
459 IN struct _EFI_DEVICE_IO_INTERFACE *This
464 (EFIAPI *EFI_IO_FREE_BUFFER) (
465 IN struct _EFI_DEVICE_IO_INTERFACE *This,
467 IN EFI_PHYSICAL_ADDRESS HostAddress
470 typedef struct _EFI_DEVICE_IO_INTERFACE {
475 EFI_PCI_DEVICE_PATH PciDevicePath;
477 EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
479 EFI_IO_FREE_BUFFER FreeBuffer;
480 } EFI_DEVICE_IO_INTERFACE;
484 // Unicode Collation protocol
487 #define UNICODE_COLLATION_PROTOCOL \
488 { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
490 #define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
492 INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
496 (EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) (
497 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
504 (EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) (
505 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
512 (EFIAPI *EFI_UNICODE_COLLATION_STRLWR) (
513 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
519 (EFIAPI *EFI_UNICODE_COLLATION_STRUPR) (
520 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
526 (EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) (
527 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
535 (EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) (
536 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
543 typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
546 EFI_UNICODE_COLLATION_STRICOLL StriColl;
547 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;
548 EFI_UNICODE_COLLATION_STRLWR StrLwr;
549 EFI_UNICODE_COLLATION_STRUPR StrUpr;
551 // for supporting fat volumes
552 EFI_UNICODE_COLLATION_FATTOSTR FatToStr;
553 EFI_UNICODE_COLLATION_STRTOFAT StrToFat;
555 CHAR8 *SupportedLanguages;
556 } EFI_UNICODE_COLLATION_INTERFACE;