diff options
author | Jon Medhurst <tixy@yxit.co.uk> | 2011-04-19 17:18:35 +0100 |
---|---|---|
committer | Tixy <tixy@medhuaa1.miniserver.com> | 2011-07-13 17:32:42 +0000 |
commit | aceb487ab2ea0dca43f5131e456f45bc9f8c1bed (patch) | |
tree | ef146fd590795a13a477961afb60f5468d38f566 /arch/arm/kernel/kprobes.h | |
parent | 856bc356394a28edb8c388e31212f6ceb0a04ce6 (diff) | |
download | op-kernel-dev-aceb487ab2ea0dca43f5131e456f45bc9f8c1bed.zip op-kernel-dev-aceb487ab2ea0dca43f5131e456f45bc9f8c1bed.tar.gz |
ARM: kprobes: Add Thumb breakpoint support
Extend the breakpoint insertion and catching functions to support Thumb
code.
As breakpoints are no longer of a fixed size, the flush_insns macro
is modified to take a size argument instead of an instruction count.
Note, we need both 16- and 32-bit Thumb breakpoints, because if we
were to use a 16-bit breakpoint to replace a 32-bit instruction which
was in an IT block, and the condition check failed, then the breakpoint
may not fire (it's unpredictable behaviour) and the CPU could then try
and execute the second half of the 32-bit Thumb instruction.
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/kernel/kprobes.h')
-rw-r--r-- | arch/arm/kernel/kprobes.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/kernel/kprobes.h b/arch/arm/kernel/kprobes.h index 86abfab..a84b14d8 100644 --- a/arch/arm/kernel/kprobes.h +++ b/arch/arm/kernel/kprobes.h @@ -18,10 +18,13 @@ #define _ARM_KERNEL_KPROBES_H /* - * This undefined instruction must be unique and + * These undefined instructions must be unique and * reserved solely for kprobes' use. */ -#define KPROBE_BREAKPOINT_INSTRUCTION 0xe7f001f8 +#define KPROBE_ARM_BREAKPOINT_INSTRUCTION 0xe7f001f8 +#define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18 +#define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018 + enum kprobe_insn { INSN_REJECTED, |