aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorEric Cooper <ecc@cmu.edu>2011-02-02 17:16:09 -0500
committerNicolas Pitre <nico@fluxnic.net>2011-03-03 16:26:55 -0500
commit868d172b8ac23070418ec6265195e88e8d5dbe92 (patch)
tree7e7b0b853c92c6ed96c8d61828ab0c4fe3cd4cb4 /arch
parente25bac968d41d994e5295f89547bdff6cb40588a (diff)
[ARM] add machine-specific hook to machine_kexec
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/kexec.h3
-rw-r--r--arch/arm/kernel/machine_kexec.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/include/asm/kexec.h b/arch/arm/include/asm/kexec.h
index c0094d8edae..c2b9b4bdec0 100644
--- a/arch/arm/include/asm/kexec.h
+++ b/arch/arm/include/asm/kexec.h
@@ -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 */
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 30ead135ff5..e59bbd496c3 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -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*/