aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/kernel/asm-offsets.c4
-rw-r--r--arch/arm/kernel/ptrace.c14
-rw-r--r--include/asm-arm/fpstate.h4
-rw-r--r--include/asm-arm/thread_info.h2
4 files changed, 11 insertions, 13 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
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h
index f7430e3aa55d..6246bf83627d 100644
--- a/include/asm-arm/fpstate.h
+++ b/include/asm-arm/fpstate.h
@@ -55,8 +55,10 @@ struct fp_soft_struct {
55 unsigned int save[FP_SOFT_SIZE]; /* undefined information */ 55 unsigned int save[FP_SOFT_SIZE]; /* undefined information */
56}; 56};
57 57
58#define IWMMXT_SIZE 0x98
59
58struct iwmmxt_struct { 60struct iwmmxt_struct {
59 unsigned int save[0x98/sizeof(int) + 1]; 61 unsigned int save[IWMMXT_SIZE / sizeof(unsigned int)];
60}; 62};
61 63
62union fp_state { 64union fp_state {
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index 33a33cbb6329..cfbccb63c67b 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -59,7 +59,7 @@ struct thread_info {
59 struct cpu_context_save cpu_context; /* cpu context */ 59 struct cpu_context_save cpu_context; /* cpu context */
60 __u8 used_cp[16]; /* thread used copro */ 60 __u8 used_cp[16]; /* thread used copro */
61 unsigned long tp_value; 61 unsigned long tp_value;
62 union fp_state fpstate; 62 union fp_state fpstate __attribute__((aligned(8)));
63 union vfp_state vfpstate; 63 union vfp_state vfpstate;
64 struct restart_block restart_block; 64 struct restart_block restart_block;
65}; 65};