Fix kexec on ARM by properly calling the relocation function
Forwarding a patch to fix kexec on ARM. Comments sought.
/Amit
---------- Forwarded message ----------
From: Michael Casadevall <sonicmctails@gmail.com>
Date: Tue, Jan 20, 2009 at 4:43 PM
Subject: [PATCH] UBUNTU: [arm] Fix kexec on ARM by properly calling
the relocation function
To: kernel-team@lists.ubuntu.com
Cc: Michael Casadevall <michael.casadevall@canonical.com>
From: Michael Casadevall <michael.casadevall@canonical.com>
The kexec syscall function is broken on ARM due to it not properly calling
the relocation stub with the correct arguments. This patch puts machine_kexec
in line with the other architectures, and allows kexec to work peroply on ARM.
It has been tested on the versatile kernel successfully.
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 440dc62..d16f6f4 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -23,6 +23,11 @@ extern unsigned long kexec_indirection_page;
extern unsigned long kexec_mach_type;
extern unsigned long kexec_boot_atags;
+typedef NORET_TYPE void (*relocate_new_kernel_t)(
+ unsigned long indirection_page,
+ unsigned long reboot_code_buffer,
+ unsigned long start_address) ATTRIB_NORET;
+
/*
* Provide a dummy crash_notes definition while crash dump arrives to arm.
* This prevents breakage of crash_notes attribute in kernel/ksysfs.c.
@@ -50,7 +55,7 @@ void machine_kexec(struct kimage *image)
unsigned long page_list;
unsigned long reboot_code_buffer_phys;
void *reboot_code_buffer;
-
+ relocate_new_kernel_t rnk;