summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-05-26 10:27:32 +0200
committerJan Janssen <medhefgo@web.de>2022-06-09 12:50:13 +0200
commit7ebce8145e627b04a976a5e60b91552321121293 (patch)
treeb490524c3499464fe0caff04cdca1ebc73a78de1 /src
parentboot: Drop use of MetaiMatch (diff)
downloadsystemd-7ebce8145e627b04a976a5e60b91552321121293.tar.xz
systemd-7ebce8145e627b04a976a5e60b91552321121293.zip
boot: Drop use of LibGetSystemConfigurationTable
Diffstat (limited to 'src')
-rw-r--r--src/boot/efi/devicetree.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/boot/efi/devicetree.c b/src/boot/efi/devicetree.c
index 81c6e60ca6..d5186d10d0 100644
--- a/src/boot/efi/devicetree.c
+++ b/src/boot/efi/devicetree.c
@@ -8,6 +8,13 @@
#define FDT_V1_SIZE (7*4)
+static void *get_dtb_table(void) {
+ for (UINTN i = 0; i < ST->NumberOfTableEntries; i++)
+ if (memcmp(&EfiDtbTableGuid, &ST->ConfigurationTable[i].VendorGuid, sizeof(EfiDtbTableGuid)) == 0)
+ return ST->ConfigurationTable[i].VendorTable;
+ return NULL;
+}
+
static EFI_STATUS devicetree_allocate(struct devicetree_state *state, UINTN size) {
UINTN pages = DIV_ROUND_UP(size, EFI_PAGE_SIZE);
EFI_STATUS err;
@@ -74,8 +81,8 @@ EFI_STATUS devicetree_install(struct devicetree_state *state, EFI_FILE *root_dir
assert(root_dir);
assert(name);
- err = LibGetSystemConfigurationTable(&EfiDtbTableGuid, &state->orig);
- if (EFI_ERROR(err))
+ state->orig = get_dtb_table();
+ if (!state->orig)
return EFI_UNSUPPORTED;
err = root_dir->Open(root_dir, &handle, name, EFI_FILE_MODE_READ, EFI_FILE_READ_ONLY);
@@ -114,8 +121,8 @@ EFI_STATUS devicetree_install_from_memory(struct devicetree_state *state,
assert(state);
assert(dtb_buffer && dtb_length > 0);
- err = LibGetSystemConfigurationTable(&EfiDtbTableGuid, &state->orig);
- if (EFI_ERROR(err))
+ state->orig = get_dtb_table();
+ if (!state->orig)
return EFI_UNSUPPORTED;
err = devicetree_allocate(state, dtb_length);