diff options
Diffstat (limited to 'arch/arm/kernel/ptrace.c')
-rw-r--r-- | arch/arm/kernel/ptrace.c | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 97260060bf2..2491f3b406b 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -228,34 +228,12 @@ static struct undef_hook thumb_break_hook = { | |||
228 | .fn = break_trap, | 228 | .fn = break_trap, |
229 | }; | 229 | }; |
230 | 230 | ||
231 | static int thumb2_break_trap(struct pt_regs *regs, unsigned int instr) | ||
232 | { | ||
233 | unsigned int instr2; | ||
234 | void __user *pc; | ||
235 | |||
236 | /* Check the second half of the instruction. */ | ||
237 | pc = (void __user *)(instruction_pointer(regs) + 2); | ||
238 | |||
239 | if (processor_mode(regs) == SVC_MODE) { | ||
240 | instr2 = *(u16 *) pc; | ||
241 | } else { | ||
242 | get_user(instr2, (u16 __user *)pc); | ||
243 | } | ||
244 | |||
245 | if (instr2 == 0xa000) { | ||
246 | ptrace_break(current, regs); | ||
247 | return 0; | ||
248 | } else { | ||
249 | return 1; | ||
250 | } | ||
251 | } | ||
252 | |||
253 | static struct undef_hook thumb2_break_hook = { | 231 | static struct undef_hook thumb2_break_hook = { |
254 | .instr_mask = 0xffff, | 232 | .instr_mask = 0xffffffff, |
255 | .instr_val = 0xf7f0, | 233 | .instr_val = 0xf7f0a000, |
256 | .cpsr_mask = PSR_T_BIT, | 234 | .cpsr_mask = PSR_T_BIT, |
257 | .cpsr_val = PSR_T_BIT, | 235 | .cpsr_val = PSR_T_BIT, |
258 | .fn = thumb2_break_trap, | 236 | .fn = break_trap, |
259 | }; | 237 | }; |
260 | 238 | ||
261 | static int __init ptrace_break_init(void) | 239 | static int __init ptrace_break_init(void) |
@@ -396,7 +374,7 @@ static long ptrace_hbp_idx_to_num(int idx) | |||
396 | /* | 374 | /* |
397 | * Handle hitting a HW-breakpoint. | 375 | * Handle hitting a HW-breakpoint. |
398 | */ | 376 | */ |
399 | static void ptrace_hbptriggered(struct perf_event *bp, int unused, | 377 | static void ptrace_hbptriggered(struct perf_event *bp, |
400 | struct perf_sample_data *data, | 378 | struct perf_sample_data *data, |
401 | struct pt_regs *regs) | 379 | struct pt_regs *regs) |
402 | { | 380 | { |
@@ -479,7 +457,8 @@ static struct perf_event *ptrace_hbp_create(struct task_struct *tsk, int type) | |||
479 | attr.bp_type = type; | 457 | attr.bp_type = type; |
480 | attr.disabled = 1; | 458 | attr.disabled = 1; |
481 | 459 | ||
482 | return register_user_hw_breakpoint(&attr, ptrace_hbptriggered, tsk); | 460 | return register_user_hw_breakpoint(&attr, ptrace_hbptriggered, NULL, |
461 | tsk); | ||
483 | } | 462 | } |
484 | 463 | ||
485 | static int ptrace_gethbpregs(struct task_struct *tsk, long num, | 464 | static int ptrace_gethbpregs(struct task_struct *tsk, long num, |