efi: Add a way to obtain boot services in the app
authorSimon Glass <sjg@chromium.org>
Thu, 4 Nov 2021 03:09:09 +0000 (21:09 -0600)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 7 Nov 2021 17:36:55 +0000 (18:36 +0100)
Add a function to return this information along with a stub for the
efi_info_get() function, since calling it otherwise hangs U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/efi.h
lib/efi/efi_app.c

index 18c13e0..b583542 100644 (file)
@@ -444,10 +444,16 @@ extern char _binary_u_boot_bin_start[], _binary_u_boot_bin_end[];
  *
  * @return pointer to EFI system table
  */
-
 struct efi_system_table *efi_get_sys_table(void);
 
 /**
+ * efi_get_boot() - Get access to the EFI boot services table
+ *
+ * @return pointer to EFI boot services table
+ */
+struct efi_boot_services *efi_get_boot(void);
+
+/**
  * efi_get_ram_base() - Find the base of RAM
  *
  * This is used when U-Boot is built as an EFI application.
index 907bacd..f616656 100644 (file)
@@ -31,11 +31,21 @@ struct efi_system_table *efi_get_sys_table(void)
        return global_priv->sys_table;
 }
 
+struct efi_boot_services *efi_get_boot(void)
+{
+       return global_priv->boot;
+}
+
 unsigned long efi_get_ram_base(void)
 {
        return global_priv->ram_base;
 }
 
+int efi_info_get(enum efi_entry_t type, void **datap, int *sizep)
+{
+       return -ENOSYS;
+}
+
 static efi_status_t setup_memory(struct efi_priv *priv)
 {
        struct efi_boot_services *boot = priv->boot;