vserver 1.9.3
[linux-2.6.git] / arch / parisc / kernel / process.c
index b6ae7c4..d7365b9 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/sched.h>
 #include <linux/stddef.h>
 #include <linux/unistd.h>
+#include <linux/kallsyms.h>
 
 #include <asm/io.h>
 #include <asm/offsets.h>
@@ -51,6 +52,7 @@
 #include <asm/pdc_chassis.h>
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
+#include <asm/unwind.h>
 
 int hlt_counter;
 
@@ -260,7 +262,7 @@ sys_clone(unsigned long clone_flags, unsigned long usp,
        if(usp == 0)
                usp = regs->gr[30];
 
-       return do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0, user_tid, NULL);
+       return do_fork(clone_flags, usp, regs, 0, user_tid, NULL);
 }
 
 int
@@ -368,3 +370,24 @@ out:
 
        return error;
 }
+
+unsigned long 
+get_wchan(struct task_struct *p)
+{
+       struct unwind_frame_info info;
+       unsigned long ip;
+       int count = 0;
+       /*
+        * These bracket the sleeping functions..
+        */
+
+       unwind_frame_init_from_blocked_task(&info, p);
+       do {
+               if (unwind_once(&info) < 0)
+                       return 0;
+               ip = info.ip;
+               if (!in_sched_functions(ip))
+                       return ip;
+       } while (count++ < 16);
+       return 0;
+}