aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/kernel/asm-offsets.c4
-rw-r--r--arch/arm/kernel/ptrace.c14
2 files changed, 7 insertions, 11 deletions
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 0abbce8c70bc..b324dcac1c56 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -57,7 +57,9 @@ int main(void)
57 DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value)); 57 DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value));
58 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate)); 58 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate));
59 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); 59 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate));
60 DEFINE(TI_IWMMXT_STATE, (offsetof(struct thread_info, fpstate)+4)&~7); 60#ifdef CONFIG_IWMMXT
61 DEFINE(TI_IWMMXT_STATE, offsetof(struct thread_info, fpstate.iwmmxt));
62#endif
61 BLANK(); 63 BLANK();
62 DEFINE(S_R0, offsetof(struct pt_regs, ARM_r0)); 64 DEFINE(S_R0, offsetof(struct pt_regs, ARM_r0));
63 DEFINE(S_R1, offsetof(struct pt_regs, ARM_r1)); 65 DEFINE(S_R1, offsetof(struct pt_regs, ARM_r1));
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 7b6256bb590e..bc9e2f8ae326 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -610,15 +610,12 @@ static int ptrace_setfpregs(struct task_struct *tsk, void __user *ufp)
610static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp) 610static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp)
611{ 611{
612 struct thread_info *thread = task_thread_info(tsk); 612 struct thread_info *thread = task_thread_info(tsk);
613 void *ptr = &thread->fpstate;
614 613
615 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) 614 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT))
616 return -ENODATA; 615 return -ENODATA;
617 iwmmxt_task_disable(thread); /* force it to ram */ 616 iwmmxt_task_disable(thread); /* force it to ram */
618 /* The iWMMXt state is stored doubleword-aligned. */ 617 return copy_to_user(ufp, &thread->fpstate.iwmmxt, IWMMXT_SIZE)
619 if (((long) ptr) & 4) 618 ? -EFAULT : 0;
620 ptr += 4;
621 return copy_to_user(ufp, ptr, 0x98) ? -EFAULT : 0;
622} 619}
623 620
624/* 621/*
@@ -627,15 +624,12 @@ static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp)
627static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp) 624static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp)
628{ 625{
629 struct thread_info *thread = task_thread_info(tsk); 626 struct thread_info *thread = task_thread_info(tsk);
630 void *ptr = &thread->fpstate;
631 627
632 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) 628 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT))
633 return -EACCES; 629 return -EACCES;
634 iwmmxt_task_release(thread); /* force a reload */ 630 iwmmxt_task_release(thread); /* force a reload */
635 /* The iWMMXt state is stored doubleword-aligned. */ 631 return copy_from_user(&thead->fpstate.iwmmxt, ufp, IWMMXT_SIZE)
636 if (((long) ptr) & 4) 632 ? -EFAULT : 0;
637 ptr += 4;
638 return copy_from_user(ptr, ufp, 0x98) ? -EFAULT : 0;
639} 633}
640 634
641#endif 635#endif