linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Paul Mackerras <paulus@samba.org>
Cc: Milton Miller <miltonm@bga.com>, linuxppc-dev@ozlabs.org
Subject: [PATCH 2/7] powerpc/32/kdump: Implement crash_setup_regs() using ppc_save_regs()
Date: Wed, 17 Dec 2008 23:09:01 +0300	[thread overview]
Message-ID: <20081217200901.GB4624@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20081217200610.GA31887@oksana.dev.rtsoft.ru>

This patch replaces dummy function with full-fledged crash_setup_regs()
implementation. On PPC32 we simply use ppc_save_regs function to dump
the registers.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/include/asm/kexec.h |   15 ++++++---------
 arch/powerpc/kernel/Makefile     |    2 +-
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index 3736d9b..6dbffc9 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -33,12 +33,12 @@
 
 #ifndef __ASSEMBLY__
 #include <linux/cpumask.h>
+#include <asm/reg.h>
 
 typedef void (*crash_shutdown_t)(void);
 
 #ifdef CONFIG_KEXEC
 
-#ifdef __powerpc64__
 /*
  * This function is responsible for capturing register states if coming
  * via panic or invoking dump using sysrq-trigger.
@@ -48,6 +48,7 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
 {
 	if (oldregs)
 		memcpy(newregs, oldregs, sizeof(*newregs));
+#ifdef __powerpc64__
 	else {
 		/* FIXME Merge this with xmon_save_regs ?? */
 		unsigned long tmp1, tmp2;
@@ -100,15 +101,11 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
 			: "b" (newregs)
 			: "memory");
 	}
-}
 #else
-/*
- * Provide a dummy definition to avoid build failures. Will remain
- * empty till crash dump support is enabled.
- */
-static inline void crash_setup_regs(struct pt_regs *newregs,
-					struct pt_regs *oldregs) { }
-#endif /* !__powerpc64 __ */
+	else
+		ppc_save_regs(newregs);
+#endif /* __powerpc64__ */
+}
 
 extern void kexec_smp_wait(void);	/* get and clear naca physid, wait for
 					  master to copy new code to 0 */
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 616c889..089209a 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -102,7 +102,7 @@ endif
 
 obj-$(CONFIG_PPC64)		+= $(obj64-y)
 
-ifneq ($(CONFIG_XMON),)
+ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC),)
 obj-y				+= ppc_save_regs.o
 endif
 
-- 
1.5.6.5

  parent reply	other threads:[~2008-12-17 20:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 20:06 [PATCH 0/7] Kdump support for classic PPC Anton Vorontsov
2008-12-17 20:08 ` [PATCH 1/7] powerpc: Prepare xmon_save_regs for use with kdump Anton Vorontsov
2008-12-17 20:13   ` Anton Vorontsov
2008-12-17 20:09 ` Anton Vorontsov [this message]
2008-12-17 20:09 ` [PATCH 3/7] powerpc/32: Setup OF properties for kdump Anton Vorontsov
2008-12-21  1:44   ` Paul Mackerras
2008-12-21  3:29     ` Anton Vorontsov
2008-12-17 20:09 ` [PATCH 4/7] powerpc/32: Allow to ioremap RAM addresses for kdump kernel Anton Vorontsov
2008-12-17 20:09 ` [PATCH 5/7] powerpc/32: Add the ability for a classic ppc kernel to be loaded at 32M Anton Vorontsov
2008-12-17 20:09 ` [PATCH 6/7] powerpc/32: Wire up the trampoline code for kdump Anton Vorontsov
2008-12-17 20:09 ` [PATCH 7/7] powerpc/64/kdump: Use ppc_save_regs() in crash_setup_regs() Anton Vorontsov
2009-01-07  3:16   ` Benjamin Herrenschmidt
2009-01-07  4:04     ` Anton Vorontsov
2009-01-07  5:11       ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081217200901.GB4624@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).