[PATCH] parisc: task_stack_page(), 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>
This commit is contained in:
Al Viro 2006-01-12 01:05:55 -08:00 committed by Linus Torvalds
parent 513091ba7e
commit 40f1f0deaf
2 changed files with 4 additions and 4 deletions

View File

@ -295,7 +295,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
struct task_struct * p, struct pt_regs * pregs) struct task_struct * p, struct pt_regs * pregs)
{ {
struct pt_regs * cregs = &(p->thread.regs); struct pt_regs * cregs = &(p->thread.regs);
struct thread_info *ti = p->thread_info; void *stack = task_stack_page(p);
/* We have to use void * instead of a function pointer, because /* We have to use void * instead of a function pointer, because
* function pointers aren't a pointer to the function on 64-bit. * function pointers aren't a pointer to the function on 64-bit.
@ -322,7 +322,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
*/ */
if (usp == 1) { if (usp == 1) {
/* kernel thread */ /* kernel thread */
cregs->ksp = (((unsigned long)(ti)) + THREAD_SZ_ALGN); cregs->ksp = (unsigned long)stack + THREAD_SZ_ALGN;
/* Must exit via ret_from_kernel_thread in order /* Must exit via ret_from_kernel_thread in order
* to call schedule_tail() * to call schedule_tail()
*/ */
@ -344,7 +344,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
*/ */
/* Use same stack depth as parent */ /* Use same stack depth as parent */
cregs->ksp = ((unsigned long)(ti)) cregs->ksp = (unsigned long)stack
+ (pregs->gr[21] & (THREAD_SIZE - 1)); + (pregs->gr[21] & (THREAD_SIZE - 1));
cregs->gr[30] = usp; cregs->gr[30] = usp;
if (p->personality == PER_HPUX) { if (p->personality == PER_HPUX) {

View File

@ -517,7 +517,7 @@ int __init smp_boot_one_cpu(int cpuid)
if (IS_ERR(idle)) if (IS_ERR(idle))
panic("SMP: fork failed for CPU:%d", cpuid); panic("SMP: fork failed for CPU:%d", cpuid);
idle->thread_info->cpu = cpuid; task_thread_info(idle)->cpu = cpuid;
/* Let _start know what logical CPU we're booting /* Let _start know what logical CPU we're booting
** (offset into init_tasks[],cpu_data[]) ** (offset into init_tasks[],cpu_data[])