[POWERPC] kprobes: Eliminate sstep exception if instruction can be emulated
[safe/jmp/linux-2.6] / include / asm-powerpc / kprobes.h
index 2dafa37..f850ca7 100644 (file)
@@ -44,6 +44,7 @@ typedef unsigned int kprobe_opcode_t;
 #define IS_TDI(instr)          (((instr) & 0xfc000000) == 0x08000000)
 #define IS_TWI(instr)          (((instr) & 0xfc000000) == 0x0c000000)
 
+#ifdef CONFIG_PPC64
 /*
  * 64bit powerpc uses function descriptors.
  * Handle cases where:
@@ -67,9 +68,13 @@ typedef unsigned int kprobe_opcode_t;
 }
 
 #define JPROBE_ENTRY(pentry)   (kprobe_opcode_t *)((func_descr_t *)pentry)
-
 #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 JPROBE_ENTRY(pentry)   (kprobe_opcode_t *)(pentry)
+#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr))
+#endif
 
 #define ARCH_SUPPORTS_KRETPROBES
 #define  ARCH_INACTIVE_KPROBE_COUNT 1
@@ -82,6 +87,11 @@ extern void arch_remove_kprobe(struct kprobe *p);
 struct arch_specific_insn {
        /* copy of original instruction */
        kprobe_opcode_t *insn;
+       /*
+        * Set in kprobes code, initially to 0. If the instruction can be
+        * eumulated, this is set to 1, if not, to -1.
+        */
+       int boostable;
 };
 
 struct prev_kprobe {