2 * $FreeBSD: src/sys/boot/efi/include/efiprot.h,v 1.3 2002/05/19 03:17:20 marcel Exp $
3 * $DragonFly: src/sys/boot/efi/include/efiprot.h,v 1.1 2003/11/10 06:08:32 dillon Exp $
10 Copyright (c) 1998 Intel Corporation
27 * Device Path protocol
30 #define DEVICE_PATH_PROTOCOL \
31 { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
38 #define BLOCK_IO_PROTOCOL \
39 { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
40 #define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000
42 INTERFACE_DECL(_EFI_BLOCK_IO);
46 (EFIAPI *EFI_BLOCK_RESET) (
47 IN struct _EFI_BLOCK_IO *This,
48 IN BOOLEAN ExtendedVerification
53 (EFIAPI *EFI_BLOCK_READ) (
54 IN struct _EFI_BLOCK_IO *This,
64 (EFIAPI *EFI_BLOCK_WRITE) (
65 IN struct _EFI_BLOCK_IO *This,
75 (EFIAPI *EFI_BLOCK_FLUSH) (
76 IN struct _EFI_BLOCK_IO *This
83 BOOLEAN RemovableMedia;
86 BOOLEAN LogicalPartition;
96 typedef struct _EFI_BLOCK_IO {
99 EFI_BLOCK_IO_MEDIA *Media;
101 EFI_BLOCK_RESET Reset;
102 EFI_BLOCK_READ ReadBlocks;
103 EFI_BLOCK_WRITE WriteBlocks;
104 EFI_BLOCK_FLUSH FlushBlocks;
111 * Disk Block IO protocol
114 #define DISK_IO_PROTOCOL \
115 { 0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
116 #define EFI_DISK_IO_INTERFACE_REVISION 0x00010000
118 INTERFACE_DECL(_EFI_DISK_IO);
122 (EFIAPI *EFI_DISK_READ) (
123 IN struct _EFI_DISK_IO *This,
133 (EFIAPI *EFI_DISK_WRITE) (
134 IN struct _EFI_DISK_IO *This,
142 typedef struct _EFI_DISK_IO {
144 EFI_DISK_READ ReadDisk;
145 EFI_DISK_WRITE WriteDisk;
150 * Simple filesystem protocol
153 #define SIMPLE_FILE_SYSTEM_PROTOCOL \
154 { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
156 INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
157 INTERFACE_DECL(_EFI_FILE_HANDLE);
161 (EFIAPI *EFI_VOLUME_OPEN) (
162 IN struct _EFI_FILE_IO_INTERFACE *This,
163 OUT struct _EFI_FILE_HANDLE **Root
166 #define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
168 typedef struct _EFI_FILE_IO_INTERFACE {
170 EFI_VOLUME_OPEN OpenVolume;
171 } EFI_FILE_IO_INTERFACE;
175 (EFIAPI *EFI_FILE_OPEN) (
176 IN struct _EFI_FILE_HANDLE *File,
177 OUT struct _EFI_FILE_HANDLE **NewHandle,
184 #define EFI_FILE_MODE_READ 0x0000000000000001
185 #define EFI_FILE_MODE_WRITE 0x0000000000000002
186 #define EFI_FILE_MODE_CREATE 0x8000000000000000
188 /* File attributes */
189 #define EFI_FILE_READ_ONLY 0x0000000000000001
190 #define EFI_FILE_HIDDEN 0x0000000000000002
191 #define EFI_FILE_SYSTEM 0x0000000000000004
192 #define EFI_FILE_RESERVIED 0x0000000000000008
193 #define EFI_FILE_DIRECTORY 0x0000000000000010
194 #define EFI_FILE_ARCHIVE 0x0000000000000020
195 #define EFI_FILE_VALID_ATTR 0x0000000000000037
199 (EFIAPI *EFI_FILE_CLOSE) (
200 IN struct _EFI_FILE_HANDLE *File
205 (EFIAPI *EFI_FILE_DELETE) (
206 IN struct _EFI_FILE_HANDLE *File
211 (EFIAPI *EFI_FILE_READ) (
212 IN struct _EFI_FILE_HANDLE *File,
213 IN OUT UINTN *BufferSize,
219 (EFIAPI *EFI_FILE_WRITE) (
220 IN struct _EFI_FILE_HANDLE *File,
221 IN OUT UINTN *BufferSize,
227 (EFIAPI *EFI_FILE_SET_POSITION) (
228 IN struct _EFI_FILE_HANDLE *File,
234 (EFIAPI *EFI_FILE_GET_POSITION) (
235 IN struct _EFI_FILE_HANDLE *File,
241 (EFIAPI *EFI_FILE_GET_INFO) (
242 IN struct _EFI_FILE_HANDLE *File,
243 IN EFI_GUID *InformationType,
244 IN OUT UINTN *BufferSize,
250 (EFIAPI *EFI_FILE_SET_INFO) (
251 IN struct _EFI_FILE_HANDLE *File,
252 IN EFI_GUID *InformationType,
259 (EFIAPI *EFI_FILE_FLUSH) (
260 IN struct _EFI_FILE_HANDLE *File
265 #define EFI_FILE_HANDLE_REVISION 0x00010000
266 typedef struct _EFI_FILE_HANDLE {
269 EFI_FILE_CLOSE Close;
270 EFI_FILE_DELETE Delete;
272 EFI_FILE_WRITE Write;
273 EFI_FILE_GET_POSITION GetPosition;
274 EFI_FILE_SET_POSITION SetPosition;
275 EFI_FILE_GET_INFO GetInfo;
276 EFI_FILE_SET_INFO SetInfo;
277 EFI_FILE_FLUSH Flush;
278 } EFI_FILE, *EFI_FILE_HANDLE;
282 * File information types
285 #define EFI_FILE_INFO_ID \
286 { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
293 EFI_TIME LastAccessTime;
294 EFI_TIME ModificationTime;
300 * The FileName field of the EFI_FILE_INFO data structure is variable length.
301 * Whenever code needs to know the size of the EFI_FILE_INFO data structure,
302 * it needs to be the size of the data structure without the FileName field.
303 * The following macro computes this size correctly no matter how big the
304 * FileName array is declared. This is required to make the EFI_FILE_INFO
305 * data structure ANSI compliant.
308 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
310 #define EFI_FILE_SYSTEM_INFO_ID \
311 { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
319 CHAR16 VolumeLabel[1];
320 } EFI_FILE_SYSTEM_INFO;
323 * The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is
324 * variable length. Whenever code needs to know the size of the
325 * EFI_FILE_SYSTEM_INFO data structure, it needs to be the size of the data
326 * structure without the VolumeLable field. The following macro computes
327 * this size correctly no matter how big the VolumeLable array is declared.
328 * This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI
332 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
334 #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
335 { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
338 CHAR16 VolumeLabel[1];
339 } EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
341 #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
347 #define LOAD_FILE_PROTOCOL \
348 { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
350 INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
354 (EFIAPI *EFI_LOAD_FILE) (
355 IN struct _EFI_LOAD_FILE_INTERFACE *This,
356 IN EFI_DEVICE_PATH *FilePath,
357 IN BOOLEAN BootPolicy,
358 IN OUT UINTN *BufferSize,
359 IN VOID *Buffer OPTIONAL
362 typedef struct _EFI_LOAD_FILE_INTERFACE {
363 EFI_LOAD_FILE LoadFile;
364 } EFI_LOAD_FILE_INTERFACE;
371 #define DEVICE_IO_PROTOCOL \
372 { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
374 INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
382 * Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to
391 #define EFI_PCI_ADDRESS(_bus,_dev,_func) \
392 ( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) )
397 (EFIAPI *EFI_DEVICE_IO) (
398 IN struct _EFI_DEVICE_IO_INTERFACE *This,
399 IN EFI_IO_WIDTH Width,
412 (EFIAPI *EFI_PCI_DEVICE_PATH) (
413 IN struct _EFI_DEVICE_IO_INTERFACE *This,
415 IN OUT EFI_DEVICE_PATH **PciDevicePath
421 EfiBusMasterCommonBuffer
422 } EFI_IO_OPERATION_TYPE;
426 (EFIAPI *EFI_IO_MAP) (
427 IN struct _EFI_DEVICE_IO_INTERFACE *This,
428 IN EFI_IO_OPERATION_TYPE Operation,
429 IN EFI_PHYSICAL_ADDRESS *HostAddress,
430 IN OUT UINTN *NumberOfBytes,
431 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
437 (EFIAPI *EFI_IO_UNMAP) (
438 IN struct _EFI_DEVICE_IO_INTERFACE *This,
444 (EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
445 IN struct _EFI_DEVICE_IO_INTERFACE *This,
446 IN EFI_ALLOCATE_TYPE Type,
447 IN EFI_MEMORY_TYPE MemoryType,
449 IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
454 (EFIAPI *EFI_IO_FLUSH) (
455 IN struct _EFI_DEVICE_IO_INTERFACE *This
460 (EFIAPI *EFI_IO_FREE_BUFFER) (
461 IN struct _EFI_DEVICE_IO_INTERFACE *This,
463 IN EFI_PHYSICAL_ADDRESS HostAddress
466 typedef struct _EFI_DEVICE_IO_INTERFACE {
471 EFI_PCI_DEVICE_PATH PciDevicePath;
473 EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
475 EFI_IO_FREE_BUFFER FreeBuffer;
476 } EFI_DEVICE_IO_INTERFACE;
480 * Unicode Collation protocol
483 #define UNICODE_COLLATION_PROTOCOL \
484 { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
486 #define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
488 INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
492 (EFIAPI *EFI_UNICODE_STRICOLL) (
493 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
500 (EFIAPI *EFI_UNICODE_METAIMATCH) (
501 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
508 (EFIAPI *EFI_UNICODE_STRLWR) (
509 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
515 (EFIAPI *EFI_UNICODE_STRUPR) (
516 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
522 (EFIAPI *EFI_UNICODE_FATTOSTR) (
523 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
531 (EFIAPI *EFI_UNICODE_STRTOFAT) (
532 IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
539 typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
542 EFI_UNICODE_STRICOLL StriColl;
543 EFI_UNICODE_METAIMATCH MetaiMatch;
544 EFI_UNICODE_STRLWR StrLwr;
545 EFI_UNICODE_STRUPR StrUpr;
547 /* for supporting fat volumes */
548 EFI_UNICODE_FATTOSTR FatToStr;
549 EFI_UNICODE_STRTOFAT StrToFat;
551 CHAR8 *SupportedLanguages;
552 } EFI_UNICODE_COLLATION_INTERFACE;