]> err.no Git - linux-2.6/blobdiff - arch/arm/kernel/setup.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6] / arch / arm / kernel / setup.c
index efac7df72d6563cb85048a2cb4b1680b38b96c3d..bf56eb337df16a9bc5d7c9033023202ba466cccc 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/interrupt.h>
 #include <linux/smp.h>
 #include <linux/fs.h>
+#include <linux/kexec.h>
 
 #include <asm/cpu.h>
 #include <asm/elf.h>
@@ -783,6 +784,23 @@ static int __init customize_machine(void)
 }
 arch_initcall(customize_machine);
 
+#ifdef CONFIG_KEXEC
+
+/* Physical addr of where the boot params should be for this machine */
+extern unsigned long kexec_boot_params_address;
+
+/* Physical addr of the buffer into which the boot params are copied */
+extern unsigned long kexec_boot_params_copy;
+
+/* Pointer to the boot params buffer, for manipulation and display */
+unsigned long kexec_boot_params;
+EXPORT_SYMBOL(kexec_boot_params);
+
+/* The buffer itself - make sure it is sized correctly */
+static unsigned long kexec_boot_params_buf[(KEXEC_BOOT_PARAMS_SIZE + 3) / 4];
+
+#endif
+
 void __init setup_arch(char **cmdline_p)
 {
        struct tag *tags = (struct tag *)&init_tags;
@@ -801,6 +819,18 @@ void __init setup_arch(char **cmdline_p)
        else if (mdesc->boot_params)
                tags = phys_to_virt(mdesc->boot_params);
 
+#ifdef CONFIG_KEXEC
+       kexec_boot_params_copy = virt_to_phys(kexec_boot_params_buf);
+       kexec_boot_params = (unsigned long)kexec_boot_params_buf;
+       if (__atags_pointer) {
+               kexec_boot_params_address = __atags_pointer;
+               memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
+       } else if (mdesc->boot_params) {
+               kexec_boot_params_address = mdesc->boot_params;
+               memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
+       }
+#endif
+
        /*
         * If we have the old style parameters, convert them to
         * a tag list.