diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/pe.h | 21 | ||||
-rw-r--r-- | include/efi_api.h | 37 | ||||
-rw-r--r-- | include/efi_loader.h | 4 | ||||
-rw-r--r-- | include/pe.h | 8 |
4 files changed, 58 insertions, 12 deletions
diff --git a/include/asm-generic/pe.h b/include/asm-generic/pe.h new file mode 100644 index 0000000000..d1683f238a --- /dev/null +++ b/include/asm-generic/pe.h @@ -0,0 +1,21 @@ +/* + * Portable Executable and Common Object Constants + * + * Copyright (c) 2018 Heinrich Schuchardt + * + * based on the "Microsoft Portable Executable and Common Object File Format + * Specification", revision 11, 2017-01-23 + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _ASM_PE_H +#define _ASM_PE_H + +/* Subsystem type */ +#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10 +#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11 +#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12 +#define IMAGE_SUBSYSTEM_EFI_ROM 13 + +#endif /* _ASM_PE_H */ diff --git a/include/efi_api.h b/include/efi_api.h index 205f8f1f70..3ba650e57e 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -166,7 +166,14 @@ struct efi_boot_services { void (EFIAPI *copy_mem)(void *destination, const void *source, size_t length); void (EFIAPI *set_mem)(void *buffer, size_t size, uint8_t value); - void *create_event_ex; + efi_status_t (EFIAPI *create_event_ex)( + uint32_t type, efi_uintn_t notify_tpl, + void (EFIAPI *notify_function) ( + struct efi_event *event, + void *context), + void *notify_context, + efi_guid_t *event_group, + struct efi_event **event); }; /* Types and defines for EFI ResetSystem */ @@ -180,6 +187,17 @@ enum efi_reset_type { #define EFI_RUNTIME_SERVICES_SIGNATURE 0x5652453544e5552ULL #define EFI_RUNTIME_SERVICES_REVISION 0x00010000 +#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000 +#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000 +#define CAPSULE_FLAGS_INITIATE_RESET 0x00040000 + +struct efi_capsule_header { + efi_guid_t *capsule_guid; + u32 header_size; + u32 flags; + u32 capsule_image_size; +}; + struct efi_runtime_services { struct efi_table_hdr hdr; efi_status_t (EFIAPI *get_time)(struct efi_time *time, @@ -209,9 +227,20 @@ struct efi_runtime_services { void (EFIAPI *reset_system)(enum efi_reset_type reset_type, efi_status_t reset_status, unsigned long data_size, void *reset_data); - void *update_capsule; - void *query_capsule_caps; - void *query_variable_info; + efi_status_t (EFIAPI *update_capsule)( + struct efi_capsule_header **capsule_header_array, + efi_uintn_t capsule_count, + u64 scatter_gather_list); + efi_status_t (EFIAPI *query_capsule_caps)( + struct efi_capsule_header **capsule_header_array, + efi_uintn_t capsule_count, + u64 maximum_capsule_size, + u32 reset_type); + efi_status_t (EFIAPI *query_variable_info)( + u32 attributes, + u64 maximum_variable_storage_size, + u64 remaining_variable_storage_size, + u64 maximum_variable_size); }; /* EFI Configuration Table and GUID definitions */ diff --git a/include/efi_loader.h b/include/efi_loader.h index 21c03c5c28..07730c3f39 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -173,7 +173,7 @@ extern struct list_head efi_obj_list; /* Called by bootefi to make console interface available */ int efi_console_register(void); /* Called by bootefi to make all disk storage accessible as EFI objects */ -int efi_disk_register(void); +efi_status_t efi_disk_register(void); /* Create handles and protocols for the partitions of a block device */ int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc, const char *if_typename, int diskid, @@ -272,7 +272,7 @@ efi_status_t efi_get_memory_map(efi_uintn_t *memory_map_size, uint64_t efi_add_memory_map(uint64_t start, uint64_t pages, int memory_type, bool overlap_only_ram); /* Called by board init to initialize the EFI drivers */ -int efi_driver_init(void); +efi_status_t efi_driver_init(void); /* Called by board init to initialize the EFI memory map */ int efi_memory_init(void); /* Adds new or overrides configuration table entry to the system table */ diff --git a/include/pe.h b/include/pe.h index 4ef3e92efa..c3a19cef76 100644 --- a/include/pe.h +++ b/include/pe.h @@ -11,6 +11,8 @@ #ifndef _PE_H #define _PE_H +#include <asm-generic/pe.h> + typedef struct _IMAGE_DOS_HEADER { uint16_t e_magic; /* 00: MZ Header signature */ uint16_t e_cblp; /* 02: Bytes on last page of file */ @@ -62,12 +64,6 @@ typedef struct _IMAGE_DATA_DIRECTORY { #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 -/* PE32+ Subsystem type for EFI images */ -#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10 -#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11 -#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12 -#define IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13 - typedef struct _IMAGE_OPTIONAL_HEADER64 { uint16_t Magic; /* 0x20b */ uint8_t MajorLinkerVersion; |