From 263e368a2f1f960db07d7524a4a3e7df951f1f72 Mon Sep 17 00:00:00 2001 From: Jon Medhurst Date: Fri, 10 Jun 2011 20:29:04 +0100 Subject: 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 Acked-by: Nicolas Pitre --- arch/arm/kernel/kprobes-common.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arch/arm/kernel/kprobes-common.c') diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c index 3a3e765..86fdc4c 100644 --- a/arch/arm/kernel/kprobes-common.c +++ b/arch/arm/kernel/kprobes-common.c @@ -45,9 +45,24 @@ void __init find_str_pc_offset(void) #endif /* !find_str_pc_offset */ +#ifndef test_load_write_pc_interworking + +bool load_write_pc_interworks; + +void __init test_load_write_pc_interworking(void) +{ + int arch = cpu_architecture(); + BUG_ON(arch == CPU_ARCH_UNKNOWN); + load_write_pc_interworks = arch >= CPU_ARCH_ARMv5T; +} + +#endif /* !test_load_write_pc_interworking */ + + void __init arm_kprobe_decode_init(void) { find_str_pc_offset(); + test_load_write_pc_interworking(); } -- cgit v1.1