[PATCH] amd64: task_stack_page()

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 57eafdc2 bb049232

+4 -4
+3 -3
arch/x86_64/kernel/process.c
··· 451 struct task_struct *me = current; 452 453 childregs = ((struct pt_regs *) 454 - (THREAD_SIZE + (unsigned long) p->thread_info)) - 1; 455 *childregs = *regs; 456 457 childregs->rax = 0; ··· 590 write_pda(oldrsp, next->userrsp); 591 write_pda(pcurrent, next_p); 592 write_pda(kernelstack, 593 - (unsigned long)next_p->thread_info + THREAD_SIZE - PDA_STACKOFFSET); 594 595 /* 596 * Now maybe reload the debug registers ··· 704 705 if (!p || p == current || p->state==TASK_RUNNING) 706 return 0; 707 - stack = (unsigned long)p->thread_info; 708 if (p->thread.rsp < stack || p->thread.rsp > stack+THREAD_SIZE) 709 return 0; 710 fp = *(u64 *)(p->thread.rsp);
··· 451 struct task_struct *me = current; 452 453 childregs = ((struct pt_regs *) 454 + (THREAD_SIZE + task_stack_page(p))) - 1; 455 *childregs = *regs; 456 457 childregs->rax = 0; ··· 590 write_pda(oldrsp, next->userrsp); 591 write_pda(pcurrent, next_p); 592 write_pda(kernelstack, 593 + task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET); 594 595 /* 596 * Now maybe reload the debug registers ··· 704 705 if (!p || p == current || p->state==TASK_RUNNING) 706 return 0; 707 + stack = (unsigned long)task_stack_page(p); 708 if (p->thread.rsp < stack || p->thread.rsp > stack+THREAD_SIZE) 709 return 0; 710 fp = *(u64 *)(p->thread.rsp);
+1 -1
arch/x86_64/kernel/smpboot.c
··· 776 777 if (c_idle.idle) { 778 c_idle.idle->thread.rsp = (unsigned long) (((struct pt_regs *) 779 - (THREAD_SIZE + (unsigned long) c_idle.idle->thread_info)) - 1); 780 init_idle(c_idle.idle, cpu); 781 goto do_rest; 782 }
··· 776 777 if (c_idle.idle) { 778 c_idle.idle->thread.rsp = (unsigned long) (((struct pt_regs *) 779 + (THREAD_SIZE + task_stack_page(c_idle.idle))) - 1); 780 init_idle(c_idle.idle, cpu); 781 goto do_rest; 782 }