diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/efi_load_initrd.h | 12 | ||||
-rw-r--r-- | include/efi_loader.h | 24 |
2 files changed, 34 insertions, 2 deletions
diff --git a/include/efi_load_initrd.h b/include/efi_load_initrd.h index be5d5a7acbe..9feafb18c86 100644 --- a/include/efi_load_initrd.h +++ b/include/efi_load_initrd.h @@ -18,7 +18,17 @@ 0xac, 0x74, 0xca, 0x55, 0x52, 0x31, 0xcc, 0x68) extern const efi_guid_t efi_lf2_initrd_guid; -struct efi_initrd_dp { +/** + * struct efi_lo_dp_prefix - separator device path used in load options + * + * We use vendor media device nodes in UEFI load options to separate + * the binary, initrd, and fdt device-paths. This structure contains + * the vendor media device node and an end node. + * + * @vendor: vendor media device node + * @end: end node + */ +struct efi_lo_dp_prefix { struct efi_device_path_vendor vendor; struct efi_device_path end; } __packed; diff --git a/include/efi_loader.h b/include/efi_loader.h index 9600941aa32..6c993e1a694 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -664,6 +664,10 @@ efi_status_t EFIAPI efi_load_image(bool boot_policy, void *source_buffer, efi_uintn_t source_size, efi_handle_t *image_handle); +/* Load image from path */ +efi_status_t efi_load_image_from_path(bool boot_policy, + struct efi_device_path *file_path, + void **buffer, efi_uintn_t *size); /* Start image */ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, efi_uintn_t *exit_data_size, @@ -946,7 +950,7 @@ struct efi_device_path *efi_dp_from_lo(struct efi_load_option *lo, const efi_guid_t *guid); struct efi_device_path *efi_dp_concat(const struct efi_device_path *dp1, const struct efi_device_path *dp2, - bool split_end_node); + size_t split_end_node); struct efi_device_path *search_gpt_dp_node(struct efi_device_path *device_path); efi_status_t efi_deserialize_load_option(struct efi_load_option *lo, u8 *data, efi_uintn_t *size); @@ -1185,4 +1189,22 @@ efi_status_t efi_disk_get_device_name(const efi_handle_t handle, char *buf, int */ void efi_add_known_memory(void); +/** + * efi_load_option_dp_join() - join device-paths for load option + * + * @dp: in: binary device-path, out: joined device-path + * @dp_size: size of joined device-path + * @initrd_dp: initrd device-path or NULL + * @fdt_dp: device-tree device-path or NULL + * Return: status_code + */ +efi_status_t efi_load_option_dp_join(struct efi_device_path **dp, + size_t *dp_size, + struct efi_device_path *initrd_dp, + struct efi_device_path *fdt_dp); + +int efi_get_distro_fdt_name(char *fname, int size, int seq); + +void efi_load_distro_fdt(void **fdt, efi_uintn_t *fdt_size); + #endif /* _EFI_LOADER_H */ |