diff options
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/array.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index e2775ae0d..801ecee88 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -575,10 +575,20 @@ static unsigned long get_wchan(struct task_struct *p) unsigned long pc; pc = thread_saved_pc(&p->thread); - if (pc >= (unsigned long) interruptible_sleep_on && pc < (unsigned long) add_timer) { - schedule_frame = ((unsigned long *)(long)p->thread.reg30)[16]; - return (unsigned long)((unsigned long *)schedule_frame)[11]; + if (pc == (unsigned long) interruptible_sleep_on + || pc == (unsigned long) sleep_on) { + schedule_frame = ((unsigned long *)p->thread.reg30)[9]; + return ((unsigned long *)schedule_frame)[15]; } + if (pc == (unsigned long) interruptible_sleep_on_timeout + || pc == (unsigned long) sleep_on_timeout) { + schedule_frame = ((unsigned long *)p->thread.reg30)[9]; + return ((unsigned long *)schedule_frame)[16]; + } + if (pc >= first_sched && pc < last_sched) { + printk(KERN_DEBUG "Bug in %s\n", __FUNCTION__); + } + return pc; } #elif defined(__mc68000__) |