aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorJon Medhurst <tixy@yxit.co.uk>2011-06-09 07:11:27 -0400
committerTixy <tixy@medhuaa1.miniserver.com>2011-07-13 13:32:42 -0400
commitc6a7d97d57ef41477a85f4c0f48ea5243132ee1f (patch)
tree8803e688ba6c016e9f05de460d2571576fed2da8 /arch/arm/include
parent3b26945597d5eff5d428a268c9d109338fce801e (diff)
ARM: kprobes: Add hooks to override singlestep()
When a probe fires we must single-step the instruction which was replaced by a breakpoint. As the steps to do this vary between ARM and Thumb instructions we need a way to customise single-stepping. This is done by adding a new hook called insn_singlestep to arch_specific_insn which is initialised by the instruction decoding functions. These single-step hooks must update PC and call the instruction handler. For Thumb instructions an additional step of updating ITSTATE is needed. We do this after calling the handler because some handlers will need to test if they are running in an IT block. Signed-off-by: Jon Medhurst <tixy@yxit.co.uk> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/kprobes.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h
index 57d37d52d71..1e9ff56d40c 100644
--- a/arch/arm/include/asm/kprobes.h
+++ b/arch/arm/include/asm/kprobes.h
@@ -32,14 +32,15 @@ typedef u32 kprobe_opcode_t;
32 32
33struct kprobe; 33struct kprobe;
34typedef void (kprobe_insn_handler_t)(struct kprobe *, struct pt_regs *); 34typedef void (kprobe_insn_handler_t)(struct kprobe *, struct pt_regs *);
35
36typedef unsigned long (kprobe_check_cc)(unsigned long); 35typedef unsigned long (kprobe_check_cc)(unsigned long);
36typedef void (kprobe_insn_singlestep_t)(struct kprobe *, struct pt_regs *);
37 37
38/* Architecture specific copy of original instruction. */ 38/* Architecture specific copy of original instruction. */
39struct arch_specific_insn { 39struct arch_specific_insn {
40 kprobe_opcode_t *insn; 40 kprobe_opcode_t *insn;
41 kprobe_insn_handler_t *insn_handler; 41 kprobe_insn_handler_t *insn_handler;
42 kprobe_check_cc *insn_check_cc; 42 kprobe_check_cc *insn_check_cc;
43 kprobe_insn_singlestep_t *insn_singlestep;
43}; 44};
44 45
45struct prev_kprobe { 46struct prev_kprobe {