[ARM] add machine-specific hook to machine_kexec
authorEric Cooper <ecc@cmu.edu>
Wed, 2 Feb 2011 22:16:09 +0000 (17:16 -0500)
committerNicolas Pitre <nico@fluxnic.net>
Thu, 3 Mar 2011 21:26:55 +0000 (16:26 -0500)
Provide the option to call a machine-specific function
before kexec'ing a new kernel.

Signed-off-by: Eric Cooper <ecc@cmu.edu>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
arch/arm/include/asm/kexec.h
arch/arm/kernel/machine_kexec.c

index c0094d8edae45c1d331b0ec6a63a0105ee8a109a..c2b9b4bdec00dec88b0b81094c659780c5c63b95 100644 (file)
@@ -50,6 +50,9 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
        }
 }
 
+/* Function pointer to optional machine-specific reinitialization */
+extern void (*kexec_reinit)(void);
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* CONFIG_KEXEC */
index 30ead135ff5f48350192291a32662b0d3d0429d5..e59bbd496c39174da0a6ee4094fe6f717df97a67 100644 (file)
@@ -75,6 +75,11 @@ void machine_crash_shutdown(struct pt_regs *regs)
        printk(KERN_INFO "Loading crashdump kernel...\n");
 }
 
+/*
+ * Function pointer to optional machine-specific reinitialization
+ */
+void (*kexec_reinit)(void);
+
 void machine_kexec(struct kimage *image)
 {
        unsigned long page_list;
@@ -104,6 +109,8 @@ void machine_kexec(struct kimage *image)
                           (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
        printk(KERN_INFO "Bye!\n");
 
+       if (kexec_reinit)
+               kexec_reinit();
        local_irq_disable();
        local_fiq_disable();
        setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/