summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2017-03-03 13:33:59 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-09 07:36:15 +0100
commit035842ff5588df73170171587a08f02d29838302 (patch)
treef34c6f1205c6e22356f77161cb4bc1c476b604ef
parent566f5634c5c2b3028d1cdd02ab53db9883711df0 (diff)
downloadbarebox-035842ff5588df73170171587a08f02d29838302.tar.gz
efi: move LoaderTimeInitUSec and LoaderDevicePartUUID to postcore initcall
so we can use device/driver for the timer Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/efi/efi.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/common/efi/efi.c b/common/efi/efi.c
index 217a6be..1c7aee8 100644
--- a/common/efi/efi.c
+++ b/common/efi/efi.c
@@ -314,7 +314,6 @@ efi_status_t efi_main(efi_handle_t image, efi_system_table_t *sys_table)
efi_physical_addr_t mem;
size_t memsize;
efi_status_t efiret;
- char *uuid;
#ifdef DEBUG
sys_table->con_out->output_string(sys_table->con_out, L"barebox\n");
@@ -350,6 +349,15 @@ efi_status_t efi_main(efi_handle_t image, efi_system_table_t *sys_table)
mem_malloc_init((void *)mem, (void *)mem + memsize);
efi_clocksource_init();
+ start_barebox();
+
+ return EFI_SUCCESS;
+}
+
+static int efi_postcore_init(void)
+{
+ char *uuid;
+
efi_set_variable_usec("LoaderTimeInitUSec", &efi_systemd_vendor_guid,
get_time_ns()/1000);
@@ -366,10 +374,9 @@ efi_status_t efi_main(efi_handle_t image, efi_system_table_t *sys_table)
free(uuid16);
}
- start_barebox();
-
- return EFI_SUCCESS;
+ return 0;
}
+postcore_initcall(efi_postcore_init);
static int do_efiexit(int argc, char *argv[])
{