[PATCH] mips: 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 dc8f6029 40bc9c67

+13 -14
+1 -1
arch/mips/kernel/ptrace.c
··· 438 break; 439 440 case PTRACE_GET_THREAD_AREA: 441 - ret = put_user(child->thread_info->tp_value, 442 (unsigned long __user *) data); 443 break; 444
··· 438 break; 439 440 case PTRACE_GET_THREAD_AREA: 441 + ret = put_user(task_thread_info(child)->tp_value, 442 (unsigned long __user *) data); 443 break; 444
+2 -2
arch/mips/kernel/ptrace32.c
··· 375 break; 376 377 case PTRACE_GET_THREAD_AREA: 378 - ret = put_user(child->thread_info->tp_value, 379 (unsigned int __user *) (unsigned long) data); 380 break; 381 ··· 389 break; 390 391 case PTRACE_GET_THREAD_AREA_3264: 392 - ret = put_user(child->thread_info->tp_value, 393 (unsigned long __user *) (unsigned long) data); 394 break; 395
··· 375 break; 376 377 case PTRACE_GET_THREAD_AREA: 378 + ret = put_user(task_thread_info(child)->tp_value, 379 (unsigned int __user *) (unsigned long) data); 380 break; 381 ··· 389 break; 390 391 case PTRACE_GET_THREAD_AREA_3264: 392 + ret = put_user(task_thread_info(child)->tp_value, 393 (unsigned long __user *) (unsigned long) data); 394 break; 395
+3 -4
arch/mips/kernel/smp_mt.c
··· 287 */ 288 void prom_boot_secondary(int cpu, struct task_struct *idle) 289 { 290 dvpe(); 291 set_c0_mvpcontrol(MVPCONTROL_VPC); 292 ··· 308 write_tc_gpr_sp( __KSTK_TOS(idle)); 309 310 /* global pointer */ 311 - write_tc_gpr_gp((unsigned long)idle->thread_info); 312 313 - flush_icache_range((unsigned long)idle->thread_info, 314 - (unsigned long)idle->thread_info + 315 - sizeof(struct thread_info)); 316 317 /* finally out of configuration and into chaos */ 318 clear_c0_mvpcontrol(MVPCONTROL_VPC);
··· 287 */ 288 void prom_boot_secondary(int cpu, struct task_struct *idle) 289 { 290 + struct thread_info *gp = task_thread_info(idle); 291 dvpe(); 292 set_c0_mvpcontrol(MVPCONTROL_VPC); 293 ··· 307 write_tc_gpr_sp( __KSTK_TOS(idle)); 308 309 /* global pointer */ 310 + write_tc_gpr_gp((unsigned long)gp); 311 312 + flush_icache_range((unsigned long)gp, (unsigned long)(gp + 1)); 313 314 /* finally out of configuration and into chaos */ 315 clear_c0_mvpcontrol(MVPCONTROL_VPC);
+1 -1
arch/mips/kernel/syscall.c
··· 263 264 void sys_set_thread_area(unsigned long addr) 265 { 266 - struct thread_info *ti = current->thread_info; 267 268 ti->tp_value = addr; 269
··· 263 264 void sys_set_thread_area(unsigned long addr) 265 { 266 + struct thread_info *ti = task_thread_info(current); 267 268 ti->tp_value = addr; 269
+1 -1
arch/mips/kernel/traps.c
··· 519 */ 520 static inline int simulate_rdhwr(struct pt_regs *regs) 521 { 522 - struct thread_info *ti = current->thread_info; 523 unsigned int opcode; 524 525 if (unlikely(get_insn_opcode(regs, &opcode)))
··· 519 */ 520 static inline int simulate_rdhwr(struct pt_regs *regs) 521 { 522 + struct thread_info *ti = task_thread_info(current); 523 unsigned int opcode; 524 525 if (unlikely(get_insn_opcode(regs, &opcode)))
+2 -2
arch/mips/pmc-sierra/yosemite/smp.c
··· 93 */ 94 void prom_boot_secondary(int cpu, struct task_struct *idle) 95 { 96 - unsigned long gp = (unsigned long) idle->thread_info; 97 - unsigned long sp = gp + THREAD_SIZE - 32; 98 99 secondary_sp = sp; 100 secondary_gp = gp;
··· 93 */ 94 void prom_boot_secondary(int cpu, struct task_struct *idle) 95 { 96 + unsigned long gp = (unsigned long) task_thread_info(idle); 97 + unsigned long sp = __KSTK_TOP(idle); 98 99 secondary_sp = sp; 100 secondary_gp = gp;
+2 -2
arch/mips/sgi-ip27/ip27-smp.c
··· 168 */ 169 void __init prom_boot_secondary(int cpu, struct task_struct *idle) 170 { 171 - unsigned long gp = (unsigned long) idle->thread_info; 172 - unsigned long sp = gp + THREAD_SIZE - 32; 173 174 LAUNCH_SLAVE(cputonasid(cpu),cputoslice(cpu), 175 (launch_proc_t)MAPPED_KERN_RW_TO_K0(smp_bootstrap),
··· 168 */ 169 void __init prom_boot_secondary(int cpu, struct task_struct *idle) 170 { 171 + unsigned long gp = (unsigned long)task_thread_info(idle); 172 + unsigned long sp = __KSTK_TOS(idle); 173 174 LAUNCH_SLAVE(cputonasid(cpu),cputoslice(cpu), 175 (launch_proc_t)MAPPED_KERN_RW_TO_K0(smp_bootstrap),
+1 -1
arch/mips/sibyte/cfe/smp.c
··· 60 61 retval = cfe_cpu_start(cpu_logical_map(cpu), &smp_bootstrap, 62 __KSTK_TOS(idle), 63 - (unsigned long)idle->thread_info, 0); 64 if (retval != 0) 65 printk("cfe_start_cpu(%i) returned %i\n" , cpu, retval); 66 }
··· 60 61 retval = cfe_cpu_start(cpu_logical_map(cpu), &smp_bootstrap, 62 __KSTK_TOS(idle), 63 + (unsigned long)task_thread_info(idle), 0); 64 if (retval != 0) 65 printk("cfe_start_cpu(%i) returned %i\n" , cpu, retval); 66 }