Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[powerpc.git] / include / asm-arm / unistd.h
index cbf39a5..14a87ee 100644 (file)
@@ -13,8 +13,6 @@
 #ifndef __ASM_ARM_UNISTD_H
 #define __ASM_ARM_UNISTD_H
 
-#include <linux/linkage.h>
-
 #define __NR_OABI_SYSCALL_BASE 0x900000
 
 #if defined(__thumb__) || defined(__ARM_EABI__)
 #undef __NR_ipc
 #endif
 
+#ifdef __KERNEL__
+#include <linux/err.h>
+#include <linux/linkage.h>
+
 #define __sys2(x) #x
 #define __sys1(x) __sys2(x)
 
 
 #define __syscall_return(type, res)                                    \
 do {                                                                   \
-       if ((unsigned long)(res) >= (unsigned long)(-129)) {            \
+       if ((unsigned long)(res) >= (unsigned long)(-MAX_ERRNO)) {      \
                errno = -(res);                                         \
                res = -1;                                               \
        }                                                               \
@@ -526,7 +528,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
   __syscall_return(type,__res);                                                \
 }
 
-#ifdef __KERNEL__
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_GETHOSTNAME
@@ -547,31 +548,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_SYS_SOCKETCALL
 #endif
-#endif
-
-#ifdef __KERNEL_SYSCALLS__
-
-#include <linux/compiler.h>
-#include <linux/types.h>
-#include <linux/syscalls.h>
-
-extern long execve(const char *file, char **argv, char **envp);
-
-struct pt_regs;
-asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
-                       struct pt_regs *regs);
-asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
-                       struct pt_regs *regs);
-asmlinkage int sys_fork(struct pt_regs *regs);
-asmlinkage int sys_vfork(struct pt_regs *regs);
-asmlinkage int sys_pipe(unsigned long *fildes);
-struct sigaction;
-asmlinkage long sys_rt_sigaction(int sig,
-                               const struct sigaction __user *act,
-                               struct sigaction __user *oact,
-                               size_t sigsetsize);
-
-#endif
 
 /*
  * "Conditional" syscalls
@@ -581,4 +557,5 @@ asmlinkage long sys_rt_sigaction(int sig,
  */
 #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
 
+#endif /* __KERNEL__ */
 #endif /* __ASM_ARM_UNISTD_H */