]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_selftest: expose runtime table address
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 14 Nov 2025 09:32:40 +0000 (10:32 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 21 Nov 2025 18:30:32 +0000 (19:30 +0100)
Save the address of the EFI runtime as a global variable.
This allows to simplify the setup of tests.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
include/efi_selftest.h
lib/efi_selftest/efi_selftest.c

index 1b708849bcb9f3b07995b399d996add754324b2e..4ee46cbbb66cb16aea6aa2d40d818fc2674a45be 100644 (file)
@@ -19,6 +19,7 @@
 
 extern const struct efi_system_table *st_systable;
 extern const struct efi_boot_services *st_boottime;
+extern const struct efi_runtime_services *st_runtime;
 
 /**
  * efi_st_printf() - print a message
index 191da7fc451751ea5cca10aec4f6be77b60c72af..2b95713afb499c98daef1bbe695c15859b7d5c3b 100644 (file)
@@ -16,7 +16,7 @@
 
 const struct efi_system_table *st_systable;
 const struct efi_boot_services *st_boottime;
-static const struct efi_runtime_services *runtime;
+const struct efi_runtime_services *st_runtime;
 static efi_handle_t handle;
 static u16 reset_message[] = u"Selftest completed";
 static int *setup_status;
@@ -259,7 +259,7 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
 
        st_systable = systab;
        st_boottime = st_systable->boottime;
-       runtime = st_systable->runtime;
+       st_runtime = st_systable->runtime;
        handle = image_handle;
        con_out = st_systable->con_out;
        con_in = st_systable->con_in;
@@ -347,8 +347,8 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
        efi_st_get_key();
 
        if (IS_ENABLED(CONFIG_EFI_HAVE_RUNTIME_RESET)) {
-               runtime->reset_system(EFI_RESET_WARM, EFI_NOT_READY,
-                                     sizeof(reset_message), reset_message);
+               st_runtime->reset_system(EFI_RESET_WARM, EFI_NOT_READY,
+                                        sizeof(reset_message), reset_message);
        } else {
                efi_restore_gd();
                do_reset(NULL, 0, 0, NULL);