summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi/libefi
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/efi/libefi')
-rw-r--r--sys/boot/efi/libefi/bootinfo.c3
-rw-r--r--sys/boot/efi/libefi/libefi.c14
2 files changed, 17 insertions, 0 deletions
diff --git a/sys/boot/efi/libefi/bootinfo.c b/sys/boot/efi/libefi/bootinfo.c
index 484f226..def4bfb 100644
--- a/sys/boot/efi/libefi/bootinfo.c
+++ b/sys/boot/efi/libefi/bootinfo.c
@@ -39,6 +39,8 @@
#include "bootstrap.h"
+static EFI_GUID hcdp = HCDP_TABLE_GUID;
+
/*
* Return a 'boothowto' value corresponding to the kernel arguments in
* (kargs) and any relevant environment variables.
@@ -300,6 +302,7 @@ bi_load(struct bootinfo *bi, struct preloaded_file *fp, UINTN *mapkey,
bi->bi_symtab = ssym;
bi->bi_esymtab = esym;
+ bi->bi_hcdp = (uint64_t)efi_get_table(&hcdp); /* DIG64 HCDP table addr. */
fpswa_init(&bi->bi_fpswa); /* find FPSWA interface */
/* find the last module in the chain */
diff --git a/sys/boot/efi/libefi/libefi.c b/sys/boot/efi/libefi/libefi.c
index e28d8db..5ef97f4 100644
--- a/sys/boot/efi/libefi/libefi.c
+++ b/sys/boot/efi/libefi/libefi.c
@@ -59,6 +59,20 @@ arg_skipword(CHAR16 *argp)
return (argp);
}
+void *
+efi_get_table(EFI_GUID *tbl)
+{
+ EFI_GUID *id;
+ int i;
+
+ for (i = 0; i < ST->NumberOfTableEntries; i++) {
+ id = &ST->ConfigurationTable[i].VendorGuid;
+ if (!memcmp(id, tbl, sizeof(EFI_GUID)))
+ return (ST->ConfigurationTable[i].VendorTable);
+ }
+ return (NULL);
+}
+
void exit(EFI_STATUS exit_code)
{
OpenPOWER on IntegriCloud