]> git.sur5r.net Git - u-boot/blobdiff - lib/efi_loader/efi_boottime.c
regulator: pfuze100: add SPDX License
[u-boot] / lib / efi_loader / efi_boottime.c
index 51961d2060695da90ee968b52bfb96b1c62062ef..51080cbeed2f35d03fb1deb983a0d0a26021a92b 100644 (file)
@@ -37,8 +37,9 @@ static bool efi_is_direct_boot = true;
  * In most cases we want to pass an FDT to the payload, so reserve one slot of
  * config table space for it. The pointer gets populated by do_bootefi_exec().
  */
-static struct efi_configuration_table EFI_RUNTIME_DATA efi_conf_table[2];
+static struct efi_configuration_table __efi_runtime_data efi_conf_table[2];
 
+#ifdef CONFIG_ARM
 /*
  * The "gd" pointer lives in a register on ARM and AArch64 that we declare
  * fixed when compiling U-Boot. However, the payload does not know about that
@@ -46,16 +47,20 @@ static struct efi_configuration_table EFI_RUNTIME_DATA efi_conf_table[2];
  * EFI callback entry/exit.
  */
 static volatile void *efi_gd, *app_gd;
+#endif
 
 /* Called from do_bootefi_exec() */
 void efi_save_gd(void)
 {
+#ifdef CONFIG_ARM
        efi_gd = gd;
+#endif
 }
 
 /* Called on every callback entry */
 void efi_restore_gd(void)
 {
+#ifdef CONFIG_ARM
        /* Only restore if we're already in EFI context */
        if (!efi_gd)
                return;
@@ -63,12 +68,16 @@ void efi_restore_gd(void)
        if (gd != efi_gd)
                app_gd = gd;
        gd = efi_gd;
+#endif
 }
 
 /* Called on every callback exit */
 efi_status_t efi_exit_func(efi_status_t ret)
 {
+#ifdef CONFIG_ARM
        gd = app_gd;
+#endif
+
        return ret;
 }
 
@@ -160,7 +169,7 @@ static struct {
        u32 trigger_time;
        u64 trigger_next;
        unsigned long notify_tpl;
-       void (*notify_function) (void *event, void *context);
+       void (EFIAPI *notify_function) (void *event, void *context);
        void *notify_context;
 } efi_event = {
        /* Disable timers on bootup */
@@ -169,7 +178,8 @@ static struct {
 
 static efi_status_t EFIAPI efi_create_event(
                        enum efi_event_type type, ulong notify_tpl,
-                       void (*notify_function) (void *event, void *context),
+                       void (EFIAPI *notify_function) (void *event,
+                                                       void *context),
                        void *notify_context, void **event)
 {
        EFI_ENTRY("%d, 0x%lx, %p, %p", type, notify_tpl, notify_function,
@@ -395,7 +405,7 @@ efi_status_t efi_install_configuration_table(const efi_guid_t *guid, void *table
        /* Add a new entry */
        memcpy(&efi_conf_table[i].guid, guid, sizeof(*guid));
        efi_conf_table[i].table = table;
-       systab.nr_tables = i;
+       systab.nr_tables = i + 1;
 
        return EFI_SUCCESS;
 }
@@ -528,6 +538,8 @@ static efi_status_t EFIAPI efi_exit_boot_services(void *image_handle,
 {
        EFI_ENTRY("%p, %ld", image_handle, map_key);
 
+       board_quiesce_devices();
+
        /* Fix up caches for EFI payloads if necessary */
        efi_exit_caches();
 
@@ -780,10 +792,10 @@ static const struct efi_boot_services efi_boot_services = {
 };
 
 
-static uint16_t EFI_RUNTIME_DATA firmware_vendor[] =
+static uint16_t __efi_runtime_data firmware_vendor[] =
        { 'D','a','s',' ','U','-','b','o','o','t',0 };
 
-struct efi_system_table EFI_RUNTIME_DATA systab = {
+struct efi_system_table __efi_runtime_data systab = {
        .hdr = {
                .signature = EFI_SYSTEM_TABLE_SIGNATURE,
                .revision = 0x20005, /* 2.5 */