Commit 73753313 authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Paul Mackerras

powerpc/32/kdump: Implement crash_setup_regs() using ppc_save_regs()

This replaces the dummy crash_setup_regs function with full-fledged
crash_setup_regs implementation.  On PPC32 we simply use the new
ppc_save_regs function to dump the registers.
Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 322b4394
...@@ -33,12 +33,12 @@ ...@@ -33,12 +33,12 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/cpumask.h> #include <linux/cpumask.h>
#include <asm/reg.h>
typedef void (*crash_shutdown_t)(void); typedef void (*crash_shutdown_t)(void);
#ifdef CONFIG_KEXEC #ifdef CONFIG_KEXEC
#ifdef __powerpc64__
/* /*
* This function is responsible for capturing register states if coming * This function is responsible for capturing register states if coming
* via panic or invoking dump using sysrq-trigger. * via panic or invoking dump using sysrq-trigger.
...@@ -48,6 +48,7 @@ static inline void crash_setup_regs(struct pt_regs *newregs, ...@@ -48,6 +48,7 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
{ {
if (oldregs) if (oldregs)
memcpy(newregs, oldregs, sizeof(*newregs)); memcpy(newregs, oldregs, sizeof(*newregs));
#ifdef __powerpc64__
else { else {
/* FIXME Merge this with xmon_save_regs ?? */ /* FIXME Merge this with xmon_save_regs ?? */
unsigned long tmp1, tmp2; unsigned long tmp1, tmp2;
...@@ -100,15 +101,11 @@ static inline void crash_setup_regs(struct pt_regs *newregs, ...@@ -100,15 +101,11 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
: "b" (newregs) : "b" (newregs)
: "memory"); : "memory");
} }
}
#else #else
/* else
* Provide a dummy definition to avoid build failures. Will remain ppc_save_regs(newregs);
* empty till crash dump support is enabled. #endif /* __powerpc64__ */
*/ }
static inline void crash_setup_regs(struct pt_regs *newregs,
struct pt_regs *oldregs) { }
#endif /* !__powerpc64 __ */
extern void kexec_smp_wait(void); /* get and clear naca physid, wait for extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
master to copy new code to 0 */ master to copy new code to 0 */
......
...@@ -102,7 +102,7 @@ endif ...@@ -102,7 +102,7 @@ endif
obj-$(CONFIG_PPC64) += $(obj64-y) obj-$(CONFIG_PPC64) += $(obj64-y)
ifneq ($(CONFIG_XMON),) ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC),)
obj-y += ppc_save_regs.o obj-y += ppc_save_regs.o
endif endif
......
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