]> git.karo-electronics.de Git - linux-beck.git/commitdiff
sh: fix get_wchan() for SH kernels without framepointers
authorDavid McCullough <david_mccullough@au.securecomputing.com>
Thu, 26 Jul 2007 08:46:07 +0000 (17:46 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 26 Jul 2007 08:46:07 +0000 (17:46 +0900)
Do not follow the frame pointers (/proc/X/task/1/stat) unless we were
compiled with them.

Signed-off-by: David McCullough <david_mccullough@au.securecomputing.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/process.c

index 6334a4c54c7cefeff3a5f2e7b03a37c81839b805..3a1783010c03d690a7c658c2eaef69b5222fc197 100644 (file)
@@ -474,7 +474,6 @@ out:
 
 unsigned long get_wchan(struct task_struct *p)
 {
-       unsigned long schedule_frame;
        unsigned long pc;
 
        if (!p || p == current || p->state == TASK_RUNNING)
@@ -484,10 +483,13 @@ unsigned long get_wchan(struct task_struct *p)
         * The same comment as on the Alpha applies here, too ...
         */
        pc = thread_saved_pc(p);
+
+#ifdef CONFIG_FRAME_POINTER
        if (in_sched_functions(pc)) {
-               schedule_frame = (unsigned long)p->thread.sp;
+               unsigned long schedule_frame = (unsigned long)p->thread.sp;
                return ((unsigned long *)schedule_frame)[21];
        }
+#endif
 
        return pc;
 }