aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/boot/compressed/eboot.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 915c64edbe8e..1458b1700fc7 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -404,7 +404,7 @@ struct boot_params *make_boot_params(struct efi_config *c)
404 if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) 404 if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
405 return NULL; 405 return NULL;
406 406
407 if (efi_early->is64) 407 if (efi_is_64bit())
408 setup_boot_services64(efi_early); 408 setup_boot_services64(efi_early);
409 else 409 else
410 setup_boot_services32(efi_early); 410 setup_boot_services32(efi_early);
@@ -639,7 +639,6 @@ struct exit_boot_struct {
639 struct efi_info *efi; 639 struct efi_info *efi;
640 struct setup_data *e820ext; 640 struct setup_data *e820ext;
641 __u32 e820ext_size; 641 __u32 e820ext_size;
642 bool is64;
643}; 642};
644 643
645static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg, 644static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg,
@@ -666,7 +665,8 @@ static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg,
666 first = false; 665 first = false;
667 } 666 }
668 667
669 signature = p->is64 ? EFI64_LOADER_SIGNATURE : EFI32_LOADER_SIGNATURE; 668 signature = efi_is_64bit() ? EFI64_LOADER_SIGNATURE
669 : EFI32_LOADER_SIGNATURE;
670 memcpy(&p->efi->efi_loader_signature, signature, sizeof(__u32)); 670 memcpy(&p->efi->efi_loader_signature, signature, sizeof(__u32));
671 671
672 p->efi->efi_systab = (unsigned long)sys_table_arg; 672 p->efi->efi_systab = (unsigned long)sys_table_arg;
@@ -683,8 +683,7 @@ static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg,
683 return EFI_SUCCESS; 683 return EFI_SUCCESS;
684} 684}
685 685
686static efi_status_t exit_boot(struct boot_params *boot_params, 686static efi_status_t exit_boot(struct boot_params *boot_params, void *handle)
687 void *handle, bool is64)
688{ 687{
689 unsigned long map_sz, key, desc_size, buff_size; 688 unsigned long map_sz, key, desc_size, buff_size;
690 efi_memory_desc_t *mem_map; 689 efi_memory_desc_t *mem_map;
@@ -705,7 +704,6 @@ static efi_status_t exit_boot(struct boot_params *boot_params,
705 priv.efi = &boot_params->efi_info; 704 priv.efi = &boot_params->efi_info;
706 priv.e820ext = NULL; 705 priv.e820ext = NULL;
707 priv.e820ext_size = 0; 706 priv.e820ext_size = 0;
708 priv.is64 = is64;
709 707
710 /* Might as well exit boot services now */ 708 /* Might as well exit boot services now */
711 status = efi_exit_boot_services(sys_table, handle, &map, &priv, 709 status = efi_exit_boot_services(sys_table, handle, &map, &priv,
@@ -740,13 +738,11 @@ efi_main(struct efi_config *c, struct boot_params *boot_params)
740 struct desc_struct *desc; 738 struct desc_struct *desc;
741 void *handle; 739 void *handle;
742 efi_system_table_t *_table; 740 efi_system_table_t *_table;
743 bool is64;
744 741
745 efi_early = c; 742 efi_early = c;
746 743
747 _table = (efi_system_table_t *)(unsigned long)efi_early->table; 744 _table = (efi_system_table_t *)(unsigned long)efi_early->table;
748 handle = (void *)(unsigned long)efi_early->image_handle; 745 handle = (void *)(unsigned long)efi_early->image_handle;
749 is64 = efi_early->is64;
750 746
751 sys_table = _table; 747 sys_table = _table;
752 748
@@ -754,7 +750,7 @@ efi_main(struct efi_config *c, struct boot_params *boot_params)
754 if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) 750 if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
755 goto fail; 751 goto fail;
756 752
757 if (is64) 753 if (efi_is_64bit())
758 setup_boot_services64(efi_early); 754 setup_boot_services64(efi_early);
759 else 755 else
760 setup_boot_services32(efi_early); 756 setup_boot_services32(efi_early);
@@ -810,7 +806,7 @@ efi_main(struct efi_config *c, struct boot_params *boot_params)
810 hdr->code32_start = bzimage_addr; 806 hdr->code32_start = bzimage_addr;
811 } 807 }
812 808
813 status = exit_boot(boot_params, handle, is64); 809 status = exit_boot(boot_params, handle);
814 if (status != EFI_SUCCESS) { 810 if (status != EFI_SUCCESS) {
815 efi_printk(sys_table, "exit_boot() failed!\n"); 811 efi_printk(sys_table, "exit_boot() failed!\n");
816 goto fail; 812 goto fail;