summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2018-12-30 15:16:55 +0100
committerAlexander Graf <agraf@suse.de>2019-02-13 09:40:05 +0100
commit056b45bc50c11a57363b7b958297f13506a2508b (patch)
tree17ee7a6ca4efd809bbabc7fc162a5f4479845e26 /cmd
parent4f3cb4d578f6848b0c00d3badbe69e1da805760b (diff)
efi_loader: move efi_init_obj_list() to a new efi_setup.c
The function, efi_init_obj_list(), can be shared in different pseudo efi applications, like bootefi/bootmgr as well as my efishell. Moreover, it will be utilized to extend efi initialization, for example, my "removable disk support" patch and "capsule-on-disk support" patch in the future. So with this patch, it will be moved to a new file, efi_setup.c, under lib/efi_loader and exported, making no changes in functionality. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Remove lines deactivated by #if 1 #else Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/bootefi.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 7ab08382fa..bcdd29ebed 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -28,86 +28,9 @@
DECLARE_GLOBAL_DATA_PTR;
-#define OBJ_LIST_NOT_INITIALIZED 1
-
-static efi_status_t efi_obj_list_initialized = OBJ_LIST_NOT_INITIALIZED;
-
static struct efi_device_path *bootefi_image_path;
static struct efi_device_path *bootefi_device_path;
-/* Initialize and populate EFI object list */
-efi_status_t efi_init_obj_list(void)
-{
- efi_status_t ret = EFI_SUCCESS;
-
- /*
- * On the ARM architecture gd is mapped to a fixed register (r9 or x18).
- * As this register may be overwritten by an EFI payload we save it here
- * and restore it on every callback entered.
- */
- efi_save_gd();
-
- /* Initialize once only */
- if (efi_obj_list_initialized != OBJ_LIST_NOT_INITIALIZED)
- return efi_obj_list_initialized;
-
- /* Initialize system table */
- ret = efi_initialize_system_table();
- if (ret != EFI_SUCCESS)
- goto out;
-
- /* Initialize root node */
- ret = efi_root_node_register();
- if (ret != EFI_SUCCESS)
- goto out;
-
- /* Initialize EFI driver uclass */
- ret = efi_driver_init();
- if (ret != EFI_SUCCESS)
- goto out;
-
- ret = efi_console_register();
- if (ret != EFI_SUCCESS)
- goto out;
-#ifdef CONFIG_PARTITIONS
- ret = efi_disk_register();
- if (ret != EFI_SUCCESS)
- goto out;
-#endif
-#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
- ret = efi_gop_register();
- if (ret != EFI_SUCCESS)
- goto out;
-#endif
-#ifdef CONFIG_NET
- ret = efi_net_register();
- if (ret != EFI_SUCCESS)
- goto out;
-#endif
-#ifdef CONFIG_GENERATE_ACPI_TABLE
- ret = efi_acpi_register();
- if (ret != EFI_SUCCESS)
- goto out;
-#endif
-#ifdef CONFIG_GENERATE_SMBIOS_TABLE
- ret = efi_smbios_register();
- if (ret != EFI_SUCCESS)
- goto out;
-#endif
- ret = efi_watchdog_register();
- if (ret != EFI_SUCCESS)
- goto out;
-
- /* Initialize EFI runtime services */
- ret = efi_reset_system_init();
- if (ret != EFI_SUCCESS)
- goto out;
-
-out:
- efi_obj_list_initialized = ret;
- return ret;
-}
-
/*
* Allow unaligned memory access.
*