]> err.no Git - linux-2.6/blobdiff - arch/um/kernel/syscall.c
Blackfin arch: Apply Bluetchnix vendor patch provided by Harald Krapfenbauer
[linux-2.6] / arch / um / kernel / syscall.c
index f5ed8624648b88f0b0022a5994f202361fea19fb..b9d92b2089aed6cb0b3a5d67d0dafce8fd0051dc 100644 (file)
@@ -1,27 +1,17 @@
 /*
- * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
+ * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
 
-#include "linux/sched.h"
 #include "linux/file.h"
-#include "linux/smp_lock.h"
+#include "linux/fs.h"
 #include "linux/mm.h"
+#include "linux/sched.h"
 #include "linux/utsname.h"
-#include "linux/msg.h"
-#include "linux/shm.h"
-#include "linux/sys.h"
-#include "linux/syscalls.h"
-#include "linux/unistd.h"
-#include "linux/slab.h"
-#include "linux/utime.h"
+#include "asm/current.h"
 #include "asm/mman.h"
 #include "asm/uaccess.h"
-#include "kern_util.h"
-#include "user_util.h"
-#include "sysdep/syscalls.h"
-#include "mode_kern.h"
-#include "choose-mode.h"
+#include "asm/unistd.h"
 
 /*  Unlocked, I don't care if this is a bit off */
 int nsyscalls = 0;
@@ -34,7 +24,7 @@ long sys_fork(void)
        ret = do_fork(SIGCHLD, UPT_SP(&current->thread.regs.regs),
                      &current->thread.regs, 0, NULL, NULL);
        current->thread.forking = 0;
-       return(ret);
+       return ret;
 }
 
 long sys_vfork(void)
@@ -46,7 +36,7 @@ long sys_vfork(void)
                      UPT_SP(&current->thread.regs.regs),
                      &current->thread.regs, 0, NULL, NULL);
        current->thread.forking = 0;
-       return(ret);
+       return ret;
 }
 
 /* common code for old and new mmaps */
@@ -92,15 +82,15 @@ long old_mmap(unsigned long addr, unsigned long len,
  */
 long sys_pipe(unsigned long __user * fildes)
 {
-        int fd[2];
-        long error;
+       int fd[2];
+       long error;
 
-        error = do_pipe(fd);
-        if (!error) {
+       error = do_pipe(fd);
+       if (!error) {
                if (copy_to_user(fildes, fd, sizeof(fd)))
-                        error = -EFAULT;
-        }
-        return error;
+                       error = -EFAULT;
+       }
+       return error;
 }
 
 
@@ -124,7 +114,7 @@ long sys_olduname(struct oldold_utsname __user * name)
        if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
                return -EFAULT;
 
-       down_read(&uts_sem);
+       down_read(&uts_sem);
 
        error = __copy_to_user(&name->sysname, &utsname()->sysname,
                               __OLD_UTS_LEN);
@@ -149,22 +139,6 @@ long sys_olduname(struct oldold_utsname __user * name)
        return error;
 }
 
-DEFINE_SPINLOCK(syscall_lock);
-
-static int syscall_index = 0;
-
-int next_syscall_index(int limit)
-{
-       int ret;
-
-       spin_lock(&syscall_lock);
-       ret = syscall_index;
-       if(++syscall_index == limit)
-               syscall_index = 0;
-       spin_unlock(&syscall_lock);
-       return(ret);
-}
-
 int kernel_execve(const char *filename, char *const argv[], char *const envp[])
 {
        mm_segment_t fs;