All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: systemtap@sourceware.org
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH 5/8] Share ppc64 and ppc32 code where possible
Date: Sat, 28 Nov 2009 01:33:45 +0300	[thread overview]
Message-ID: <20091127223345.GE21805@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20091127223251.GA17065@oksana.dev.rtsoft.ru>

* runtime/copy.c: Can use ppc64's code.
* runtime/regs.h: Ditto.
* runtime/string.h: Ditto.
* tapset/context.stp: Ditto.
* tapset/errno.stp: Ditto.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 runtime/copy.c     |    2 +-
 runtime/regs.h     |    2 +-
 runtime/string.h   |    6 +++---
 tapset/context.stp |    2 +-
 tapset/errno.stp   |    2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/runtime/copy.c b/runtime/copy.c
index 4fb8725..40f1511 100644
--- a/runtime/copy.c
+++ b/runtime/copy.c
@@ -105,7 +105,7 @@ do {									   \
 		: "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
 		: "memory");						   \
 } while (0)
-#elif defined (__powerpc64__) || defined (__ia64__) || defined (__arm__)
+#elif defined (__powerpc__) || defined (__ia64__) || defined (__arm__)
 #define __stp_strncpy_from_user(dst,src,count,res) \
 	do { res = __strncpy_from_user(dst, src, count); } while(0)
 
diff --git a/runtime/regs.h b/runtime/regs.h
index dc6b50a..08449aa 100644
--- a/runtime/regs.h
+++ b/runtime/regs.h
@@ -36,7 +36,7 @@
   (((regs)->cr_iip = (x) & ~3UL), (ia64_psr(regs)->ri = (x) & 3UL))
 
 
-#elif defined (__powerpc64__)
+#elif defined (__powerpc__)
 
 #define REG_IP(regs) regs->nip
 #define REG_SP(regs) regs->gpr[1]
diff --git a/runtime/string.h b/runtime/string.h
index f4d4cc0..b08304e 100644
--- a/runtime/string.h
+++ b/runtime/string.h
@@ -19,14 +19,14 @@ static void _stp_text_str(char *out, char *in, int len, int quoted, int user);
  * is provided without the paranoid check. Use it if available, fall back
  * to __get_user() if not. Other archs can use __get_user() as is
  */
-#ifdef __powerpc64__
+#if defined(__powerpc__)
 #ifdef __get_user_inatomic
 #define __stp_get_user(x, ptr) __get_user_inatomic(x, ptr)
 #else /* __get_user_inatomic */
 #define __stp_get_user(x, ptr) __get_user(x, ptr)
 #endif /* __get_user_inatomic */
-#else /* __powerpc64__ */
+#else /* defined(__powerpc__) */
 #define __stp_get_user(x, ptr) __get_user(x, ptr)
-#endif /* __powerpc64__ */
+#endif /* defined(__powerpc__) */
 
 #endif /* _STRING_H_ */
diff --git a/tapset/context.stp b/tapset/context.stp
index 36701e6..b30f7dc 100644
--- a/tapset/context.stp
+++ b/tapset/context.stp
@@ -15,7 +15,7 @@
 %{
 #include <asm/processor.h>
 
-#if defined(__powerpc64__)
+#if defined(__powerpc__)
 #if !defined(task_pt_regs)
 #define task_pt_regs(tsk)       ((struct pt_regs *)(tsk)->thread.regs)
 #endif
diff --git a/tapset/errno.stp b/tapset/errno.stp
index 011ff7e..d4d571b 100644
--- a/tapset/errno.stp
+++ b/tapset/errno.stp
@@ -369,7 +369,7 @@ static long _stp_returnval(struct pt_regs *regs) {
 #elif defined (__x86_64__)
 		// TODO: Handle -m32 apps.
 		return regs->rax;
-#elif defined (__powerpc64__)
+#elif defined (__powerpc__)
 		return regs->gpr[3];
 #elif defined (__ia64__)
 		return regs->r8;
-- 
1.6.3.3

  parent reply	other threads:[~2009-11-27 22:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-27 22:32 [PATCH 0/8 userland!] systemtap: Add initial support for ppc32 Anton Vorontsov
2009-11-27 22:33 ` [PATCH 1/8] Rename uprobes_ppc64.c to uprobes_ppc.c, use it " Anton Vorontsov
2009-11-27 22:33 ` [PATCH 2/8] Rename stack-ppc64.c to stack-ppc.c Anton Vorontsov
2009-11-27 22:33 ` [PATCH 3/8] stack-ppc: Adjust for ppc32 Anton Vorontsov
2009-11-27 22:33 ` [PATCH 4/8] Implement ppc32 variant of __is_user_regs Anton Vorontsov
2009-11-27 22:33 ` Anton Vorontsov [this message]
2009-11-27 22:33 ` [PATCH 6/8] Use proper types for do_div Anton Vorontsov
2009-12-09 15:56   ` Mark Wielaard
2009-12-09 16:09     ` Anton Vorontsov
2009-12-09 22:47       ` Mark Wielaard
2009-11-27 22:33 ` [PATCH 7/8] Implement _div64 and _mod64 for ppc32 Anton Vorontsov
2009-11-27 22:33 ` [PATCH 8/8] Change KERNEL_RELOC_SYMBOL to "_stext" on ppc32 Anton Vorontsov
2009-12-01 17:54 ` [PATCH 0/8 userland!] systemtap: Add initial support for ppc32 Frank Ch. Eigler
2009-12-01 19:13 ` Jim Keniston

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=20091127223345.GE21805@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=systemtap@sourceware.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.