diff options
Diffstat (limited to 'arch/x86/kernel/process_32.c')
-rw-r--r-- | arch/x86/kernel/process_32.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index c13df2c735f8..737527b40e5b 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -324,31 +324,3 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
324 | 324 | ||
325 | return prev_p; | 325 | return prev_p; |
326 | } | 326 | } |
327 | |||
328 | #define top_esp (THREAD_SIZE - sizeof(unsigned long)) | ||
329 | #define top_ebp (THREAD_SIZE - 2*sizeof(unsigned long)) | ||
330 | |||
331 | unsigned long get_wchan(struct task_struct *p) | ||
332 | { | ||
333 | unsigned long bp, sp, ip; | ||
334 | unsigned long stack_page; | ||
335 | int count = 0; | ||
336 | if (!p || p == current || p->state == TASK_RUNNING) | ||
337 | return 0; | ||
338 | stack_page = (unsigned long)task_stack_page(p); | ||
339 | sp = p->thread.sp; | ||
340 | if (!stack_page || sp < stack_page || sp > top_esp+stack_page) | ||
341 | return 0; | ||
342 | /* include/asm-i386/system.h:switch_to() pushes bp last. */ | ||
343 | bp = *(unsigned long *) sp; | ||
344 | do { | ||
345 | if (bp < stack_page || bp > top_ebp+stack_page) | ||
346 | return 0; | ||
347 | ip = *(unsigned long *) (bp+4); | ||
348 | if (!in_sched_functions(ip)) | ||
349 | return ip; | ||
350 | bp = *(unsigned long *) bp; | ||
351 | } while (count++ < 16); | ||
352 | return 0; | ||
353 | } | ||
354 | |||