[PATCH] sh: task_stack_page()
authorAl Viro <viro@ftp.linux.org.uk>
Thu, 12 Jan 2006 09:05:45 +0000 (01:05 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 12 Jan 2006 17:08:53 +0000 (09:08 -0800)
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>
arch/sh/kernel/process.c
include/asm-sh/ptrace.h

index 35415d0be39e4ef553ac7f29dd3c21edfdd4c512..aac15e42d03bbe7300276c774cf9af20c8fb37b1 100644 (file)
@@ -270,7 +270,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
        if (user_mode(regs)) {
                childregs->regs[15] = usp;
        } else {
-               childregs->regs[15] = (unsigned long)p->thread_info + THREAD_SIZE;
+               childregs->regs[15] = (unsigned long)task_stack_page(p) + THREAD_SIZE;
        }
         if (clone_flags & CLONE_SETTLS) {
                childregs->gbr = childregs->regs[0];
index 85aa0f4de819352a3db1ac316395517aae3c2374..792fc35bd6245c8551909a6dbf57b385b761fea6 100644 (file)
@@ -93,11 +93,11 @@ extern void show_regs(struct pt_regs *);
 
 #ifdef CONFIG_SH_DSP
 #define task_pt_regs(task) \
-       ((struct pt_regs *) ((unsigned long)(task)->thread_info + THREAD_SIZE \
+       ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
                 - sizeof(struct pt_dspregs) - sizeof(unsigned long)) - 1)
 #else
 #define task_pt_regs(task) \
-       ((struct pt_regs *) ((unsigned long)(task)->thread_info + THREAD_SIZE \
+       ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
                 - sizeof(unsigned long)) - 1)
 #endif