Commit 57eafdc2 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds
Browse files

[PATCH] amd64: task_stack_page()


Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bb049232
...@@ -451,7 +451,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, ...@@ -451,7 +451,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp,
struct task_struct *me = current; struct task_struct *me = current;
childregs = ((struct pt_regs *) childregs = ((struct pt_regs *)
(THREAD_SIZE + (unsigned long) p->thread_info)) - 1; (THREAD_SIZE + task_stack_page(p))) - 1;
*childregs = *regs; *childregs = *regs;
childregs->rax = 0; childregs->rax = 0;
...@@ -590,7 +590,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) ...@@ -590,7 +590,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
write_pda(oldrsp, next->userrsp); write_pda(oldrsp, next->userrsp);
write_pda(pcurrent, next_p); write_pda(pcurrent, next_p);
write_pda(kernelstack, write_pda(kernelstack,
(unsigned long)next_p->thread_info + THREAD_SIZE - PDA_STACKOFFSET); task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET);
/* /*
* Now maybe reload the debug registers * Now maybe reload the debug registers
...@@ -704,7 +704,7 @@ unsigned long get_wchan(struct task_struct *p) ...@@ -704,7 +704,7 @@ unsigned long get_wchan(struct task_struct *p)
if (!p || p == current || p->state==TASK_RUNNING) if (!p || p == current || p->state==TASK_RUNNING)
return 0; return 0;
stack = (unsigned long)p->thread_info; stack = (unsigned long)task_stack_page(p);
if (p->thread.rsp < stack || p->thread.rsp > stack+THREAD_SIZE) if (p->thread.rsp < stack || p->thread.rsp > stack+THREAD_SIZE)
return 0; return 0;
fp = *(u64 *)(p->thread.rsp); fp = *(u64 *)(p->thread.rsp);
......
...@@ -776,7 +776,7 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid) ...@@ -776,7 +776,7 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
if (c_idle.idle) { if (c_idle.idle) {
c_idle.idle->thread.rsp = (unsigned long) (((struct pt_regs *) c_idle.idle->thread.rsp = (unsigned long) (((struct pt_regs *)
(THREAD_SIZE + (unsigned long) c_idle.idle->thread_info)) - 1); (THREAD_SIZE + task_stack_page(c_idle.idle))) - 1);
init_idle(c_idle.idle, cpu); init_idle(c_idle.idle, cpu);
goto do_rest; goto do_rest;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment