Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

efi: Add EFI file I/O data types

The x86 EFI stub needs to access files, for example when loading
initrd's. Add the required data types.

Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Link: http://lkml.kernel.org/r/1318848017-12301-1-git-send-email-matt@console-pimps.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

authored by

Matt Fleming and committed by
H. Peter Anvin
55839d51 e2527a7c

+40
+40
include/linux/efi.h
··· 307 307 #define EFI_PCI_IO_PROTOCOL_GUID \ 308 308 EFI_GUID( 0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a ) 309 309 310 + #define EFI_FILE_INFO_ID \ 311 + EFI_GUID( 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) 312 + 313 + #define EFI_FILE_SYSTEM_GUID \ 314 + EFI_GUID( 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) 315 + 310 316 typedef struct { 311 317 efi_guid_t guid; 312 318 unsigned long table; ··· 367 361 unsigned int image_data_type; 368 362 unsigned long unload; 369 363 } efi_loaded_image_t; 364 + 365 + typedef struct { 366 + u64 revision; 367 + void *open_volume; 368 + } efi_file_io_interface_t; 369 + 370 + typedef struct { 371 + u64 size; 372 + u64 file_size; 373 + u64 phys_size; 374 + efi_time_t create_time; 375 + efi_time_t last_access_time; 376 + efi_time_t modification_time; 377 + __aligned_u64 attribute; 378 + efi_char16_t filename[1]; 379 + } efi_file_info_t; 380 + 381 + typedef struct { 382 + u64 revision; 383 + void *open; 384 + void *close; 385 + void *delete; 386 + void *read; 387 + void *write; 388 + void *get_position; 389 + void *set_position; 390 + void *get_info; 391 + void *set_info; 392 + void *flush; 393 + } efi_file_handle_t; 394 + 395 + #define EFI_FILE_MODE_READ 0x0000000000000001 396 + #define EFI_FILE_MODE_WRITE 0x0000000000000002 397 + #define EFI_FILE_MODE_CREATE 0x8000000000000000 370 398 371 399 #define EFI_INVALID_TABLE_ADDR (~0UL) 372 400