Skip to content

Commit

Permalink
sh: fix get_wchan() for SH kernels without framepointers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David McCullough authored and pmundt committed Jul 26, 2007
1 parent 1f25756 commit c64ac9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/sh/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 schedule_frame;
unsigned long pc;

if (!p || p == current || p->state == TASK_RUNNING)
Expand All @@ -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;
}
Expand Down

0 comments on commit c64ac9f

Please sign in to comment.