1 Index: linux-2.6.23.17/arch/arm/kernel/relocate_kernel.S
2 ===================================================================
3 --- linux-2.6.23.17.orig/arch/arm/kernel/relocate_kernel.S
4 +++ linux-2.6.23.17/arch/arm/kernel/relocate_kernel.S
6 .globl relocate_new_kernel
9 + /* Move boot params back to where the kernel expects them */
11 + ldr r0,kexec_boot_params_address
15 + ldr r1,kexec_boot_params_copy
16 + mov r6,#KEXEC_BOOT_PARAMS_SIZE/4
24 + /* Boot params moved, now go on with the kernel */
26 ldr r0,kexec_indirection_page
27 ldr r1,kexec_start_address
29 @@ -50,7 +67,7 @@ relocate_new_kernel:
32 ldr r1,kexec_mach_type
34 + ldr r2,kexec_boot_params_address
37 .globl kexec_start_address
38 @@ -65,6 +82,16 @@ kexec_indirection_page:
42 + /* phy addr where new kernel will expect to find boot params */
43 + .globl kexec_boot_params_address
44 +kexec_boot_params_address:
47 + /* phy addr where old kernel put a copy of orig boot params */
48 + .globl kexec_boot_params_copy
49 +kexec_boot_params_copy:
52 relocate_new_kernel_end:
54 .globl relocate_new_kernel_size
55 Index: linux-2.6.23.17/arch/arm/kernel/setup.c
56 ===================================================================
57 --- linux-2.6.23.17.orig/arch/arm/kernel/setup.c
58 +++ linux-2.6.23.17/arch/arm/kernel/setup.c
60 #include <linux/interrupt.h>
61 #include <linux/smp.h>
63 +#include <linux/kexec.h>
67 @@ -770,6 +771,23 @@ static int __init customize_machine(void
69 arch_initcall(customize_machine);
73 +/* Physical addr of where the boot params should be for this machine */
74 +extern unsigned long kexec_boot_params_address;
76 +/* Physical addr of the buffer into which the boot params are copied */
77 +extern unsigned long kexec_boot_params_copy;
79 +/* Pointer to the boot params buffer, for manipulation and display */
80 +unsigned long kexec_boot_params;
81 +EXPORT_SYMBOL(kexec_boot_params);
83 +/* The buffer itself - make sure it is sized correctly */
84 +static unsigned long kexec_boot_params_buf[(KEXEC_BOOT_PARAMS_SIZE + 3) / 4];
88 void __init setup_arch(char **cmdline_p)
90 struct tag *tags = (struct tag *)&init_tags;
91 @@ -788,6 +806,18 @@ void __init setup_arch(char **cmdline_p)
92 else if (mdesc->boot_params)
93 tags = phys_to_virt(mdesc->boot_params);
96 + kexec_boot_params_copy = virt_to_phys(kexec_boot_params_buf);
97 + kexec_boot_params = (unsigned long)kexec_boot_params_buf;
98 + if (__atags_pointer) {
99 + kexec_boot_params_address = __atags_pointer;
100 + memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
101 + } else if (mdesc->boot_params) {
102 + kexec_boot_params_address = mdesc->boot_params;
103 + memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
108 * If we have the old style parameters, convert them to
110 Index: linux-2.6.23.17/include/asm-arm/kexec.h
111 ===================================================================
112 --- linux-2.6.23.17.orig/include/asm-arm/kexec.h
113 +++ linux-2.6.23.17/include/asm-arm/kexec.h
116 #define KEXEC_ARCH KEXEC_ARCH_ARM
118 +#define KEXEC_BOOT_PARAMS_SIZE 1536