提交 f3169641 编写于 作者: A Al Viro 提交者: Linus Torvalds

[PATCH] sparc64: task_thread_info()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 65e0fdff
...@@ -390,7 +390,7 @@ void show_regs32(struct pt_regs32 *regs) ...@@ -390,7 +390,7 @@ void show_regs32(struct pt_regs32 *regs)
unsigned long thread_saved_pc(struct task_struct *tsk) unsigned long thread_saved_pc(struct task_struct *tsk)
{ {
struct thread_info *ti = tsk->thread_info; struct thread_info *ti = task_thread_info(tsk);
unsigned long ret = 0xdeadbeefUL; unsigned long ret = 0xdeadbeefUL;
if (ti && ti->ksp) { if (ti && ti->ksp) {
...@@ -847,7 +847,7 @@ unsigned long get_wchan(struct task_struct *task) ...@@ -847,7 +847,7 @@ unsigned long get_wchan(struct task_struct *task)
thread_info_base = (unsigned long) task->thread_info; thread_info_base = (unsigned long) task->thread_info;
bias = STACK_BIAS; bias = STACK_BIAS;
fp = task->thread_info->ksp + bias; fp = task_thread_info(task)->ksp + bias;
do { do {
/* Bogus frame pointer? */ /* Bogus frame pointer? */
......
...@@ -324,7 +324,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -324,7 +324,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
unsigned long tpc = cregs->tpc; unsigned long tpc = cregs->tpc;
int rval; int rval;
if ((child->thread_info->flags & _TIF_32BIT) != 0) if ((task_thread_info(child)->flags & _TIF_32BIT) != 0)
tpc &= 0xffffffff; tpc &= 0xffffffff;
if (__put_user(cregs->tstate, (&pregs->tstate)) || if (__put_user(cregs->tstate, (&pregs->tstate)) ||
__put_user(tpc, (&pregs->tpc)) || __put_user(tpc, (&pregs->tpc)) ||
...@@ -395,7 +395,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -395,7 +395,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_error_return(regs, EFAULT); pt_error_return(regs, EFAULT);
goto out_tsk; goto out_tsk;
} }
if ((child->thread_info->flags & _TIF_32BIT) != 0) { if ((task_thread_info(child)->flags & _TIF_32BIT) != 0) {
tpc &= 0xffffffff; tpc &= 0xffffffff;
tnpc &= 0xffffffff; tnpc &= 0xffffffff;
} }
...@@ -430,11 +430,11 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -430,11 +430,11 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
} fpq[16]; } fpq[16];
}; };
struct fps __user *fps = (struct fps __user *) addr; struct fps __user *fps = (struct fps __user *) addr;
unsigned long *fpregs = child->thread_info->fpregs; unsigned long *fpregs = task_thread_info(child)->fpregs;
if (copy_to_user(&fps->regs[0], fpregs, if (copy_to_user(&fps->regs[0], fpregs,
(32 * sizeof(unsigned int))) || (32 * sizeof(unsigned int))) ||
__put_user(child->thread_info->xfsr[0], (&fps->fsr)) || __put_user(task_thread_info(child)->xfsr[0], (&fps->fsr)) ||
__put_user(0, (&fps->fpqd)) || __put_user(0, (&fps->fpqd)) ||
__put_user(0, (&fps->flags)) || __put_user(0, (&fps->flags)) ||
__put_user(0, (&fps->extra)) || __put_user(0, (&fps->extra)) ||
...@@ -452,11 +452,11 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -452,11 +452,11 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
unsigned long fsr; unsigned long fsr;
}; };
struct fps __user *fps = (struct fps __user *) addr; struct fps __user *fps = (struct fps __user *) addr;
unsigned long *fpregs = child->thread_info->fpregs; unsigned long *fpregs = task_thread_info(child)->fpregs;
if (copy_to_user(&fps->regs[0], fpregs, if (copy_to_user(&fps->regs[0], fpregs,
(64 * sizeof(unsigned int))) || (64 * sizeof(unsigned int))) ||
__put_user(child->thread_info->xfsr[0], (&fps->fsr))) { __put_user(task_thread_info(child)->xfsr[0], (&fps->fsr))) {
pt_error_return(regs, EFAULT); pt_error_return(regs, EFAULT);
goto out_tsk; goto out_tsk;
} }
...@@ -477,7 +477,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -477,7 +477,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
} fpq[16]; } fpq[16];
}; };
struct fps __user *fps = (struct fps __user *) addr; struct fps __user *fps = (struct fps __user *) addr;
unsigned long *fpregs = child->thread_info->fpregs; unsigned long *fpregs = task_thread_info(child)->fpregs;
unsigned fsr; unsigned fsr;
if (copy_from_user(fpregs, &fps->regs[0], if (copy_from_user(fpregs, &fps->regs[0],
...@@ -486,11 +486,11 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -486,11 +486,11 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_error_return(regs, EFAULT); pt_error_return(regs, EFAULT);
goto out_tsk; goto out_tsk;
} }
child->thread_info->xfsr[0] &= 0xffffffff00000000UL; task_thread_info(child)->xfsr[0] &= 0xffffffff00000000UL;
child->thread_info->xfsr[0] |= fsr; task_thread_info(child)->xfsr[0] |= fsr;
if (!(child->thread_info->fpsaved[0] & FPRS_FEF)) if (!(task_thread_info(child)->fpsaved[0] & FPRS_FEF))
child->thread_info->gsr[0] = 0; task_thread_info(child)->gsr[0] = 0;
child->thread_info->fpsaved[0] |= (FPRS_FEF | FPRS_DL); task_thread_info(child)->fpsaved[0] |= (FPRS_FEF | FPRS_DL);
pt_succ_return(regs, 0); pt_succ_return(regs, 0);
goto out_tsk; goto out_tsk;
} }
...@@ -501,17 +501,17 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -501,17 +501,17 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
unsigned long fsr; unsigned long fsr;
}; };
struct fps __user *fps = (struct fps __user *) addr; struct fps __user *fps = (struct fps __user *) addr;
unsigned long *fpregs = child->thread_info->fpregs; unsigned long *fpregs = task_thread_info(child)->fpregs;
if (copy_from_user(fpregs, &fps->regs[0], if (copy_from_user(fpregs, &fps->regs[0],
(64 * sizeof(unsigned int))) || (64 * sizeof(unsigned int))) ||
__get_user(child->thread_info->xfsr[0], (&fps->fsr))) { __get_user(task_thread_info(child)->xfsr[0], (&fps->fsr))) {
pt_error_return(regs, EFAULT); pt_error_return(regs, EFAULT);
goto out_tsk; goto out_tsk;
} }
if (!(child->thread_info->fpsaved[0] & FPRS_FEF)) if (!(task_thread_info(child)->fpsaved[0] & FPRS_FEF))
child->thread_info->gsr[0] = 0; task_thread_info(child)->gsr[0] = 0;
child->thread_info->fpsaved[0] |= (FPRS_FEF | FPRS_DL | FPRS_DU); task_thread_info(child)->fpsaved[0] |= (FPRS_FEF | FPRS_DL | FPRS_DU);
pt_succ_return(regs, 0); pt_succ_return(regs, 0);
goto out_tsk; goto out_tsk;
} }
......
...@@ -520,7 +520,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -520,7 +520,7 @@ void __init setup_arch(char **cmdline_p)
rd_doload = ((ram_flags & RAMDISK_LOAD_FLAG) != 0); rd_doload = ((ram_flags & RAMDISK_LOAD_FLAG) != 0);
#endif #endif
init_task.thread_info->kregs = &fake_swapper_regs; task_thread_info(&init_task)->kregs = &fake_swapper_regs;
#ifdef CONFIG_IP_PNP #ifdef CONFIG_IP_PNP
if (!ic_set_manually) { if (!ic_set_manually) {
......
...@@ -335,7 +335,7 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu) ...@@ -335,7 +335,7 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu)
p = fork_idle(cpu); p = fork_idle(cpu);
callin_flag = 0; callin_flag = 0;
cpu_new_thread = p->thread_info; cpu_new_thread = task_thread_info(p);
cpu_set(cpu, cpu_callout_map); cpu_set(cpu, cpu_callout_map);
cpu_find_by_mid(cpu, &cpu_node); cpu_find_by_mid(cpu, &cpu_node);
......
...@@ -60,7 +60,7 @@ do { \ ...@@ -60,7 +60,7 @@ do { \
register unsigned long pgd_cache asm("o4"); \ register unsigned long pgd_cache asm("o4"); \
paddr = __pa((__mm)->pgd); \ paddr = __pa((__mm)->pgd); \
pgd_cache = 0UL; \ pgd_cache = 0UL; \
if ((__tsk)->thread_info->flags & _TIF_32BIT) \ if (task_thread_info(__tsk)->flags & _TIF_32BIT) \
pgd_cache = get_pgd_cache((__mm)->pgd); \ pgd_cache = get_pgd_cache((__mm)->pgd); \
__asm__ __volatile__("wrpr %%g0, 0x494, %%pstate\n\t" \ __asm__ __volatile__("wrpr %%g0, 0x494, %%pstate\n\t" \
"mov %3, %%g4\n\t" \ "mov %3, %%g4\n\t" \
......
...@@ -208,7 +208,7 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \ ...@@ -208,7 +208,7 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \
/* If you are tempted to conditionalize the following */ \ /* If you are tempted to conditionalize the following */ \
/* so that ASI is only written if it changes, think again. */ \ /* so that ASI is only written if it changes, think again. */ \
__asm__ __volatile__("wr %%g0, %0, %%asi" \ __asm__ __volatile__("wr %%g0, %0, %%asi" \
: : "r" (__thread_flag_byte_ptr(next->thread_info)[TI_FLAG_BYTE_CURRENT_DS]));\ : : "r" (__thread_flag_byte_ptr(task_thread_info(next))[TI_FLAG_BYTE_CURRENT_DS]));\
__asm__ __volatile__( \ __asm__ __volatile__( \
"mov %%g4, %%g7\n\t" \ "mov %%g4, %%g7\n\t" \
"wrpr %%g0, 0x95, %%pstate\n\t" \ "wrpr %%g0, 0x95, %%pstate\n\t" \
...@@ -238,7 +238,7 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \ ...@@ -238,7 +238,7 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \
"b,a ret_from_syscall\n\t" \ "b,a ret_from_syscall\n\t" \
"1:\n\t" \ "1:\n\t" \
: "=&r" (last) \ : "=&r" (last) \
: "0" (next->thread_info), \ : "0" (task_thread_info(next)), \
"i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \ "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \
"i" (TI_CWP), "i" (TI_TASK) \ "i" (TI_CWP), "i" (TI_TASK) \
: "cc", \ : "cc", \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册