aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/ptrace.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-01 12:15:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-01 12:15:15 -0500
commitac0f6f927db539e03e1f3f61bcd4ed57d5cde7a9 (patch)
tree816e5ac643b15c2050c64a7075f0f7e13d86ea09 /arch/arm/kernel/ptrace.c
parentb1bf9368407ae7e89d8a005bb40beb70a41df539 (diff)
parent9f33be2c3a80bdc2cc08342dd77fac87652e0548 (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (100 commits) ARM: Eliminate decompressor -Dstatic= PIC hack ARM: 5958/1: ARM: U300: fix inverted clk round rate ARM: 5956/1: misplaced parentheses ARM: 5955/1: ep93xx: move timer defines into core.c and document ARM: 5954/1: ep93xx: move gpio interrupt support to gpio.c ARM: 5953/1: ep93xx: fix broken build of clock.c ARM: 5952/1: ARM: MM: Add ARM_L1_CACHE_SHIFT_6 for handle inside each ARCH Kconfig ARM: 5949/1: NUC900 add gpio virtual memory map ARM: 5948/1: Enable timer0 to time4 clock support for nuc910 ARM: 5940/2: ARM: MMCI: remove custom DBG macro and printk ARM: make_coherent(): fix problems with highpte, part 2 MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself ARM: 5945/1: ep93xx: include correct irq.h in core.c ARM: 5933/1: amba-pl011: support hardware flow control ARM: 5930/1: Add PKMAP area description to memory.txt. ARM: 5929/1: Add checks to detect overlap of memory regions. ARM: 5928/1: Change type of VMALLOC_END to unsigned long. ARM: 5927/1: Make delimiters of DMA area globally visibly. ARM: 5926/1: Add "Virtual kernel memory..." printout. ARM: 5920/1: OMAP4: Enable L2 Cache ... Fix up trivial conflict in arch/arm/mach-mx25/clock.c
Diffstat (limited to 'arch/arm/kernel/ptrace.c')
-rw-r--r--arch/arm/kernel/ptrace.c53
1 files changed, 35 insertions, 18 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index a2ea3854cb3c..08f899fb76a6 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -499,10 +499,41 @@ static struct undef_hook thumb_break_hook = {
499 .fn = break_trap, 499 .fn = break_trap,
500}; 500};
501 501
502static int thumb2_break_trap(struct pt_regs *regs, unsigned int instr)
503{
504 unsigned int instr2;
505 void __user *pc;
506
507 /* Check the second half of the instruction. */
508 pc = (void __user *)(instruction_pointer(regs) + 2);
509
510 if (processor_mode(regs) == SVC_MODE) {
511 instr2 = *(u16 *) pc;
512 } else {
513 get_user(instr2, (u16 __user *)pc);
514 }
515
516 if (instr2 == 0xa000) {
517 ptrace_break(current, regs);
518 return 0;
519 } else {
520 return 1;
521 }
522}
523
524static struct undef_hook thumb2_break_hook = {
525 .instr_mask = 0xffff,
526 .instr_val = 0xf7f0,
527 .cpsr_mask = PSR_T_BIT,
528 .cpsr_val = PSR_T_BIT,
529 .fn = thumb2_break_trap,
530};
531
502static int __init ptrace_break_init(void) 532static int __init ptrace_break_init(void)
503{ 533{
504 register_undef_hook(&arm_break_hook); 534 register_undef_hook(&arm_break_hook);
505 register_undef_hook(&thumb_break_hook); 535 register_undef_hook(&thumb_break_hook);
536 register_undef_hook(&thumb2_break_hook);
506 return 0; 537 return 0;
507} 538}
508 539
@@ -669,7 +700,7 @@ static int ptrace_getvfpregs(struct task_struct *tsk, void __user *data)
669 union vfp_state *vfp = &thread->vfpstate; 700 union vfp_state *vfp = &thread->vfpstate;
670 struct user_vfp __user *ufp = data; 701 struct user_vfp __user *ufp = data;
671 702
672 vfp_sync_state(thread); 703 vfp_sync_hwstate(thread);
673 704
674 /* copy the floating point registers */ 705 /* copy the floating point registers */
675 if (copy_to_user(&ufp->fpregs, &vfp->hard.fpregs, 706 if (copy_to_user(&ufp->fpregs, &vfp->hard.fpregs,
@@ -692,7 +723,7 @@ static int ptrace_setvfpregs(struct task_struct *tsk, void __user *data)
692 union vfp_state *vfp = &thread->vfpstate; 723 union vfp_state *vfp = &thread->vfpstate;
693 struct user_vfp __user *ufp = data; 724 struct user_vfp __user *ufp = data;
694 725
695 vfp_sync_state(thread); 726 vfp_sync_hwstate(thread);
696 727
697 /* copy the floating point registers */ 728 /* copy the floating point registers */
698 if (copy_from_user(&vfp->hard.fpregs, &ufp->fpregs, 729 if (copy_from_user(&vfp->hard.fpregs, &ufp->fpregs,
@@ -703,6 +734,8 @@ static int ptrace_setvfpregs(struct task_struct *tsk, void __user *data)
703 if (get_user(vfp->hard.fpscr, &ufp->fpscr)) 734 if (get_user(vfp->hard.fpscr, &ufp->fpscr))
704 return -EFAULT; 735 return -EFAULT;
705 736
737 vfp_flush_hwstate(thread);
738
706 return 0; 739 return 0;
707} 740}
708#endif 741#endif
@@ -712,26 +745,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
712 int ret; 745 int ret;
713 746
714 switch (request) { 747 switch (request) {
715 /*
716 * read word at location "addr" in the child process.
717 */
718 case PTRACE_PEEKTEXT:
719 case PTRACE_PEEKDATA:
720 ret = generic_ptrace_peekdata(child, addr, data);
721 break;
722
723 case PTRACE_PEEKUSR: 748 case PTRACE_PEEKUSR:
724 ret = ptrace_read_user(child, addr, (unsigned long __user *)data); 749 ret = ptrace_read_user(child, addr, (unsigned long __user *)data);
725 break; 750 break;
726 751
727 /*
728 * write the word at location addr.
729 */
730 case PTRACE_POKETEXT:
731 case PTRACE_POKEDATA:
732 ret = generic_ptrace_pokedata(child, addr, data);
733 break;
734
735 case PTRACE_POKEUSR: 752 case PTRACE_POKEUSR:
736 ret = ptrace_write_user(child, addr, data); 753 ret = ptrace_write_user(child, addr, data);
737 break; 754 break;