sh: Fix get_wchan().
authorPaul Mundt <lethal@linux-sh.org>
Fri, 8 Dec 2006 08:46:29 +0000 (17:46 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 11 Dec 2006 23:42:08 +0000 (08:42 +0900)
Some time ago the schedule frame size changed and we failed to reflect
this in get_wchan() at the time. This first popped up as a problem on
SH7751R where schedule_frame ended up being unaligned and generating
an unaligned trap. This fixes it up again..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/process.c

index 7347f6afa030c9db5a35e5e1805c04e5004f3d02..486c06e180333404baf796be54b796b110d7f448 100644 (file)
@@ -470,9 +470,10 @@ unsigned long get_wchan(struct task_struct *p)
         */
        pc = thread_saved_pc(p);
        if (in_sched_functions(pc)) {
-               schedule_frame = ((unsigned long *)(long)p->thread.sp)[1];
-               return (unsigned long)((unsigned long *)schedule_frame)[1];
+               schedule_frame = (unsigned long)p->thread.sp;
+               return ((unsigned long *)schedule_frame)[21];
        }
+
        return pc;
 }