]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/um/sys-i386/syscalls.c
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
[linux-2.6-omap-h63xx.git] / arch / um / sys-i386 / syscalls.c
index 1845123ed1249b5305303c02a1a870f70d20143a..857ca0b3bdef136a78b7eb59a00b2de4a14b6aed 100644 (file)
@@ -5,7 +5,8 @@
 
 #include "linux/sched.h"
 #include "linux/shm.h"
-#include "asm/ipc.h"
+#include "linux/ipc.h"
+#include "linux/syscalls.h"
 #include "asm/mman.h"
 #include "asm/uaccess.h"
 #include "asm/unistd.h"
@@ -61,21 +62,27 @@ long old_select(struct sel_arg_struct __user *arg)
        return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
 }
 
-/* The i386 version skips reading from %esi, the fourth argument. So we must do
- * this, too.
+/*
+ * The prototype on i386 is:
+ *
+ *     int clone(int flags, void * child_stack, int * parent_tidptr, struct user_desc * newtls, int * child_tidptr)
+ *
+ * and the "newtls" arg. on i386 is read by copy_thread directly from the
+ * register saved on the stack.
  */
 long sys_clone(unsigned long clone_flags, unsigned long newsp,
-              int __user *parent_tid, int unused, int __user *child_tid)
+              int __user *parent_tid, void *newtls, int __user *child_tid)
 {
        long ret;
 
        if (!newsp)
                newsp = UPT_SP(&current->thread.regs.regs);
+
        current->thread.forking = 1;
        ret = do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid,
                      child_tid);
        current->thread.forking = 0;
-       return(ret);
+       return ret;
 }
 
 /*
@@ -93,11 +100,12 @@ long sys_ipc (uint call, int first, int second,
 
        switch (call) {
        case SEMOP:
-               return sys_semtimedop(first, (struct sembuf *) ptr, second,
-                                     NULL);
+               return sys_semtimedop(first, (struct sembuf __user *) ptr,
+                                     second, NULL);
        case SEMTIMEDOP:
-               return sys_semtimedop(first, (struct sembuf *) ptr, second,
-                                     (const struct timespec *) fifth);
+               return sys_semtimedop(first, (struct sembuf __user *) ptr,
+                                     second,
+                                     (const struct timespec __user *) fifth);
        case SEMGET:
                return sys_semget (first, second, third);
        case SEMCTL: {