]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-arm26/unistd.h
[PATCH] ntp: convert to the NTP4 reference model
[linux-2.6-omap-h63xx.git] / include / asm-arm26 / unistd.h
index be4c2fb9c04944cdf9a982f4a3b1412001e68edb..c6d2436c9d349ca322790a81fe95181988641da0 100644 (file)
@@ -14,8 +14,6 @@
 #ifndef __ASM_ARM_UNISTD_H
 #define __ASM_ARM_UNISTD_H
 
-#include <linux/linkage.h>
-
 #define __NR_SYSCALL_BASE      0x900000
 
 /*
 #define __ARM_NR_cacheflush            (__ARM_NR_BASE+2)
 #define __ARM_NR_usr26                 (__ARM_NR_BASE+3)
 
+#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)(-125)) {            \
+       if ((unsigned long)(res) >= (unsigned long)-MAX_ERRNO) {        \
                errno = -(res);                                         \
                res = -1;                                               \
        }                                                               \
@@ -443,7 +445,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_OLD_READDIR
 #define __ARCH_WANT_STAT64
@@ -462,7 +463,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
-#endif
 
 #ifdef __KERNEL_SYSCALLS__
 
@@ -486,7 +486,7 @@ asmlinkage long sys_rt_sigaction(int sig,
                                struct sigaction __user *oact,
                                size_t sigsetsize);
 
-#endif
+#endif /* __KERNEL_SYSCALLS__ */
 
 /*
  * "Conditional" syscalls
@@ -496,4 +496,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 */