summaryrefslogtreecommitdiff
path: root/include/efi_loader.h
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2018-11-05 12:06:41 +0300
committerAlexander Graf <agraf@suse.de>2018-12-03 02:17:45 +0300
commit1a82b3413cb577cd52cf8a1dc22dd306e4ce0772 (patch)
treead61ae43a96fa79255afa4206f94b2462ddbe9ee /include/efi_loader.h
parent2419b161cc083c4927c2ee0582ccc93d1d54b3b0 (diff)
downloadu-boot-1a82b3413cb577cd52cf8a1dc22dd306e4ce0772.tar.xz
efi_loader: bootmgr: add load option helper functions
In this patch, helper functions for an load option variable (BootXXXX) are added: * efi_deserialize_load_option(): parse a string into load_option data (renamed from parse_load_option and exported) * efi_serialize_load_option(): convert load_option data into a string Those functions will be used to implement efishell command. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include/efi_loader.h')
-rw-r--r--include/efi_loader.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 3c90515fef..53f08161ab 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -518,6 +518,29 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, efi_guid_t *vendor,
u32 attributes, efi_uintn_t data_size,
void *data);
+/*
+ * See section 3.1.3 in the v2.7 UEFI spec for more details on
+ * the layout of EFI_LOAD_OPTION. In short it is:
+ *
+ * typedef struct _EFI_LOAD_OPTION {
+ * UINT32 Attributes;
+ * UINT16 FilePathListLength;
+ * // CHAR16 Description[]; <-- variable length, NULL terminated
+ * // EFI_DEVICE_PATH_PROTOCOL FilePathList[];
+ * <-- FilePathListLength bytes
+ * // UINT8 OptionalData[];
+ * } EFI_LOAD_OPTION;
+ */
+struct efi_load_option {
+ u32 attributes;
+ u16 file_path_length;
+ u16 *label;
+ struct efi_device_path *file_path;
+ u8 *optional_data;
+};
+
+void efi_deserialize_load_option(struct efi_load_option *lo, u8 *data);
+unsigned long efi_serialize_load_option(struct efi_load_option *lo, u8 **data);
void *efi_bootmgr_load(struct efi_device_path **device_path,
struct efi_device_path **file_path);