aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot
diff options
context:
space:
mode:
authorRoy Franz <roy.franz@linaro.org>2013-09-22 18:45:32 -0400
committerMatt Fleming <matt.fleming@intel.com>2013-09-25 07:34:38 -0400
commit4a9f3a7c336a6b0ffeef2523bef93e67b0921163 (patch)
tree49717fdb090563dc4b10b056f40f0d49d9fe033b /arch/x86/boot
parentc6866d7238d4f26055de8db9c1d5a700e554b2d4 (diff)
efi: Generalize relocate_kernel() for use by other architectures.
Rename relocate_kernel() to efi_relocate_kernel(), and take parameters rather than x86 specific structure. Add max_addr argument as for ARM we have some address constraints that we need to enforce when relocating the kernel. Add alloc_size parameter for use by ARM64 which uses an uncompressed kernel, and needs to allocate space for BSS. Signed-off-by: Roy Franz <roy.franz@linaro.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86/boot')
-rw-r--r--arch/x86/boot/compressed/eboot.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 5bbba868e2bc..2e997b6fbdb1 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -733,10 +733,16 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table,
733 * address, relocate it. 733 * address, relocate it.
734 */ 734 */
735 if (hdr->pref_address != hdr->code32_start) { 735 if (hdr->pref_address != hdr->code32_start) {
736 status = relocate_kernel(hdr); 736 unsigned long bzimage_addr = hdr->code32_start;
737 737 status = efi_relocate_kernel(sys_table, &bzimage_addr,
738 hdr->init_size, hdr->init_size,
739 hdr->pref_address,
740 hdr->kernel_alignment);
738 if (status != EFI_SUCCESS) 741 if (status != EFI_SUCCESS)
739 goto fail; 742 goto fail;
743
744 hdr->pref_address = hdr->code32_start;
745 hdr->code32_start = bzimage_addr;
740 } 746 }
741 747
742 status = exit_boot(boot_params, handle); 748 status = exit_boot(boot_params, handle);