diff options
author | Ananth N Mavinakayanahalli <ananth@in.ibm.com> | 2012-08-23 21:26:02 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-05 15:19:36 +1000 |
commit | 7118e7e648e0a902bf4f38c55a25fcff730f33d7 (patch) | |
tree | 816cd359fe6fa055b2d6cadfd00645f927de8eac /arch/powerpc/include/asm/kprobes.h | |
parent | d3dbeef657fdc9e870e0b01f811bbb906af052f8 (diff) | |
download | op-kernel-dev-7118e7e648e0a902bf4f38c55a25fcff730f33d7.zip op-kernel-dev-7118e7e648e0a902bf4f38c55a25fcff730f33d7.tar.gz |
powerpc: Consolidate {k,u}probe definitions
Move is_trap() and relatives to a common file to be shared between kprobes
and uprobes.
Code movement only; no change in functionality.
Suggested by Michael Ellerman.
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/kprobes.h')
-rw-r--r-- | arch/powerpc/include/asm/kprobes.h | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/arch/powerpc/include/asm/kprobes.h b/arch/powerpc/include/asm/kprobes.h index be0171a..dc58197 100644 --- a/arch/powerpc/include/asm/kprobes.h +++ b/arch/powerpc/include/asm/kprobes.h @@ -29,21 +29,16 @@ #include <linux/types.h> #include <linux/ptrace.h> #include <linux/percpu.h> +#include <asm/probes.h> #define __ARCH_WANT_KPROBES_INSN_SLOT struct pt_regs; struct kprobe; -typedef unsigned int kprobe_opcode_t; -#define BREAKPOINT_INSTRUCTION 0x7fe00008 /* trap */ +typedef opcode_t kprobe_opcode_t; #define MAX_INSN_SIZE 1 -#define IS_TW(instr) (((instr) & 0xfc0007fe) == 0x7c000008) -#define IS_TD(instr) (((instr) & 0xfc0007fe) == 0x7c000088) -#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) -#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) - #ifdef CONFIG_PPC64 /* * 64bit powerpc uses function descriptors. @@ -72,12 +67,6 @@ typedef unsigned int kprobe_opcode_t; addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); \ } \ } - -#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ - IS_TWI(instr) || IS_TDI(instr)) -#else -/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */ -#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr)) #endif #define flush_insn_slot(p) do { } while (0) |