Commit 868d172b authored by Eric Cooper's avatar Eric Cooper Committed by Nicolas Pitre

[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: default avatarEric Cooper <ecc@cmu.edu>
Signed-off-by: default avatarNicolas Pitre <nico@fluxnic.net>
parent e25bac96
...@@ -50,6 +50,9 @@ static inline void crash_setup_regs(struct pt_regs *newregs, ...@@ -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 /* __ASSEMBLY__ */
#endif /* CONFIG_KEXEC */ #endif /* CONFIG_KEXEC */
......
...@@ -75,6 +75,11 @@ void machine_crash_shutdown(struct pt_regs *regs) ...@@ -75,6 +75,11 @@ void machine_crash_shutdown(struct pt_regs *regs)
printk(KERN_INFO "Loading crashdump kernel...\n"); printk(KERN_INFO "Loading crashdump kernel...\n");
} }
/*
* Function pointer to optional machine-specific reinitialization
*/
void (*kexec_reinit)(void);
void machine_kexec(struct kimage *image) void machine_kexec(struct kimage *image)
{ {
unsigned long page_list; unsigned long page_list;
...@@ -104,6 +109,8 @@ void machine_kexec(struct kimage *image) ...@@ -104,6 +109,8 @@ void machine_kexec(struct kimage *image)
(unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
printk(KERN_INFO "Bye!\n"); printk(KERN_INFO "Bye!\n");
if (kexec_reinit)
kexec_reinit();
local_irq_disable(); local_irq_disable();
local_fiq_disable(); local_fiq_disable();
setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/ setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment