diff options
author | Jon Medhurst <tixy@yxit.co.uk> | 2011-06-10 15:29:04 -0400 |
---|---|---|
committer | Tixy <tixy@medhuaa1.miniserver.com> | 2011-07-13 13:32:45 -0400 |
commit | 263e368a2f1f960db07d7524a4a3e7df951f1f72 (patch) | |
tree | eb8b1ba0a5d07368de5bd65b579a5f69233ddb07 /arch/arm/kernel/kprobes.h | |
parent | f39ca8b488a6c1e8db47746e1cdb841a6999edd7 (diff) |
ARM: kprobes: Add load_write_pc()
This writes a value to PC which was obtained as the result of a
LDR or LDM instruction. For ARMv5T and later this must perform
interworking.
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 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/kernel/kprobes.h b/arch/arm/kernel/kprobes.h index 12627a376bf6..5d6bf0d0a18a 100644 --- a/arch/arm/kernel/kprobes.h +++ b/arch/arm/kernel/kprobes.h | |||
@@ -109,6 +109,30 @@ static inline void __kprobes bx_write_pc(long pcv, struct pt_regs *regs) | |||
109 | regs->ARM_pc = pcv; | 109 | regs->ARM_pc = pcv; |
110 | } | 110 | } |
111 | 111 | ||
112 | |||
113 | #if __LINUX_ARM_ARCH__ >= 6 | ||
114 | |||
115 | /* Kernels built for >= ARMv6 should never run on <= ARMv5 hardware, so... */ | ||
116 | #define load_write_pc_interworks true | ||
117 | #define test_load_write_pc_interworking() | ||
118 | |||
119 | #else /* __LINUX_ARM_ARCH__ < 6 */ | ||
120 | |||
121 | /* We need run-time testing to determine if load_write_pc() should interwork. */ | ||
122 | extern bool load_write_pc_interworks; | ||
123 | void __init test_load_write_pc_interworking(void); | ||
124 | |||
125 | #endif | ||
126 | |||
127 | static inline void __kprobes load_write_pc(long pcv, struct pt_regs *regs) | ||
128 | { | ||
129 | if (load_write_pc_interworks) | ||
130 | bx_write_pc(pcv, regs); | ||
131 | else | ||
132 | regs->ARM_pc = pcv; | ||
133 | } | ||
134 | |||
135 | |||
112 | void __kprobes kprobe_simulate_nop(struct kprobe *p, struct pt_regs *regs); | 136 | void __kprobes kprobe_simulate_nop(struct kprobe *p, struct pt_regs *regs); |
113 | void __kprobes kprobe_emulate_none(struct kprobe *p, struct pt_regs *regs); | 137 | void __kprobes kprobe_emulate_none(struct kprobe *p, struct pt_regs *regs); |
114 | 138 | ||