aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-02-06 23:55:19 -0500
committerKumar Gala <galak@kernel.crashing.org>2007-02-06 23:55:19 -0500
commit8209003547c4b1006943eac8dc6c1fb6493cafda (patch)
tree37ed5742527d448f211c575fe714fe68846e0c40 /include/asm-powerpc
parent8423200553113cc031caa9b147f6150a8e26545c (diff)
[POWERPC] Added kprobes support to ppc32
Added kprobes to ppc32 platforms that have use single_step_exception. This excludes 4xx and anything Book-E since their debug mechanisms for single stepping are completely different. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/kprobes.h7
-rw-r--r--include/asm-powerpc/sstep.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 2dafa376a63f..3a5dd492588f 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -44,6 +44,7 @@ typedef unsigned int kprobe_opcode_t;
44#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) 44#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000)
45#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) 45#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000)
46 46
47#ifdef CONFIG_PPC64
47/* 48/*
48 * 64bit powerpc uses function descriptors. 49 * 64bit powerpc uses function descriptors.
49 * Handle cases where: 50 * Handle cases where:
@@ -67,9 +68,13 @@ typedef unsigned int kprobe_opcode_t;
67} 68}
68 69
69#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) 70#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
70
71#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ 71#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \
72 IS_TWI(instr) || IS_TDI(instr)) 72 IS_TWI(instr) || IS_TDI(instr))
73#else
74/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */
75#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
76#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr))
77#endif
73 78
74#define ARCH_SUPPORTS_KRETPROBES 79#define ARCH_SUPPORTS_KRETPROBES
75#define ARCH_INACTIVE_KPROBE_COUNT 1 80#define ARCH_INACTIVE_KPROBE_COUNT 1
diff --git a/include/asm-powerpc/sstep.h b/include/asm-powerpc/sstep.h
index 630a9889c07c..f593b0f9b627 100644
--- a/include/asm-powerpc/sstep.h
+++ b/include/asm-powerpc/sstep.h
@@ -21,6 +21,7 @@ struct pt_regs;
21 */ 21 */
22#define IS_MTMSRD(instr) (((instr) & 0xfc0007be) == 0x7c000124) 22#define IS_MTMSRD(instr) (((instr) & 0xfc0007be) == 0x7c000124)
23#define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024) 23#define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024)
24#define IS_RFI(instr) (((instr) & 0xfc0007fe) == 0x4c000064)
24 25
25/* Emulate instructions that cause a transfer of control. */ 26/* Emulate instructions that cause a transfer of control. */
26extern int emulate_step(struct pt_regs *regs, unsigned int instr); 27extern int emulate_step(struct pt_regs *regs, unsigned int instr);