
From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>

Here is a patch that adds a wrapper for defining jprobe.entry to make
t easy to handle the three dword function descriptors defined by the
PowerPC ELF ABI.

x86, ppc64 and x86_64 are also updated.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/asm-i386/kprobes.h    |    2 ++
 25-akpm/include/asm-ppc64/kprobes.h   |    2 ++
 25-akpm/include/asm-sparc64/kprobes.h |    2 ++
 25-akpm/include/asm-x86_64/kprobes.h  |    2 ++
 4 files changed, 8 insertions(+)

diff -puN include/asm-i386/kprobes.h~kprobes-wrapper-to-define-jprobeentry include/asm-i386/kprobes.h
--- 25/include/asm-i386/kprobes.h~kprobes-wrapper-to-define-jprobeentry	2004-11-18 23:21:58.195979632 -0800
+++ 25-akpm/include/asm-i386/kprobes.h	2004-11-18 23:21:58.203978416 -0800
@@ -38,6 +38,8 @@ typedef u8 kprobe_opcode_t;
 	? (MAX_STACK_SIZE) \
 	: (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
 
+#define JPROBE_ENTRY(pentry)	(kprobe_opcode_t *)pentry
+
 /* Architecture specific copy of original instruction*/
 struct arch_specific_insn {
 	/* copy of the original instruction */
diff -puN include/asm-ppc64/kprobes.h~kprobes-wrapper-to-define-jprobeentry include/asm-ppc64/kprobes.h
--- 25/include/asm-ppc64/kprobes.h~kprobes-wrapper-to-define-jprobeentry	2004-11-18 23:21:58.196979480 -0800
+++ 25-akpm/include/asm-ppc64/kprobes.h	2004-11-18 23:21:58.204978264 -0800
@@ -35,6 +35,8 @@ typedef unsigned int kprobe_opcode_t;
 #define BREAKPOINT_INSTRUCTION	0x7fe00008	/* trap */
 #define MAX_INSN_SIZE 1
 
+#define JPROBE_ENTRY(pentry)	(kprobe_opcode_t *)((func_descr_t *)pentry)
+
 /* Architecture specific copy of original instruction */
 struct arch_specific_insn {
 	/* copy of original instruction */
diff -puN include/asm-sparc64/kprobes.h~kprobes-wrapper-to-define-jprobeentry include/asm-sparc64/kprobes.h
--- 25/include/asm-sparc64/kprobes.h~kprobes-wrapper-to-define-jprobeentry	2004-11-18 23:21:58.198979176 -0800
+++ 25-akpm/include/asm-sparc64/kprobes.h	2004-11-18 23:21:58.204978264 -0800
@@ -10,6 +10,8 @@ typedef u32 kprobe_opcode_t;
 #define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
 #define MAX_INSN_SIZE 2
 
+#define JPROBE_ENTRY(pentry)	(kprobe_opcode_t *)pentry
+
 /* Architecture specific copy of original instruction*/
 struct arch_specific_insn {
 	/* copy of the original instruction */
diff -puN include/asm-x86_64/kprobes.h~kprobes-wrapper-to-define-jprobeentry include/asm-x86_64/kprobes.h
--- 25/include/asm-x86_64/kprobes.h~kprobes-wrapper-to-define-jprobeentry	2004-11-18 23:21:58.199979024 -0800
+++ 25-akpm/include/asm-x86_64/kprobes.h	2004-11-18 23:21:58.204978264 -0800
@@ -37,6 +37,8 @@ typedef u8 kprobe_opcode_t;
 	? (MAX_STACK_SIZE) \
 	: (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
 
+#define JPROBE_ENTRY(pentry)	(kprobe_opcode_t *)pentry
+
 /* Architecture specific copy of original instruction*/
 struct arch_specific_insn {
 	/* copy of the original instruction */
_
