vserver 2.0 rc7
[linux-2.6.git] / arch / parisc / kernel / process.c
index f04dea6..46e4a68 100644 (file)
@@ -54,7 +54,7 @@
 #include <asm/uaccess.h>
 #include <asm/unwind.h>
 
-int hlt_counter;
+static int hlt_counter;
 
 /*
  * Power off function, if any
@@ -251,7 +251,7 @@ int
 sys_clone(unsigned long clone_flags, unsigned long usp,
          struct pt_regs *regs)
 {
-       int *user_tid = (int *)regs->gr[26];
+       int __user *user_tid = (int __user *)regs->gr[26];
 
        /* usp must be word aligned.  This also prevents users from
         * passing in the value 1 (which is the signal for a special
@@ -262,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
@@ -357,14 +357,17 @@ asmlinkage int sys_execve(struct pt_regs *regs)
        int error;
        char *filename;
 
-       filename = getname((char *) regs->gr[26]);
+       filename = getname((const char __user *) regs->gr[26]);
        error = PTR_ERR(filename);
        if (IS_ERR(filename))
                goto out;
-       error = do_execve(filename, (char **) regs->gr[25],
-               (char **) regs->gr[24], regs);
-       if (error == 0)
+       error = do_execve(filename, (char __user **) regs->gr[25],
+               (char __user **) regs->gr[24], regs);
+       if (error == 0) {
+               task_lock(current);
                current->ptrace &= ~PT_DTRACE;
+               task_unlock(current);
+       }
        putname(filename);
 out:
 
@@ -380,18 +383,14 @@ get_wchan(struct task_struct *p)
        /*
         * These bracket the sleeping functions..
         */
-#      define first_sched      ((unsigned long) scheduling_functions_start_here)
-#      define last_sched       ((unsigned long) scheduling_functions_end_here)
 
        unwind_frame_init_from_blocked_task(&info, p);
        do {
                if (unwind_once(&info) < 0)
                        return 0;
                ip = info.ip;
-               if (ip < first_sched || ip >= last_sched)
+               if (!in_sched_functions(ip))
                        return ip;
        } while (count++ < 16);
        return 0;
-#      undef first_sched
-#      undef last_sched
 }