From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@au1.ibm.com>,
linuxppc-dev <linuxppc-dev@ozlabs.org>
Cc: Mike Frysinger <vapier@gentoo.org>
Subject: Re: [PATCH v2 ] Implement GET_IP/SET_IP for powerpc architecture.
Date: Wed, 8 Feb 2012 20:23:13 +0530 [thread overview]
Message-ID: <20120208145124.GA16600@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120202144125.GA6221@linux.vnet.ibm.com>
With this change, helpers such as instruction_pointer() et al, get defined
in the generic header in terms of GET_IP
Removed the unnecessary definition of profile_pc in !CONFIG_SMP case as
suggested by Mike Frysinger.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---
arch/powerpc/include/asm/ptrace.h | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index 78a2051..84cc784 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -83,8 +83,18 @@ struct pt_regs {
#ifndef __ASSEMBLY__
-#define instruction_pointer(regs) ((regs)->nip)
-#define user_stack_pointer(regs) ((regs)->gpr[1])
+#define GET_IP(regs) ((regs)->nip)
+#define GET_USP(regs) ((regs)->gpr[1])
+#define GET_FP(regs) (0)
+#define SET_FP(regs, val)
+
+#ifdef CONFIG_SMP
+extern unsigned long profile_pc(struct pt_regs *regs);
+#define profile_pc profile_pc
+#endif
+
+#include <asm-generic/ptrace.h>
+
#define kernel_stack_pointer(regs) ((regs)->gpr[1])
static inline int is_syscall_success(struct pt_regs *regs)
{
@@ -99,12 +109,6 @@ static inline long regs_return_value(struct pt_regs *regs)
return -regs->gpr[3];
}
-#ifdef CONFIG_SMP
-extern unsigned long profile_pc(struct pt_regs *regs);
-#else
-#define profile_pc(regs) instruction_pointer(regs)
-#endif
-
#ifdef __powerpc64__
#define user_mode(regs) ((((regs)->msr) >> MSR_PR_LG) & 0x1)
#else
next prev parent reply other threads:[~2012-02-08 15:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-02 14:41 [PATCH] Implement GET_IP/SET_IP for powerpc architecture Srikar Dronamraju
2012-02-02 16:28 ` Mike Frysinger
2012-02-02 16:36 ` Srikar Dronamraju
2012-02-02 17:02 ` Mike Frysinger
2012-02-02 21:23 ` Benjamin Herrenschmidt
2012-02-08 14:53 ` Srikar Dronamraju [this message]
2012-02-09 2:56 ` [PATCH v2 ] " Mike Frysinger
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=20120208145124.GA16600@linux.vnet.ibm.com \
--to=srikar@linux.vnet.ibm.com \
--cc=benh@au1.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=vapier@gentoo.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).