diff options
author | Jon Medhurst <tixy@yxit.co.uk> | 2011-07-07 05:21:40 -0400 |
---|---|---|
committer | Tixy <tixy@medhuaa1.miniserver.com> | 2011-07-13 13:32:41 -0400 |
commit | 6c8df3300f60cae54aeb2a6dda8efe7ffe16a322 (patch) | |
tree | c7cac1abd0d5a46db1a4b4b3785238874822218b /arch/arm/kernel/kprobes-arm.c | |
parent | 1b59d874660be7f790861ad849858cc009089515 (diff) |
ARM: kprobes: Move find_str_pc_offset into kprobes-common.c
Move str_pc_offset into kprobes-common.c as it will be needed by common
code later.
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/kernel/kprobes-arm.c')
-rw-r--r-- | arch/arm/kernel/kprobes-arm.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c index 3c4678edcbf8..0262b29163d1 100644 --- a/arch/arm/kernel/kprobes-arm.c +++ b/arch/arm/kernel/kprobes-arm.c | |||
@@ -92,29 +92,6 @@ union reg_pair { | |||
92 | }; | 92 | }; |
93 | 93 | ||
94 | /* | 94 | /* |
95 | * For STR and STM instructions, an ARM core may choose to use either | ||
96 | * a +8 or a +12 displacement from the current instruction's address. | ||
97 | * Whichever value is chosen for a given core, it must be the same for | ||
98 | * both instructions and may not change. This function measures it. | ||
99 | */ | ||
100 | |||
101 | static int str_pc_offset; | ||
102 | |||
103 | static void __init find_str_pc_offset(void) | ||
104 | { | ||
105 | int addr, scratch, ret; | ||
106 | |||
107 | __asm__ ( | ||
108 | "sub %[ret], pc, #4 \n\t" | ||
109 | "str pc, %[addr] \n\t" | ||
110 | "ldr %[scr], %[addr] \n\t" | ||
111 | "sub %[ret], %[scr], %[ret] \n\t" | ||
112 | : [ret] "=r" (ret), [scr] "=r" (scratch), [addr] "+m" (addr)); | ||
113 | |||
114 | str_pc_offset = ret; | ||
115 | } | ||
116 | |||
117 | /* | ||
118 | * The insnslot_?arg_r[w]flags() functions below are to keep the | 95 | * The insnslot_?arg_r[w]flags() functions below are to keep the |
119 | * msr -> *fn -> mrs instruction sequences indivisible so that | 96 | * msr -> *fn -> mrs instruction sequences indivisible so that |
120 | * the state of the CPSR flags aren't inadvertently modified | 97 | * the state of the CPSR flags aren't inadvertently modified |
@@ -1569,8 +1546,3 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi) | |||
1569 | 1546 | ||
1570 | return space_cccc_11xx(insn, asi); | 1547 | return space_cccc_11xx(insn, asi); |
1571 | } | 1548 | } |
1572 | |||
1573 | void __init arm_kprobe_decode_init(void) | ||
1574 | { | ||
1575 | find_str_pc_offset(); | ||
1576 | } | ||