aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/ptrace.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-03-12 17:36:06 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-03-12 17:36:06 -0500
commitcdaabbd74b15296acf09215355a7f3b07b92b83e (patch)
treeda2e2ce07a31eb10cb3649005479a9588ba22809 /arch/arm/kernel/ptrace.c
parent04916c0ef482335cb0ae575dbc5a1d97619840cd (diff)
[ARM] iwmmxt thread state alignment
This patch removes the reliance of iwmmxt on hand coded alignments. Since thread_info is always 8K aligned, specifying that fpstate is 8-byte aligned achieves the same effect without needing to resort to hand coded alignments. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/ptrace.c')
-rw-r--r--arch/arm/kernel/ptrace.c14
1 files changed, 4 insertions, 10 deletions
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