[PATCH] mips: task_thread_info()
authorAl Viro <viro@ftp.linux.org.uk>
Thu, 12 Jan 2006 09:06:07 +0000 (01:06 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 12 Jan 2006 17:08:59 +0000 (09:08 -0800)
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>
arch/mips/kernel/ptrace.c
arch/mips/kernel/ptrace32.c
arch/mips/kernel/smp_mt.c
arch/mips/kernel/syscall.c
arch/mips/kernel/traps.c
arch/mips/pmc-sierra/yosemite/smp.c
arch/mips/sgi-ip27/ip27-smp.c
arch/mips/sibyte/cfe/smp.c

index 6c358b333166d1d32a871b0f75c5c2a6e5d58c64..f838b36cc765bcbc9ad544701aec14e2ff29c278 100644 (file)
@@ -438,7 +438,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                break;
 
        case PTRACE_GET_THREAD_AREA:
-               ret = put_user(child->thread_info->tp_value,
+               ret = put_user(task_thread_info(child)->tp_value,
                                (unsigned long __user *) data);
                break;
 
index 456ec438728cc148866817e578dc5e0cb5013191..0c82b25d8c6d17c087f5c3ec0c704052dbd22bd3 100644 (file)
@@ -375,7 +375,7 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
                break;
 
        case PTRACE_GET_THREAD_AREA:
-               ret = put_user(child->thread_info->tp_value,
+               ret = put_user(task_thread_info(child)->tp_value,
                                (unsigned int __user *) (unsigned long) data);
                break;
 
@@ -389,7 +389,7 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
                break;
 
        case PTRACE_GET_THREAD_AREA_3264:
-               ret = put_user(child->thread_info->tp_value,
+               ret = put_user(task_thread_info(child)->tp_value,
                                (unsigned long __user *) (unsigned long) data);
                break;
 
index d429544ba4bcc7ed99e2abeeab5a2906366c9e78..794a1c3de2a493b62ac2f60f38c3665d30763489 100644 (file)
@@ -287,6 +287,7 @@ void prom_prepare_cpus(unsigned int max_cpus)
  */
 void prom_boot_secondary(int cpu, struct task_struct *idle)
 {
+       struct thread_info *gp = task_thread_info(idle);
        dvpe();
        set_c0_mvpcontrol(MVPCONTROL_VPC);
 
@@ -307,11 +308,9 @@ void prom_boot_secondary(int cpu, struct task_struct *idle)
        write_tc_gpr_sp( __KSTK_TOS(idle));
 
        /* global pointer */
-       write_tc_gpr_gp((unsigned long)idle->thread_info);
+       write_tc_gpr_gp((unsigned long)gp);
 
-       flush_icache_range((unsigned long)idle->thread_info,
-                                          (unsigned long)idle->thread_info +
-                                          sizeof(struct thread_info));
+       flush_icache_range((unsigned long)gp, (unsigned long)(gp + 1));
 
        /* finally out of configuration and into chaos */
        clear_c0_mvpcontrol(MVPCONTROL_VPC);
index 006881942aa287fd63f925605e4195954cc1430b..332358430ff5122a3639ccdb8a7ead2e8db03fd7 100644 (file)
@@ -263,7 +263,7 @@ asmlinkage int sys_olduname(struct oldold_utsname * name)
 
 void sys_set_thread_area(unsigned long addr)
 {
-       struct thread_info *ti = current->thread_info;
+       struct thread_info *ti = task_thread_info(current);
 
        ti->tp_value = addr;
 
index 7058893d5ad2227259746895558f47644e6d66bd..59a187956de028cc4812a8822aea55fcfa5d68e0 100644 (file)
@@ -519,7 +519,7 @@ static inline int simulate_llsc(struct pt_regs *regs)
  */
 static inline int simulate_rdhwr(struct pt_regs *regs)
 {
-       struct thread_info *ti = current->thread_info;
+       struct thread_info *ti = task_thread_info(current);
        unsigned int opcode;
 
        if (unlikely(get_insn_opcode(regs, &opcode)))
index 0527170d6adb46fee7165b22b925c3d0f72c61df..f17f575f58f0a17ddfb700549110c07feb4afad1 100644 (file)
@@ -93,8 +93,8 @@ void __init prom_prepare_cpus(unsigned int max_cpus)
  */
 void prom_boot_secondary(int cpu, struct task_struct *idle)
 {
-       unsigned long gp = (unsigned long) idle->thread_info;
-       unsigned long sp = gp + THREAD_SIZE - 32;
+       unsigned long gp = (unsigned long) task_thread_info(idle);
+       unsigned long sp = __KSTK_TOP(idle);
 
        secondary_sp = sp;
        secondary_gp = gp;
index 3a8291b7d26d1aa84122bdbfa7a516cb3eb62cd9..dbef3f6b565022341ce983521a9314b76813c748 100644 (file)
@@ -168,8 +168,8 @@ void __init prom_prepare_cpus(unsigned int max_cpus)
  */
 void __init prom_boot_secondary(int cpu, struct task_struct *idle)
 {
-       unsigned long gp = (unsigned long) idle->thread_info;
-       unsigned long sp = gp + THREAD_SIZE - 32;
+       unsigned long gp = (unsigned long)task_thread_info(idle);
+       unsigned long sp = __KSTK_TOS(idle);
 
        LAUNCH_SLAVE(cputonasid(cpu),cputoslice(cpu),
                (launch_proc_t)MAPPED_KERN_RW_TO_K0(smp_bootstrap),
index e8485124b8fc903fda4b8768825f080ff19c5a5b..4477af3d8074fbd067d38d29b9b8936693c3b527 100644 (file)
@@ -60,7 +60,7 @@ void prom_boot_secondary(int cpu, struct task_struct *idle)
 
        retval = cfe_cpu_start(cpu_logical_map(cpu), &smp_bootstrap,
                               __KSTK_TOS(idle),
-                              (unsigned long)idle->thread_info, 0);
+                              (unsigned long)task_thread_info(idle), 0);
        if (retval != 0)
                printk("cfe_start_cpu(%i) returned %i\n" , cpu, retval);
 }