[PATCH] arm: task_thread_info()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Al Viro and committed by Linus Torvalds e7c1b32f 68f8b1f8

+10 -10
+2 -2
arch/arm/kernel/process.c
··· 342 void release_thread(struct task_struct *dead_task) 343 { 344 #if defined(CONFIG_VFP) 345 - vfp_release_thread(&dead_task->thread_info->vfpstate); 346 #endif 347 #if defined(CONFIG_IWMMXT) 348 - iwmmxt_task_release(dead_task->thread_info); 349 #endif 350 } 351
··· 342 void release_thread(struct task_struct *dead_task) 343 { 344 #if defined(CONFIG_VFP) 345 + vfp_release_thread(&task_thread_info(dead_task)->vfpstate); 346 #endif 347 #if defined(CONFIG_IWMMXT) 348 + iwmmxt_task_release(task_thread_info(dead_task)); 349 #endif 350 } 351
+5 -5
arch/arm/kernel/ptrace.c
··· 604 */ 605 static int ptrace_getfpregs(struct task_struct *tsk, void __user *ufp) 606 { 607 - return copy_to_user(ufp, &tsk->thread_info->fpstate, 608 sizeof(struct user_fp)) ? -EFAULT : 0; 609 } 610 ··· 613 */ 614 static int ptrace_setfpregs(struct task_struct *tsk, void __user *ufp) 615 { 616 - struct thread_info *thread = tsk->thread_info; 617 thread->used_cp[1] = thread->used_cp[2] = 1; 618 return copy_from_user(&thread->fpstate, ufp, 619 sizeof(struct user_fp)) ? -EFAULT : 0; ··· 626 */ 627 static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp) 628 { 629 - struct thread_info *thread = tsk->thread_info; 630 void *ptr = &thread->fpstate; 631 632 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) ··· 643 */ 644 static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp) 645 { 646 - struct thread_info *thread = tsk->thread_info; 647 void *ptr = &thread->fpstate; 648 649 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) ··· 779 #endif 780 781 case PTRACE_GET_THREAD_AREA: 782 - ret = put_user(child->thread_info->tp_value, 783 (unsigned long __user *) data); 784 break; 785
··· 604 */ 605 static int ptrace_getfpregs(struct task_struct *tsk, void __user *ufp) 606 { 607 + return copy_to_user(ufp, &task_thread_info(tsk)->fpstate, 608 sizeof(struct user_fp)) ? -EFAULT : 0; 609 } 610 ··· 613 */ 614 static int ptrace_setfpregs(struct task_struct *tsk, void __user *ufp) 615 { 616 + struct thread_info *thread = task_thread_info(tsk); 617 thread->used_cp[1] = thread->used_cp[2] = 1; 618 return copy_from_user(&thread->fpstate, ufp, 619 sizeof(struct user_fp)) ? -EFAULT : 0; ··· 626 */ 627 static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp) 628 { 629 + struct thread_info *thread = task_thread_info(tsk); 630 void *ptr = &thread->fpstate; 631 632 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) ··· 643 */ 644 static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp) 645 { 646 + struct thread_info *thread = task_thread_info(tsk); 647 void *ptr = &thread->fpstate; 648 649 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) ··· 779 #endif 780 781 case PTRACE_GET_THREAD_AREA: 782 + ret = put_user(task_thread_info(child)->tp_value, 783 (unsigned long __user *) data); 784 break; 785
+1 -1
include/asm-arm/system.h
··· 168 169 #define switch_to(prev,next,last) \ 170 do { \ 171 - last = __switch_to(prev,prev->thread_info,next->thread_info); \ 172 } while (0) 173 174 /*
··· 168 169 #define switch_to(prev,next,last) \ 170 do { \ 171 + last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \ 172 } while (0) 173 174 /*
+2 -2
include/asm-arm/thread_info.h
··· 100 #define put_thread_info(ti) put_task_struct((ti)->task) 101 102 #define thread_saved_pc(tsk) \ 103 - ((unsigned long)(pc_pointer((tsk)->thread_info->cpu_context.pc))) 104 #define thread_saved_fp(tsk) \ 105 - ((unsigned long)((tsk)->thread_info->cpu_context.fp)) 106 107 extern void iwmmxt_task_disable(struct thread_info *); 108 extern void iwmmxt_task_copy(struct thread_info *, void *);
··· 100 #define put_thread_info(ti) put_task_struct((ti)->task) 101 102 #define thread_saved_pc(tsk) \ 103 + ((unsigned long)(pc_pointer(task_thread_info(tsk)->cpu_context.pc))) 104 #define thread_saved_fp(tsk) \ 105 + ((unsigned long)(task_thread_info(tsk)->cpu_context.fp)) 106 107 extern void iwmmxt_task_disable(struct thread_info *); 108 extern void iwmmxt_task_copy(struct thread_info *, void *);