Commit c64ac9f0 authored by David McCullough's avatar David McCullough Committed by Paul Mundt

sh: fix get_wchan() for SH kernels without framepointers

Do not follow the frame pointers (/proc/X/task/1/stat) unless we were
compiled with them.
Signed-off-by: default avatarDavid McCullough <david_mccullough@au.securecomputing.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 1f25756a
...@@ -474,7 +474,6 @@ asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, ...@@ -474,7 +474,6 @@ asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv,
unsigned long get_wchan(struct task_struct *p) unsigned long get_wchan(struct task_struct *p)
{ {
unsigned long schedule_frame;
unsigned long pc; unsigned long pc;
if (!p || p == current || p->state == TASK_RUNNING) if (!p || p == current || p->state == TASK_RUNNING)
...@@ -484,10 +483,13 @@ unsigned long get_wchan(struct task_struct *p) ...@@ -484,10 +483,13 @@ unsigned long get_wchan(struct task_struct *p)
* The same comment as on the Alpha applies here, too ... * The same comment as on the Alpha applies here, too ...
*/ */
pc = thread_saved_pc(p); pc = thread_saved_pc(p);
#ifdef CONFIG_FRAME_POINTER
if (in_sched_functions(pc)) { 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]; return ((unsigned long *)schedule_frame)[21];
} }
#endif
return pc; return pc;
} }
......
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