1 /* $NetBSD: efiprot.h,v 1.1 2006/04/07 14:21:29 cherry Exp $ */
2 /* $FreeBSD: src/sys/boot/efi/include/efiprot.h,v 1.3 2002/05/19 03:17:20 marcel Exp $ */
9 Copyright (c) 1998 Intel Corporation
26 * Device Path protocol
29 #define DEVICE_PATH_PROTOCOL \
30 { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
37 #define BLOCK_IO_PROTOCOL \
38 { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
39 #define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000
41 INTERFACE_DECL(_EFI_BLOCK_IO
);
45 (EFIAPI
*EFI_BLOCK_RESET
) (
46 IN
struct _EFI_BLOCK_IO
*This
,
47 IN BOOLEAN ExtendedVerification
52 (EFIAPI
*EFI_BLOCK_READ
) (
53 IN
struct _EFI_BLOCK_IO
*This
,
63 (EFIAPI
*EFI_BLOCK_WRITE
) (
64 IN
struct _EFI_BLOCK_IO
*This
,
74 (EFIAPI
*EFI_BLOCK_FLUSH
) (
75 IN
struct _EFI_BLOCK_IO
*This
82 BOOLEAN RemovableMedia
;
85 BOOLEAN LogicalPartition
;
95 typedef struct _EFI_BLOCK_IO
{
98 EFI_BLOCK_IO_MEDIA
*Media
;
100 EFI_BLOCK_RESET Reset
;
101 EFI_BLOCK_READ ReadBlocks
;
102 EFI_BLOCK_WRITE WriteBlocks
;
103 EFI_BLOCK_FLUSH FlushBlocks
;
110 * Disk Block IO protocol
113 #define DISK_IO_PROTOCOL \
114 { 0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
115 #define EFI_DISK_IO_INTERFACE_REVISION 0x00010000
117 INTERFACE_DECL(_EFI_DISK_IO
);
121 (EFIAPI
*EFI_DISK_READ
) (
122 IN
struct _EFI_DISK_IO
*This
,
132 (EFIAPI
*EFI_DISK_WRITE
) (
133 IN
struct _EFI_DISK_IO
*This
,
141 typedef struct _EFI_DISK_IO
{
143 EFI_DISK_READ ReadDisk
;
144 EFI_DISK_WRITE WriteDisk
;
149 * Simple filesystem protocol
152 #define SIMPLE_FILE_SYSTEM_PROTOCOL \
153 { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
155 INTERFACE_DECL(_EFI_FILE_IO_INTERFACE
);
156 INTERFACE_DECL(_EFI_FILE_HANDLE
);
160 (EFIAPI
*EFI_VOLUME_OPEN
) (
161 IN
struct _EFI_FILE_IO_INTERFACE
*This
,
162 OUT
struct _EFI_FILE_HANDLE
**Root
165 #define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
167 typedef struct _EFI_FILE_IO_INTERFACE
{
169 EFI_VOLUME_OPEN OpenVolume
;
170 } EFI_FILE_IO_INTERFACE
;
174 (EFIAPI
*EFI_FILE_OPEN
) (
175 IN
struct _EFI_FILE_HANDLE
*File
,
176 OUT
struct _EFI_FILE_HANDLE
**NewHandle
,
183 #define EFI_FILE_MODE_READ 0x0000000000000001
184 #define EFI_FILE_MODE_WRITE 0x0000000000000002
185 #define EFI_FILE_MODE_CREATE 0x8000000000000000
187 /* File attributes */
188 #define EFI_FILE_READ_ONLY 0x0000000000000001
189 #define EFI_FILE_HIDDEN 0x0000000000000002
190 #define EFI_FILE_SYSTEM 0x0000000000000004
191 #define EFI_FILE_RESERVIED 0x0000000000000008
192 #define EFI_FILE_DIRECTORY 0x0000000000000010
193 #define EFI_FILE_ARCHIVE 0x0000000000000020
194 #define EFI_FILE_VALID_ATTR 0x0000000000000037
198 (EFIAPI
*EFI_FILE_CLOSE
) (
199 IN
struct _EFI_FILE_HANDLE
*File
204 (EFIAPI
*EFI_FILE_DELETE
) (
205 IN
struct _EFI_FILE_HANDLE
*File
210 (EFIAPI
*EFI_FILE_READ
) (
211 IN
struct _EFI_FILE_HANDLE
*File
,
212 IN OUT UINTN
*BufferSize
,
218 (EFIAPI
*EFI_FILE_WRITE
) (
219 IN
struct _EFI_FILE_HANDLE
*File
,
220 IN OUT UINTN
*BufferSize
,
226 (EFIAPI
*EFI_FILE_SET_POSITION
) (
227 IN
struct _EFI_FILE_HANDLE
*File
,
233 (EFIAPI
*EFI_FILE_GET_POSITION
) (
234 IN
struct _EFI_FILE_HANDLE
*File
,
240 (EFIAPI
*EFI_FILE_GET_INFO
) (
241 IN
struct _EFI_FILE_HANDLE
*File
,
242 IN EFI_GUID
*InformationType
,
243 IN OUT UINTN
*BufferSize
,
249 (EFIAPI
*EFI_FILE_SET_INFO
) (
250 IN
struct _EFI_FILE_HANDLE
*File
,
251 IN EFI_GUID
*InformationType
,
258 (EFIAPI
*EFI_FILE_FLUSH
) (
259 IN
struct _EFI_FILE_HANDLE
*File
264 #define EFI_FILE_HANDLE_REVISION 0x00010000
265 typedef struct _EFI_FILE_HANDLE
{
268 EFI_FILE_CLOSE Close
;
269 EFI_FILE_DELETE Delete
;
271 EFI_FILE_WRITE Write
;
272 EFI_FILE_GET_POSITION GetPosition
;
273 EFI_FILE_SET_POSITION SetPosition
;
274 EFI_FILE_GET_INFO GetInfo
;
275 EFI_FILE_SET_INFO SetInfo
;
276 EFI_FILE_FLUSH Flush
;
277 } EFI_FILE
, *EFI_FILE_HANDLE
;
281 * File information types
284 #define EFI_FILE_INFO_ID \
285 { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
292 EFI_TIME LastAccessTime
;
293 EFI_TIME ModificationTime
;
299 * The FileName field of the EFI_FILE_INFO data structure is variable length.
300 * Whenever code needs to know the size of the EFI_FILE_INFO data structure,
301 * it needs to be the size of the data structure without the FileName field.
302 * The following macro computes this size correctly no matter how big the
303 * FileName array is declared. This is required to make the EFI_FILE_INFO
304 * data structure ANSI compliant.
307 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
309 #define EFI_FILE_SYSTEM_INFO_ID \
310 { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
318 CHAR16 VolumeLabel
[1];
319 } EFI_FILE_SYSTEM_INFO
;
322 * The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is
323 * variable length. Whenever code needs to know the size of the
324 * EFI_FILE_SYSTEM_INFO data structure, it needs to be the size of the data
325 * structure without the VolumeLable field. The following macro computes
326 * this size correctly no matter how big the VolumeLable array is declared.
327 * This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI
331 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
333 #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
334 { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
337 CHAR16 VolumeLabel
[1];
338 } EFI_FILE_SYSTEM_VOLUME_LABEL_INFO
;
340 #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
346 #define LOAD_FILE_PROTOCOL \
347 { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
349 INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE
);
353 (EFIAPI
*EFI_LOAD_FILE
) (
354 IN
struct _EFI_LOAD_FILE_INTERFACE
*This
,
355 IN EFI_DEVICE_PATH
*FilePath
,
356 IN BOOLEAN BootPolicy
,
357 IN OUT UINTN
*BufferSize
,
358 IN VOID
*Buffer OPTIONAL
361 typedef struct _EFI_LOAD_FILE_INTERFACE
{
362 EFI_LOAD_FILE LoadFile
;
363 } EFI_LOAD_FILE_INTERFACE
;
370 #define DEVICE_IO_PROTOCOL \
371 { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
373 INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE
);
381 * Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to
390 #define EFI_PCI_ADDRESS(_bus,_dev,_func) \
391 ( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) )
396 (EFIAPI
*EFI_DEVICE_IO
) (
397 IN
struct _EFI_DEVICE_IO_INTERFACE
*This
,
398 IN EFI_IO_WIDTH Width
,
411 (EFIAPI
*EFI_PCI_DEVICE_PATH
) (
412 IN
struct _EFI_DEVICE_IO_INTERFACE
*This
,
414 IN OUT EFI_DEVICE_PATH
**PciDevicePath
420 EfiBusMasterCommonBuffer
421 } EFI_IO_OPERATION_TYPE
;
425 (EFIAPI
*EFI_IO_MAP
) (
426 IN
struct _EFI_DEVICE_IO_INTERFACE
*This
,
427 IN EFI_IO_OPERATION_TYPE Operation
,
428 IN EFI_PHYSICAL_ADDRESS
*HostAddress
,
429 IN OUT UINTN
*NumberOfBytes
,
430 OUT EFI_PHYSICAL_ADDRESS
*DeviceAddress
,
436 (EFIAPI
*EFI_IO_UNMAP
) (
437 IN
struct _EFI_DEVICE_IO_INTERFACE
*This
,
443 (EFIAPI
*EFI_IO_ALLOCATE_BUFFER
) (
444 IN
struct _EFI_DEVICE_IO_INTERFACE
*This
,
445 IN EFI_ALLOCATE_TYPE Type
,
446 IN EFI_MEMORY_TYPE MemoryType
,
448 IN OUT EFI_PHYSICAL_ADDRESS
*HostAddress
453 (EFIAPI
*EFI_IO_FLUSH
) (
454 IN
struct _EFI_DEVICE_IO_INTERFACE
*This
459 (EFIAPI
*EFI_IO_FREE_BUFFER
) (
460 IN
struct _EFI_DEVICE_IO_INTERFACE
*This
,
462 IN EFI_PHYSICAL_ADDRESS HostAddress
465 typedef struct _EFI_DEVICE_IO_INTERFACE
{
470 EFI_PCI_DEVICE_PATH PciDevicePath
;
472 EFI_IO_ALLOCATE_BUFFER AllocateBuffer
;
474 EFI_IO_FREE_BUFFER FreeBuffer
;
475 } EFI_DEVICE_IO_INTERFACE
;
479 * Unicode Collation protocol
482 #define UNICODE_COLLATION_PROTOCOL \
483 { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
485 #define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
487 INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE
);
491 (EFIAPI
*EFI_UNICODE_STRICOLL
) (
492 IN
struct _EFI_UNICODE_COLLATION_INTERFACE
*This
,
499 (EFIAPI
*EFI_UNICODE_METAIMATCH
) (
500 IN
struct _EFI_UNICODE_COLLATION_INTERFACE
*This
,
507 (EFIAPI
*EFI_UNICODE_STRLWR
) (
508 IN
struct _EFI_UNICODE_COLLATION_INTERFACE
*This
,
514 (EFIAPI
*EFI_UNICODE_STRUPR
) (
515 IN
struct _EFI_UNICODE_COLLATION_INTERFACE
*This
,
521 (EFIAPI
*EFI_UNICODE_FATTOSTR
) (
522 IN
struct _EFI_UNICODE_COLLATION_INTERFACE
*This
,
530 (EFIAPI
*EFI_UNICODE_STRTOFAT
) (
531 IN
struct _EFI_UNICODE_COLLATION_INTERFACE
*This
,
538 typedef struct _EFI_UNICODE_COLLATION_INTERFACE
{
541 EFI_UNICODE_STRICOLL StriColl
;
542 EFI_UNICODE_METAIMATCH MetaiMatch
;
543 EFI_UNICODE_STRLWR StrLwr
;
544 EFI_UNICODE_STRUPR StrUpr
;
546 /* for supporting fat volumes */
547 EFI_UNICODE_FATTOSTR FatToStr
;
548 EFI_UNICODE_STRTOFAT StrToFat
;
550 CHAR8
*SupportedLanguages
;
551 } EFI_UNICODE_COLLATION_INTERFACE
;