aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/probes-arm.c
diff options
context:
space:
mode:
authorDavid A. Long <dave.long@linaro.org>2014-03-05 21:41:29 -0500
committerDavid A. Long <dave.long@linaro.org>2014-03-18 16:39:40 -0400
commitb4cd605ca92d9a8a2f71355cb45dd943ebcb0c97 (patch)
tree01f6832e2d9f98344b5913efdb257447f4241742 /arch/arm/kernel/probes-arm.c
parent602cd2609eee92d338a83e400774e97c60535ba2 (diff)
ARM: Make arch_specific_insn a define for new arch_probes_insn structure
Because the common underlying code for ARM kprobes and uprobes needs to share a common architecrure-specific context structure, and because the generic kprobes include file insists on defining this to a dummy structure when kprobes is not configured, a new common structure is required which can exist when uprobes is configured without kprobes. In this case kprobes will define a dummy structure, but without the define aliasing the two structure tags it will not affect uprobes and the shared probes code. Signed-off-by: David A. Long <dave.long@linaro.org> Acked-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'arch/arm/kernel/probes-arm.c')
-rw-r--r--arch/arm/kernel/probes-arm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm/kernel/probes-arm.c b/arch/arm/kernel/probes-arm.c
index 8e7fde876521..51a13a027989 100644
--- a/arch/arm/kernel/probes-arm.c
+++ b/arch/arm/kernel/probes-arm.c
@@ -58,7 +58,7 @@
58 */ 58 */
59 59
60void __kprobes simulate_bbl(probes_opcode_t insn, 60void __kprobes simulate_bbl(probes_opcode_t insn,
61 struct arch_specific_insn *asi, struct pt_regs *regs) 61 struct arch_probes_insn *asi, struct pt_regs *regs)
62{ 62{
63 long iaddr = (long) regs->ARM_pc - 4; 63 long iaddr = (long) regs->ARM_pc - 4;
64 int disp = branch_displacement(insn); 64 int disp = branch_displacement(insn);
@@ -70,7 +70,7 @@ void __kprobes simulate_bbl(probes_opcode_t insn,
70} 70}
71 71
72void __kprobes simulate_blx1(probes_opcode_t insn, 72void __kprobes simulate_blx1(probes_opcode_t insn,
73 struct arch_specific_insn *asi, struct pt_regs *regs) 73 struct arch_probes_insn *asi, struct pt_regs *regs)
74{ 74{
75 long iaddr = (long) regs->ARM_pc - 4; 75 long iaddr = (long) regs->ARM_pc - 4;
76 int disp = branch_displacement(insn); 76 int disp = branch_displacement(insn);
@@ -81,7 +81,7 @@ void __kprobes simulate_blx1(probes_opcode_t insn,
81} 81}
82 82
83void __kprobes simulate_blx2bx(probes_opcode_t insn, 83void __kprobes simulate_blx2bx(probes_opcode_t insn,
84 struct arch_specific_insn *asi, struct pt_regs *regs) 84 struct arch_probes_insn *asi, struct pt_regs *regs)
85{ 85{
86 int rm = insn & 0xf; 86 int rm = insn & 0xf;
87 long rmv = regs->uregs[rm]; 87 long rmv = regs->uregs[rm];
@@ -96,7 +96,7 @@ void __kprobes simulate_blx2bx(probes_opcode_t insn,
96} 96}
97 97
98void __kprobes simulate_mrs(probes_opcode_t insn, 98void __kprobes simulate_mrs(probes_opcode_t insn,
99 struct arch_specific_insn *asi, struct pt_regs *regs) 99 struct arch_probes_insn *asi, struct pt_regs *regs)
100{ 100{
101 int rd = (insn >> 12) & 0xf; 101 int rd = (insn >> 12) & 0xf;
102 unsigned long mask = 0xf8ff03df; /* Mask out execution state */ 102 unsigned long mask = 0xf8ff03df; /* Mask out execution state */
@@ -104,7 +104,7 @@ void __kprobes simulate_mrs(probes_opcode_t insn,
104} 104}
105 105
106void __kprobes simulate_mov_ipsp(probes_opcode_t insn, 106void __kprobes simulate_mov_ipsp(probes_opcode_t insn,
107 struct arch_specific_insn *asi, struct pt_regs *regs) 107 struct arch_probes_insn *asi, struct pt_regs *regs)
108{ 108{
109 regs->uregs[12] = regs->uregs[13]; 109 regs->uregs[12] = regs->uregs[13];
110} 110}
@@ -705,7 +705,7 @@ EXPORT_SYMBOL_GPL(probes_decode_arm_table);
705#endif 705#endif
706 706
707static void __kprobes arm_singlestep(probes_opcode_t insn, 707static void __kprobes arm_singlestep(probes_opcode_t insn,
708 struct arch_specific_insn *asi, struct pt_regs *regs) 708 struct arch_probes_insn *asi, struct pt_regs *regs)
709{ 709{
710 regs->ARM_pc += 4; 710 regs->ARM_pc += 4;
711 asi->insn_handler(insn, asi, regs); 711 asi->insn_handler(insn, asi, regs);
@@ -724,7 +724,7 @@ static void __kprobes arm_singlestep(probes_opcode_t insn,
724 * should also be very rare. 724 * should also be very rare.
725 */ 725 */
726enum probes_insn __kprobes 726enum probes_insn __kprobes
727arm_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi, 727arm_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
728 bool emulate, const union decode_action *actions) 728 bool emulate, const union decode_action *actions)
729{ 729{
730 asi->insn_singlestep = arm_singlestep; 730 asi->insn_singlestep = arm_singlestep;