6 Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
7 This software and associated documentation (if any) is furnished
8 under a license and may only be used or copied in accordance
9 with the terms of the license. Except as permitted by such
10 license, no part of this software or documentation may be
11 reproduced, stored in a retrieval system, or transmitted in any
12 form or by any means without the express written consent of
32 // Device Path protocol
35 #define DEVICE_PATH_PROTOCOL \
36 { 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
43 #define BLOCK_IO_PROTOCOL \
44 { 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
45 #define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000
47 INTERFACE_DECL(_EFI_BLOCK_IO);
51 (EFIAPI *EFI_BLOCK_RESET) (
52 IN struct _EFI_BLOCK_IO *This,
53 IN BOOLEAN ExtendedVerification
58 (EFIAPI *EFI_BLOCK_READ) (
59 IN struct _EFI_BLOCK_IO *This,
69 (EFIAPI *EFI_BLOCK_WRITE) (
70 IN struct _EFI_BLOCK_IO *This,
80 (EFIAPI *EFI_BLOCK_FLUSH) (
81 IN struct _EFI_BLOCK_IO *This
88 BOOLEAN RemovableMedia;
91 BOOLEAN LogicalPartition;
101 typedef struct _EFI_BLOCK_IO {
104 EFI_BLOCK_IO_MEDIA *Media;
106 EFI_BLOCK_RESET Reset;
107 EFI_BLOCK_READ ReadBlocks;
108 EFI_BLOCK_WRITE WriteBlocks;
109 EFI_BLOCK_FLUSH FlushBlocks;
116 // Disk Block IO protocol
119 #define DISK_IO_PROTOCOL \
120 { 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
121 #define EFI_DISK_IO_INTERFACE_REVISION 0x00010000
123 INTERFACE_DECL(_EFI_DISK_IO);
127 (EFIAPI *EFI_DISK_READ) (
128 IN struct _EFI_DISK_IO *This,
138 (EFIAPI *EFI_DISK_WRITE) (
139 IN struct _EFI_DISK_IO *This,
147 typedef struct _EFI_DISK_IO {
149 EFI_DISK_READ ReadDisk;
150 EFI_DISK_WRITE WriteDisk;
155 // Simple file system protocol
158 #define SIMPLE_FILE_SYSTEM_PROTOCOL \
159 { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
161 INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
162 INTERFACE_DECL(_EFI_FILE_HANDLE);
166 (EFIAPI *EFI_VOLUME_OPEN) (
167 IN struct _EFI_FILE_IO_INTERFACE *This,
168 OUT struct _EFI_FILE_HANDLE **Root
171 #define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
173 typedef struct _EFI_FILE_IO_INTERFACE {
175 EFI_VOLUME_OPEN OpenVolume;
176 } EFI_FILE_IO_INTERFACE;
184 (EFIAPI *EFI_FILE_OPEN) (
185 IN struct _EFI_FILE_HANDLE *File,
186 OUT struct _EFI_FILE_HANDLE **NewHandle,
193 #define EFI_FILE_MODE_READ 0x0000000000000001
194 #define EFI_FILE_MODE_WRITE 0x0000000000000002
195 #define EFI_FILE_MODE_CREATE 0x8000000000000000
198 #define EFI_FILE_READ_ONLY 0x0000000000000001
199 #define EFI_FILE_HIDDEN 0x0000000000000002
200 #define EFI_FILE_SYSTEM 0x0000000000000004
201 #define EFI_FILE_RESERVIED 0x0000000000000008
202 #define EFI_FILE_DIRECTORY 0x0000000000000010
203 #define EFI_FILE_ARCHIVE 0x0000000000000020
204 #define EFI_FILE_VALID_ATTR 0x0000000000000037
208 (EFIAPI *EFI_FILE_CLOSE) (
209 IN struct _EFI_FILE_HANDLE *File
214 (EFIAPI *EFI_FILE_DELETE) (
215 IN struct _EFI_FILE_HANDLE *File
220 (EFIAPI *EFI_FILE_READ) (
221 IN struct _EFI_FILE_HANDLE *File,
222 IN OUT UINTN *BufferSize,
228 (EFIAPI *EFI_FILE_WRITE) (
229 IN struct _EFI_FILE_HANDLE *File,
230 IN OUT UINTN *BufferSize,
236 (EFIAPI *EFI_FILE_SET_POSITION) (
237 IN struct _EFI_FILE_HANDLE *File,
243 (EFIAPI *EFI_FILE_GET_POSITION) (
244 IN struct _EFI_FILE_HANDLE *File,
250 (EFIAPI *EFI_FILE_GET_INFO) (
251 IN struct _EFI_FILE_HANDLE *File,
252 IN EFI_GUID *InformationType,
253 IN OUT UINTN *BufferSize,
259 (EFIAPI *EFI_FILE_SET_INFO) (
260 IN struct _EFI_FILE_HANDLE *File,
261 IN EFI_GUID *InformationType,
268 (EFIAPI *EFI_FILE_FLUSH) (
269 IN struct _EFI_FILE_HANDLE *File
274 #define EFI_FILE_HANDLE_REVISION 0x00010000
275 typedef struct _EFI_FILE_HANDLE {
278 EFI_FILE_CLOSE Close;
279 EFI_FILE_DELETE Delete;
281 EFI_FILE_WRITE Write;
282 EFI_FILE_GET_POSITION GetPosition;
283 EFI_FILE_SET_POSITION SetPosition;
284 EFI_FILE_GET_INFO GetInfo;
285 EFI_FILE_SET_INFO SetInfo;
286 EFI_FILE_FLUSH Flush;
287 } EFI_FILE, *EFI_FILE_HANDLE;
291 // File information types
294 #define EFI_FILE_INFO_ID \
295 { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
302 EFI_TIME LastAccessTime;
303 EFI_TIME ModificationTime;
309 // The FileName field of the EFI_FILE_INFO data structure is variable length.
310 // Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
311 // be the size of the data structure without the FileName field. The following macro
312 // computes this size correctly no matter how big the FileName array is declared.
313 // This is required to make the EFI_FILE_INFO data structure ANSI compilant.
316 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
318 #define EFI_FILE_SYSTEM_INFO_ID \
319 { 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
327 CHAR16 VolumeLabel[1];
328 } EFI_FILE_SYSTEM_INFO;
331 // The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
332 // Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
333 // to be the size of the data structure without the VolumeLable field. The following macro
334 // computes this size correctly no matter how big the VolumeLable array is declared.
335 // This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
338 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
340 #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
341 { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
344 CHAR16 VolumeLabel[1];
345 } EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
347 #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
350 // Load file protocol
354 #define LOAD_FILE_PROTOCOL \
355 { 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
357 INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
361 (EFIAPI *EFI_LOAD_FILE) (
362 IN struct _EFI_LOAD_FILE_INTERFACE *This,
363 IN EFI_DEVICE_PATH *FilePath,
364 IN BOOLEAN BootPolicy,
365 IN OUT UINTN *BufferSize,
366 IN VOID *Buffer OPTIONAL
369 typedef struct _EFI_LOAD_FILE_INTERFACE {
370 EFI_LOAD_FILE LoadFile;
371 } EFI_LOAD_FILE_INTERFACE;
375 // Device IO protocol
378 #define DEVICE_IO_PROTOCOL \
379 { 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
381 INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
389 // Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO
397 #define EFI_PCI_ADDRESS(bus,dev,func,reg) \
398 ( (UINT64) ( (((UINTN)bus) << 24) + (((UINTN)dev) << 16) + (((UINTN)func) << 8) + ((UINTN)reg) ))
402 (EFIAPI *EFI_DEVICE_IO) (
403 IN struct _EFI_DEVICE_IO_INTERFACE *This,
404 IN EFI_IO_WIDTH Width,
417 (EFIAPI *EFI_PCI_DEVICE_PATH) (
418 IN struct _EFI_DEVICE_IO_INTERFACE *This,
420 IN OUT EFI_DEVICE_PATH **PciDevicePath
426 EfiBusMasterCommonBuffer
427 } EFI_IO_OPERATION_TYPE;
431 (EFIAPI *EFI_IO_MAP) (
432 IN struct _EFI_DEVICE_IO_INTERFACE *This,
433 IN EFI_IO_OPERATION_TYPE Operation,
434 IN EFI_PHYSICAL_ADDRESS *HostAddress,
435 IN OUT UINTN *NumberOfBytes,
436 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
442 (EFIAPI *EFI_IO_UNMAP) (
443 IN struct _EFI_DEVICE_IO_INTERFACE *This,
449 (EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
450 IN struct _EFI_DEVICE_IO_INTERFACE *This,
451 IN EFI_ALLOCATE_TYPE Type,
452 IN EFI_MEMORY_TYPE MemoryType,
454 IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
459 (EFIAPI *EFI_IO_FLUSH) (
460 IN struct _EFI_DEVICE_IO_INTERFACE *This
465 (EFIAPI *EFI_IO_FREE_BUFFER) (
466 IN struct _EFI_DEVICE_IO_INTERFACE *This,
468 IN EFI_PHYSICAL_ADDRESS HostAddress
471 typedef struct _EFI_DEVICE_IO_INTERFACE {
476 EFI_PCI_DEVICE_PATH PciDevicePath;
478 EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
480 EFI_IO_FREE_BUFFER FreeBuffer;
481 } EFI_DEVICE_IO_INTERFACE;
485 // Unicode Collation protocol
488 #define UNICODE_COLLATION_PROTOCOL \
489 { 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
491 #define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
493 INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
497 (EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) (
498 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
505 (EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) (
506 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
513 (EFIAPI *EFI_UNICODE_COLLATION_STRLWR) (
514 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
520 (EFIAPI *EFI_UNICODE_COLLATION_STRUPR) (
521 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
527 (EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) (
528 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
536 (EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) (
537 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
544 typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
547 EFI_UNICODE_COLLATION_STRICOLL StriColl;
548 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;
549 EFI_UNICODE_COLLATION_STRLWR StrLwr;
550 EFI_UNICODE_COLLATION_STRUPR StrUpr;
552 // for supporting fat volumes
553 EFI_UNICODE_COLLATION_FATTOSTR FatToStr;
554 EFI_UNICODE_COLLATION_STRTOFAT StrToFat;
556 CHAR8 *SupportedLanguages;
557 } EFI_UNICODE_COLLATION_INTERFACE;
560 // Driver Binding protocol
563 #define DRIVER_BINDING_PROTOCOL \
564 { 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0x0c, 0x09, 0x26, 0x1e, 0x9f, 0x71} }
566 INTERFACE_DECL(_EFI_DRIVER_BINDING);
570 (EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (
571 IN struct _EFI_DRIVER_BINDING *This,
572 IN EFI_HANDLE ControllerHandle,
573 IN EFI_DEVICE_PATH *RemainingPath
578 (EFIAPI *EFI_DRIVER_BINDING_START) (
579 IN struct _EFI_DRIVER_BINDING *This,
580 IN EFI_HANDLE ControllerHandle,
581 IN EFI_DEVICE_PATH *RemainingPath
586 (EFIAPI *EFI_DRIVER_BINDING_STOP) (
587 IN struct _EFI_DRIVER_BINDING *This,
588 IN EFI_HANDLE ControllerHandle,
589 IN UINTN NumberOfChildren,
590 IN EFI_HANDLE *ChildHandleBuffer
593 typedef struct _EFI_DRIVER_BINDING {
594 EFI_DRIVER_BINDING_SUPPORTED Supported;
595 EFI_DRIVER_BINDING_START Start;
596 EFI_DRIVER_BINDING_STOP Stop;
598 EFI_HANDLE ImageHandle;
599 EFI_HANDLE DriverBindingHandle;
600 } EFI_DRIVER_BINDING;
603 // Component Name Protocol 2
606 #define COMPONENT_NAME2_PROTOCOL \
607 { 0x6a7a5cff, 0xe8d9, 0x4f70, {0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 } }
609 INTERFACE_DECL(_EFI_COMPONENT_NAME2);
613 (EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) (
614 IN struct _EFI_COMPONENT_NAME2 *This,
616 OUT CHAR16 **DriverName
621 (EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) (
622 IN struct _EFI_COMPONENT_NAME2 *This,
623 IN EFI_HANDLE ControllerHandle,
624 IN EFI_HANDLE ChildHandle OPTIONAL,
626 OUT CHAR16 **ControllerName
629 typedef struct _EFI_COMPONENT_NAME2 {
630 EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName;
631 EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName;
632 CHAR8 **SupportedLanguages;
633 } EFI_COMPONENT_NAME2;