Commit ee3eea16 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] sparc64: 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 f3169641
...@@ -616,11 +616,11 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, ...@@ -616,11 +616,11 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
unsigned long unused, unsigned long unused,
struct task_struct *p, struct pt_regs *regs) struct task_struct *p, struct pt_regs *regs)
{ {
struct thread_info *t = p->thread_info; struct thread_info *t = task_thread_info(p);
char *child_trap_frame; char *child_trap_frame;
/* Calculate offset to stack_frame & pt_regs */ /* Calculate offset to stack_frame & pt_regs */
child_trap_frame = ((char *)t) + (THREAD_SIZE - (TRACEREG_SZ+STACKFRAME_SZ)); child_trap_frame = task_stack_page(p) + (THREAD_SIZE - (TRACEREG_SZ+STACKFRAME_SZ));
memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ)); memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ));
t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) | t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) |
...@@ -845,7 +845,7 @@ unsigned long get_wchan(struct task_struct *task) ...@@ -845,7 +845,7 @@ unsigned long get_wchan(struct task_struct *task)
task->state == TASK_RUNNING) task->state == TASK_RUNNING)
goto out; goto out;
thread_info_base = (unsigned long) task->thread_info; thread_info_base = (unsigned long) task_stack_page(task);
bias = STACK_BIAS; bias = STACK_BIAS;
fp = task_thread_info(task)->ksp + bias; fp = task_thread_info(task)->ksp + bias;
......
...@@ -1808,7 +1808,7 @@ static void user_instruction_dump (unsigned int __user *pc) ...@@ -1808,7 +1808,7 @@ static void user_instruction_dump (unsigned int __user *pc)
void show_stack(struct task_struct *tsk, unsigned long *_ksp) void show_stack(struct task_struct *tsk, unsigned long *_ksp)
{ {
unsigned long pc, fp, thread_base, ksp; unsigned long pc, fp, thread_base, ksp;
struct thread_info *tp = tsk->thread_info; void *tp = task_stack_page(tsk);
struct reg_window *rw; struct reg_window *rw;
int count = 0; int count = 0;
...@@ -1862,7 +1862,7 @@ static inline int is_kernel_stack(struct task_struct *task, ...@@ -1862,7 +1862,7 @@ static inline int is_kernel_stack(struct task_struct *task,
return 0; return 0;
} }
thread_base = (unsigned long) task->thread_info; thread_base = (unsigned long) task_stack_page(task);
thread_end = thread_base + sizeof(union thread_union); thread_end = thread_base + sizeof(union thread_union);
if (rw_addr >= thread_base && if (rw_addr >= thread_base &&
rw_addr < thread_end && rw_addr < thread_end &&
......
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