summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_bootmgr.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-04-29 14:04:08 -0400
committerTom Rini <trini@konsulko.com>2022-04-29 14:04:08 -0400
commitc70c0102af5413cadde6bf90044cb75aefef0584 (patch)
treeadf1fa2efb653261ce8eb1b8087bd5f28e4aa913 /lib/efi_loader/efi_bootmgr.c
parentf7bd9e4936b6e36c2443b9b2ef761e7593511521 (diff)
parent5e847f7729b3cc34b572b4f59ee7d468b3b76ccc (diff)
Merge tag 'efi-2022-07-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2022-07-rc2 UEFI: * fix UEFI booting after integration of UEFI sub-system with driver model * avoid random return values from devpath_is_partition() * minor code clean ups
Diffstat (limited to 'lib/efi_loader/efi_bootmgr.c')
-rw-r--r--lib/efi_loader/efi_bootmgr.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index 8c04ecbdc83..52bea4d5411 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -46,16 +46,12 @@ static efi_status_t try_load_entry(u16 n, efi_handle_t *handle,
void **load_options)
{
struct efi_load_option lo;
- u16 varname[] = u"Boot0000";
- u16 hexmap[] = u"0123456789ABCDEF";
+ u16 varname[9];
void *load_option;
efi_uintn_t size;
efi_status_t ret;
- varname[4] = hexmap[(n & 0xf000) >> 12];
- varname[5] = hexmap[(n & 0x0f00) >> 8];
- varname[6] = hexmap[(n & 0x00f0) >> 4];
- varname[7] = hexmap[(n & 0x000f) >> 0];
+ efi_create_indexed_name(varname, sizeof(varname), "Boot", n);
load_option = efi_get_var(varname, &efi_global_variable_guid, &size);
if (!load_option)
@@ -70,8 +66,8 @@ static efi_status_t try_load_entry(u16 n, efi_handle_t *handle,
if (lo.attributes & LOAD_OPTION_ACTIVE) {
u32 attributes;
- log_debug("%s: trying to load \"%ls\" from %pD\n",
- __func__, lo.label, lo.file_path);
+ log_debug("trying to load \"%ls\" from %pD\n", lo.label,
+ lo.file_path);
ret = EFI_CALL(efi_load_image(true, efi_root, lo.file_path,
NULL, 0, handle));
@@ -187,8 +183,7 @@ efi_status_t efi_bootmgr_load(efi_handle_t *handle, void **load_options)
num = size / sizeof(uint16_t);
for (i = 0; i < num; i++) {
- log_debug("%s trying to load Boot%04X\n", __func__,
- bootorder[i]);
+ log_debug("trying to load Boot%04X\n", bootorder[i]);
ret = try_load_entry(bootorder[i], handle, load_options);
if (ret == EFI_SUCCESS)
break;