1 diff -uprN linux-2.6.23.orig/arch/arm/kernel/relocate_kernel.S linux-2.6.23/arch/arm/kernel/relocate_kernel.S
2 --- linux-2.6.23.orig/arch/arm/kernel/relocate_kernel.S 2007-10-09 15:31:38.000000000 -0500
3 +++ linux-2.6.23/arch/arm/kernel/relocate_kernel.S 2007-10-09 22:19:32.000000000 -0500
5 .globl relocate_new_kernel
8 + /* Move boot params back to where the kernel expects them */
10 + ldr r0,kexec_boot_params_address
14 + ldr r1,kexec_boot_params_copy
15 + mov r6,#KEXEC_BOOT_PARAMS_SIZE/4
23 + /* Boot params moved, now go on with the kernel */
25 ldr r0,kexec_indirection_page
26 ldr r1,kexec_start_address
28 @@ -50,7 +67,7 @@ relocate_new_kernel:
31 ldr r1,kexec_mach_type
33 + ldr r2,kexec_boot_params_address
36 .globl kexec_start_address
37 @@ -65,6 +82,16 @@ kexec_indirection_page:
41 + /* phy addr where new kernel will expect to find boot params */
42 + .globl kexec_boot_params_address
43 +kexec_boot_params_address:
46 + /* phy addr where old kernel put a copy of orig boot params */
47 + .globl kexec_boot_params_copy
48 +kexec_boot_params_copy:
51 relocate_new_kernel_end:
53 .globl relocate_new_kernel_size
54 diff -uprN linux-2.6.23.orig/arch/arm/kernel/setup.c linux-2.6.23/arch/arm/kernel/setup.c
55 --- linux-2.6.23.orig/arch/arm/kernel/setup.c 2007-10-09 15:31:38.000000000 -0500
56 +++ linux-2.6.23/arch/arm/kernel/setup.c 2007-10-09 20:06:10.000000000 -0500
58 #include <linux/interrupt.h>
59 #include <linux/smp.h>
61 +#include <linux/kexec.h>
65 @@ -770,6 +771,23 @@ static int __init customize_machine(void
67 arch_initcall(customize_machine);
71 +/* Physical addr of where the boot params should be for this machine */
72 +extern unsigned long kexec_boot_params_address;
74 +/* Physical addr of the buffer into which the boot params are copied */
75 +extern unsigned long kexec_boot_params_copy;
77 +/* Pointer to the boot params buffer, for manipulation and display */
78 +unsigned long kexec_boot_params;
79 +EXPORT_SYMBOL(kexec_boot_params);
81 +/* The buffer itself - make sure it is sized correctly */
82 +static unsigned long kexec_boot_params_buf[(KEXEC_BOOT_PARAMS_SIZE + 3) / 4];
86 void __init setup_arch(char **cmdline_p)
88 struct tag *tags = (struct tag *)&init_tags;
89 @@ -788,6 +806,18 @@ void __init setup_arch(char **cmdline_p)
90 else if (mdesc->boot_params)
91 tags = phys_to_virt(mdesc->boot_params);
94 + kexec_boot_params_copy = virt_to_phys(kexec_boot_params_buf);
95 + kexec_boot_params = (unsigned long)kexec_boot_params_buf;
96 + if (__atags_pointer) {
97 + kexec_boot_params_address = __atags_pointer;
98 + memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
99 + } else if (mdesc->boot_params) {
100 + kexec_boot_params_address = mdesc->boot_params;
101 + memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
106 * If we have the old style parameters, convert them to
108 diff -uprN linux-2.6.23.orig/include/asm-arm/kexec.h linux-2.6.23/include/asm-arm/kexec.h
109 --- linux-2.6.23.orig/include/asm-arm/kexec.h 2007-10-09 15:31:38.000000000 -0500
110 +++ linux-2.6.23/include/asm-arm/kexec.h 2007-10-09 22:19:32.000000000 -0500
113 #define KEXEC_ARCH KEXEC_ARCH_ARM
115 +#define KEXEC_BOOT_PARAMS_SIZE 1536