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
33 // Device Path protocol
36 #define DEVICE_PATH_PROTOCOL \
37 { 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
44 #define BLOCK_IO_PROTOCOL \
45 { 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
46 #define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000
48 INTERFACE_DECL(_EFI_BLOCK_IO);
52 (EFIAPI *EFI_BLOCK_RESET) (
53 IN struct _EFI_BLOCK_IO *This,
54 IN BOOLEAN ExtendedVerification
59 (EFIAPI *EFI_BLOCK_READ) (
60 IN struct _EFI_BLOCK_IO *This,
70 (EFIAPI *EFI_BLOCK_WRITE) (
71 IN struct _EFI_BLOCK_IO *This,
81 (EFIAPI *EFI_BLOCK_FLUSH) (
82 IN struct _EFI_BLOCK_IO *This
89 BOOLEAN RemovableMedia;
92 BOOLEAN LogicalPartition;
100 } EFI_BLOCK_IO_MEDIA;
102 typedef struct _EFI_BLOCK_IO {
105 EFI_BLOCK_IO_MEDIA *Media;
107 EFI_BLOCK_RESET Reset;
108 EFI_BLOCK_READ ReadBlocks;
109 EFI_BLOCK_WRITE WriteBlocks;
110 EFI_BLOCK_FLUSH FlushBlocks;
117 // Disk Block IO protocol
120 #define DISK_IO_PROTOCOL \
121 { 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
122 #define EFI_DISK_IO_INTERFACE_REVISION 0x00010000
124 INTERFACE_DECL(_EFI_DISK_IO);
128 (EFIAPI *EFI_DISK_READ) (
129 IN struct _EFI_DISK_IO *This,
139 (EFIAPI *EFI_DISK_WRITE) (
140 IN struct _EFI_DISK_IO *This,
148 typedef struct _EFI_DISK_IO {
150 EFI_DISK_READ ReadDisk;
151 EFI_DISK_WRITE WriteDisk;
156 // Simple file system protocol
159 #define SIMPLE_FILE_SYSTEM_PROTOCOL \
160 { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
162 INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
163 INTERFACE_DECL(_EFI_FILE_HANDLE);
167 (EFIAPI *EFI_VOLUME_OPEN) (
168 IN struct _EFI_FILE_IO_INTERFACE *This,
169 OUT struct _EFI_FILE_HANDLE **Root
172 #define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
174 typedef struct _EFI_FILE_IO_INTERFACE {
176 EFI_VOLUME_OPEN OpenVolume;
177 } EFI_FILE_IO_INTERFACE;
185 (EFIAPI *EFI_FILE_OPEN) (
186 IN struct _EFI_FILE_HANDLE *File,
187 OUT struct _EFI_FILE_HANDLE **NewHandle,
194 #define EFI_FILE_MODE_READ 0x0000000000000001
195 #define EFI_FILE_MODE_WRITE 0x0000000000000002
196 #define EFI_FILE_MODE_CREATE 0x8000000000000000
199 #define EFI_FILE_READ_ONLY 0x0000000000000001
200 #define EFI_FILE_HIDDEN 0x0000000000000002
201 #define EFI_FILE_SYSTEM 0x0000000000000004
202 #define EFI_FILE_RESERVIED 0x0000000000000008
203 #define EFI_FILE_DIRECTORY 0x0000000000000010
204 #define EFI_FILE_ARCHIVE 0x0000000000000020
205 #define EFI_FILE_VALID_ATTR 0x0000000000000037
209 (EFIAPI *EFI_FILE_CLOSE) (
210 IN struct _EFI_FILE_HANDLE *File
215 (EFIAPI *EFI_FILE_DELETE) (
216 IN struct _EFI_FILE_HANDLE *File
221 (EFIAPI *EFI_FILE_READ) (
222 IN struct _EFI_FILE_HANDLE *File,
223 IN OUT UINTN *BufferSize,
229 (EFIAPI *EFI_FILE_WRITE) (
230 IN struct _EFI_FILE_HANDLE *File,
231 IN OUT UINTN *BufferSize,
237 (EFIAPI *EFI_FILE_SET_POSITION) (
238 IN struct _EFI_FILE_HANDLE *File,
244 (EFIAPI *EFI_FILE_GET_POSITION) (
245 IN struct _EFI_FILE_HANDLE *File,
251 (EFIAPI *EFI_FILE_GET_INFO) (
252 IN struct _EFI_FILE_HANDLE *File,
253 IN EFI_GUID *InformationType,
254 IN OUT UINTN *BufferSize,
260 (EFIAPI *EFI_FILE_SET_INFO) (
261 IN struct _EFI_FILE_HANDLE *File,
262 IN EFI_GUID *InformationType,
269 (EFIAPI *EFI_FILE_FLUSH) (
270 IN struct _EFI_FILE_HANDLE *File
275 #define EFI_FILE_HANDLE_REVISION 0x00010000
276 typedef struct _EFI_FILE_HANDLE {
279 EFI_FILE_CLOSE Close;
280 EFI_FILE_DELETE Delete;
282 EFI_FILE_WRITE Write;
283 EFI_FILE_GET_POSITION GetPosition;
284 EFI_FILE_SET_POSITION SetPosition;
285 EFI_FILE_GET_INFO GetInfo;
286 EFI_FILE_SET_INFO SetInfo;
287 EFI_FILE_FLUSH Flush;
288 } EFI_FILE, *EFI_FILE_HANDLE;
292 // File information types
295 #define EFI_FILE_INFO_ID \
296 { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
303 EFI_TIME LastAccessTime;
304 EFI_TIME ModificationTime;
310 // The FileName field of the EFI_FILE_INFO data structure is variable length.
311 // Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
312 // be the size of the data structure without the FileName field. The following macro
313 // computes this size correctly no matter how big the FileName array is declared.
314 // This is required to make the EFI_FILE_INFO data structure ANSI compilant.
317 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
319 #define EFI_FILE_SYSTEM_INFO_ID \
320 { 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
328 CHAR16 VolumeLabel[1];
329 } EFI_FILE_SYSTEM_INFO;
332 // The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
333 // Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
334 // to be the size of the data structure without the VolumeLable field. The following macro
335 // computes this size correctly no matter how big the VolumeLable array is declared.
336 // This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
339 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
341 #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
342 { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
345 CHAR16 VolumeLabel[1];
346 } EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
348 #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
351 // Load file protocol
355 #define LOAD_FILE_PROTOCOL \
356 { 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
358 INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
362 (EFIAPI *EFI_LOAD_FILE) (
363 IN struct _EFI_LOAD_FILE_INTERFACE *This,
364 IN EFI_DEVICE_PATH *FilePath,
365 IN BOOLEAN BootPolicy,
366 IN OUT UINTN *BufferSize,
367 IN VOID *Buffer OPTIONAL
370 typedef struct _EFI_LOAD_FILE_INTERFACE {
371 EFI_LOAD_FILE LoadFile;
372 } EFI_LOAD_FILE_INTERFACE;
376 // Device IO protocol
379 #define DEVICE_IO_PROTOCOL \
380 { 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
382 INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
390 // Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO
398 #define EFI_PCI_ADDRESS(bus,dev,func,reg) \
399 ( (UINT64) ( (((UINTN)bus) << 24) + (((UINTN)dev) << 16) + (((UINTN)func) << 8) + ((UINTN)reg) ))
403 (EFIAPI *EFI_DEVICE_IO) (
404 IN struct _EFI_DEVICE_IO_INTERFACE *This,
405 IN EFI_IO_WIDTH Width,
418 (EFIAPI *EFI_PCI_DEVICE_PATH) (
419 IN struct _EFI_DEVICE_IO_INTERFACE *This,
421 IN OUT EFI_DEVICE_PATH **PciDevicePath
427 EfiBusMasterCommonBuffer
428 } EFI_IO_OPERATION_TYPE;
432 (EFIAPI *EFI_IO_MAP) (
433 IN struct _EFI_DEVICE_IO_INTERFACE *This,
434 IN EFI_IO_OPERATION_TYPE Operation,
435 IN EFI_PHYSICAL_ADDRESS *HostAddress,
436 IN OUT UINTN *NumberOfBytes,
437 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
443 (EFIAPI *EFI_IO_UNMAP) (
444 IN struct _EFI_DEVICE_IO_INTERFACE *This,
450 (EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
451 IN struct _EFI_DEVICE_IO_INTERFACE *This,
452 IN EFI_ALLOCATE_TYPE Type,
453 IN EFI_MEMORY_TYPE MemoryType,
455 IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
460 (EFIAPI *EFI_IO_FLUSH) (
461 IN struct _EFI_DEVICE_IO_INTERFACE *This
466 (EFIAPI *EFI_IO_FREE_BUFFER) (
467 IN struct _EFI_DEVICE_IO_INTERFACE *This,
469 IN EFI_PHYSICAL_ADDRESS HostAddress
472 typedef struct _EFI_DEVICE_IO_INTERFACE {
477 EFI_PCI_DEVICE_PATH PciDevicePath;
479 EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
481 EFI_IO_FREE_BUFFER FreeBuffer;
482 } EFI_DEVICE_IO_INTERFACE;
486 // Unicode Collation protocol
489 #define UNICODE_COLLATION_PROTOCOL \
490 { 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
492 #define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
494 INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
498 (EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) (
499 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
506 (EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) (
507 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
514 (EFIAPI *EFI_UNICODE_COLLATION_STRLWR) (
515 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
521 (EFIAPI *EFI_UNICODE_COLLATION_STRUPR) (
522 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
528 (EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) (
529 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
537 (EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) (
538 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
545 typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
548 EFI_UNICODE_COLLATION_STRICOLL StriColl;
549 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;
550 EFI_UNICODE_COLLATION_STRLWR StrLwr;
551 EFI_UNICODE_COLLATION_STRUPR StrUpr;
553 // for supporting fat volumes
554 EFI_UNICODE_COLLATION_FATTOSTR FatToStr;
555 EFI_UNICODE_COLLATION_STRTOFAT StrToFat;
557 CHAR8 *SupportedLanguages;
558 } EFI_UNICODE_COLLATION_INTERFACE;
561 // Driver Binding protocol
564 #define DRIVER_BINDING_PROTOCOL \
565 { 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0x0c, 0x09, 0x26, 0x1e, 0x9f, 0x71} }
567 INTERFACE_DECL(_EFI_DRIVER_BINDING);
571 (EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (
572 IN struct _EFI_DRIVER_BINDING *This,
573 IN EFI_HANDLE ControllerHandle,
574 IN EFI_DEVICE_PATH *RemainingPath
579 (EFIAPI *EFI_DRIVER_BINDING_START) (
580 IN struct _EFI_DRIVER_BINDING *This,
581 IN EFI_HANDLE ControllerHandle,
582 IN EFI_DEVICE_PATH *RemainingPath
587 (EFIAPI *EFI_DRIVER_BINDING_STOP) (
588 IN struct _EFI_DRIVER_BINDING *This,
589 IN EFI_HANDLE ControllerHandle,
590 IN UINTN NumberOfChildren,
591 IN EFI_HANDLE *ChildHandleBuffer
594 typedef struct _EFI_DRIVER_BINDING {
595 EFI_DRIVER_BINDING_SUPPORTED Supported;
596 EFI_DRIVER_BINDING_START Start;
597 EFI_DRIVER_BINDING_STOP Stop;
599 EFI_HANDLE ImageHandle;
600 EFI_HANDLE DriverBindingHandle;
601 } EFI_DRIVER_BINDING;
604 // Component Name Protocol 2
607 #define COMPONENT_NAME2_PROTOCOL \
608 { 0x6a7a5cff, 0xe8d9, 0x4f70, {0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 } }
610 INTERFACE_DECL(_EFI_COMPONENT_NAME2);
614 (EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) (
615 IN struct _EFI_COMPONENT_NAME2 *This,
617 OUT CHAR16 **DriverName
622 (EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) (
623 IN struct _EFI_COMPONENT_NAME2 *This,
624 IN EFI_HANDLE ControllerHandle,
625 IN EFI_HANDLE ChildHandle OPTIONAL,
627 OUT CHAR16 **ControllerName
630 typedef struct _EFI_COMPONENT_NAME2 {
631 EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName;
632 EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName;
633 CHAR8 **SupportedLanguages;
634 } EFI_COMPONENT_NAME2;