fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / asm-m68knommu / unistd.h
index 833cb04..82e0319 100644 (file)
@@ -5,6 +5,7 @@
  * This file contains the system call numbers.
  */
 
+#define __NR_restart_syscall      0
 #define __NR_exit                1
 #define __NR_fork                2
 #define __NR_read                3
@@ -80,7 +81,7 @@
 #define __NR_sigpending                 73
 #define __NR_sethostname        74
 #define __NR_setrlimit          75
-#define __NR_old_getrlimit      76
+#define __NR_getrlimit          76
 #define __NR_getrusage          77
 #define __NR_gettimeofday       78
 #define __NR_settimeofday       79
 #define __NR_mremap            163
 #define __NR_setresuid         164
 #define __NR_getresuid         165
+#define __NR_getpagesize       166
 #define __NR_query_module      167
 #define __NR_poll              168
 #define __NR_nfsservctl                169
 #define __NR_getpmsg           188     /* some people actually want streams */
 #define __NR_putpmsg           189     /* some people actually want streams */
 #define __NR_vfork             190
-#define __NR_getrlimit         191
+#define __NR_ugetrlimit                191
 #define __NR_mmap2             192
 #define __NR_truncate64                193
 #define __NR_ftruncate64       194
 #define __NR_setgid32          214
 #define __NR_setfsuid32                215
 #define __NR_setfsgid32                216
+#define __NR_pivot_root                217
+#define __NR_getdents64                220
+#define __NR_gettid            221
+#define __NR_tkill             222
+#define __NR_setxattr          223
+#define __NR_lsetxattr         224
+#define __NR_fsetxattr         225
+#define __NR_getxattr          226
+#define __NR_lgetxattr         227
+#define __NR_fgetxattr         228
+#define __NR_listxattr         229
+#define __NR_llistxattr                230
+#define __NR_flistxattr                231
+#define __NR_removexattr       232
+#define __NR_lremovexattr      233
+#define __NR_fremovexattr      234
+#define __NR_futex             235
+#define __NR_sendfile64                236
+#define __NR_mincore           237
+#define __NR_madvise           238
+#define __NR_fcntl64           239
+#define __NR_readahead         240
+#define __NR_io_setup          241
+#define __NR_io_destroy                242
+#define __NR_io_getevents      243
+#define __NR_io_submit         244
+#define __NR_io_cancel         245
+#define __NR_fadvise64         246
+#define __NR_exit_group                247
+#define __NR_lookup_dcookie    248
+#define __NR_epoll_create      249
+#define __NR_epoll_ctl         250
+#define __NR_epoll_wait                251
+#define __NR_remap_file_pages  252
+#define __NR_set_tid_address   253
+#define __NR_timer_create      254
+#define __NR_timer_settime     255
+#define __NR_timer_gettime     256
+#define __NR_timer_getoverrun  257
+#define __NR_timer_delete      258
+#define __NR_clock_settime     259
+#define __NR_clock_gettime     260
+#define __NR_clock_getres      261
+#define __NR_clock_nanosleep   262
+#define __NR_statfs64          263
+#define __NR_fstatfs64         264
+#define __NR_tgkill            265
+#define __NR_utimes            266
+#define __NR_fadvise64_64      267
+#define __NR_mbind             268
+#define __NR_get_mempolicy     269
+#define __NR_set_mempolicy     270
+#define __NR_mq_open           271
+#define __NR_mq_unlink         272
+#define __NR_mq_timedsend      273
+#define __NR_mq_timedreceive   274
+#define __NR_mq_notify         275
+#define __NR_mq_getsetattr     276
+#define __NR_waitid            277
+#define __NR_vserver           278
+#define __NR_add_key           279
+#define __NR_request_key       280
+#define __NR_keyctl            281
+#define __NR_ioprio_set                282
+#define __NR_ioprio_get                283
+#define __NR_inotify_init      284
+#define __NR_inotify_add_watch 285
+#define __NR_inotify_rm_watch  286
+#define __NR_migrate_pages     287
+#define __NR_openat            288
+#define __NR_mkdirat           289
+#define __NR_mknodat           290
+#define __NR_fchownat          291
+#define __NR_futimesat         292
+#define __NR_fstatat64         293
+#define __NR_unlinkat          294
+#define __NR_renameat          295
+#define __NR_linkat            296
+#define __NR_symlinkat         297
+#define __NR_readlinkat                298
+#define __NR_fchmodat          299
+#define __NR_faccessat         300
+#define __NR_pselect6          301
+#define __NR_ppoll             302
+#define __NR_unshare           303
+#define __NR_set_robust_list   304
+#define __NR_get_robust_list   305
+#define __NR_splice            306
+#define __NR_sync_file_range   307
+#define __NR_tee               308
+#define __NR_vmsplice          309
+#define __NR_move_pages                310
 
-#define __NR_vserver           273
-
-#define NR_syscalls            274
-
-/* user-visible error numbers are in the range -1 - -122: see
-   <asm-m68k/errno.h> */
-
-#define __syscall_return(type, res) \
-do { \
-       if ((unsigned long)(res) >= (unsigned long)(-125)) { \
-       /* avoid using res which is declared to be in register d0; \
-          errno might expand to a function call and clobber it.  */ \
-               int __err = -(res); \
-               errno = __err; \
-               res = -1; \
-       } \
-       return (type) (res); \
-} while (0)
-
-#define _syscall0(type, name)                                                  \
-type name(void)                                                                        \
-{                                                                              \
-  long __res;                                                                  \
-  __asm__ __volatile__ ("movel %1, %%d0\n\t"                                   \
-                       "trap   #0\n\t"                                         \
-                       "movel  %%d0, %0"                                       \
-                       : "=g" (__res)                                          \
-                       : "i" (__NR_##name)                                     \
-                       : "cc", "%d0");                                         \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                               \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
-
-#define _syscall1(type, name, atype, a)                                                \
-type name(atype a)                                                             \
-{                                                                              \
-  long __res;                                                                  \
-  __asm__ __volatile__ ("movel %2, %%d1\n\t"                                   \
-                       "movel  %1, %%d0\n\t"                                   \
-                       "trap   #0\n\t"                                         \
-                       "movel  %%d0, %0"                                       \
-                       : "=g" (__res)                                          \
-                       : "i" (__NR_##name),                                    \
-                         "g" ((long)a)                                         \
-                       : "cc", "%d0", "%d1");                                  \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                               \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
-
-#define _syscall2(type, name, atype, a, btype, b)                              \
-type name(atype a, btype b)                                                    \
-{                                                                              \
-  long __res;                                                                  \
-  __asm__ __volatile__ ("movel %3, %%d2\n\t"                                   \
-                       "movel  %2, %%d1\n\t"                                   \
-                       "movel  %1, %%d0\n\t"                                   \
-                       "trap   #0\n\t"                                         \
-                       "movel  %%d0, %0"                                       \
-                       : "=g" (__res)                                          \
-                       : "i" (__NR_##name),                                    \
-                         "a" ((long)a),                                        \
-                         "g" ((long)b)                                         \
-                       : "cc", "%d0", "%d1", "%d2");                           \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                               \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
-
-#define _syscall3(type, name, atype, a, btype, b, ctype, c)                    \
-type name(atype a, btype b, ctype c)                                           \
-{                                                                              \
-  long __res;                                                                  \
-  __asm__ __volatile__ ("movel %4, %%d3\n\t"                                   \
-                       "movel  %3, %%d2\n\t"                                   \
-                       "movel  %2, %%d1\n\t"                                   \
-                       "movel  %1, %%d0\n\t"                                   \
-                       "trap   #0\n\t"                                         \
-                       "movel  %%d0, %0"                                       \
-                       : "=g" (__res)                                          \
-                       : "i" (__NR_##name),                                    \
-                         "a" ((long)a),                                        \
-                         "a" ((long)b),                                        \
-                         "g" ((long)c)                                         \
-                       : "cc", "%d0", "%d1", "%d2", "%d3");                    \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                               \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
-
-#define _syscall4(type, name, atype, a, btype, b, ctype, c, dtype, d)          \
-type name(atype a, btype b, ctype c, dtype d)                                  \
-{                                                                              \
-  long __res;                                                                  \
-  __asm__ __volatile__ ("movel %5, %%d4\n\t"                                   \
-                       "movel  %4, %%d3\n\t"                                   \
-                       "movel  %3, %%d2\n\t"                                   \
-                       "movel  %2, %%d1\n\t"                                   \
-                       "movel  %1, %%d0\n\t"                                   \
-                       "trap   #0\n\t"                                         \
-                       "movel  %%d0, %0"                                       \
-                       : "=g" (__res)                                          \
-                       : "i" (__NR_##name),                                    \
-                         "a" ((long)a),                                        \
-                         "a" ((long)b),                                        \
-                         "a" ((long)c),                                        \
-                         "g" ((long)d)                                         \
-                       : "cc", "%d0", "%d1", "%d2", "%d3",                     \
-                         "%d4");                                               \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                               \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
+#ifdef __KERNEL__
 
-#define _syscall5(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e)        \
-type name(atype a, btype b, ctype c, dtype d, etype e)                         \
-{                                                                              \
-  long __res;                                                                  \
-  __asm__ __volatile__ ("movel %6, %%d5\n\t"                                   \
-                       "movel  %5, %%d4\n\t"                                   \
-                       "movel  %4, %%d3\n\t"                                   \
-                       "movel  %3, %%d2\n\t"                                   \
-                       "movel  %2, %%d1\n\t"                                   \
-                       "movel  %1, %%d0\n\t"                                   \
-                       "trap   #0\n\t"                                         \
-                       "movel  %%d0, %0"                                       \
-                       : "=g" (__res)                                          \
-                       : "i" (__NR_##name),                                    \
-                         "a" ((long)a),                                        \
-                         "a" ((long)b),                                        \
-                         "a" ((long)c),                                        \
-                         "a" ((long)d),                                        \
-                         "g" ((long)e)                                         \
-                       : "cc", "%d0", "%d1", "%d2", "%d3",                     \
-                         "%d4", "%d5");                                        \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                               \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
+#define NR_syscalls            311
 
-#ifdef __KERNEL__
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_STAT
@@ -397,63 +341,6 @@ type name(atype a, btype b, ctype c, dtype d, etype e)                             \
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
-#endif
-
-#ifdef __KERNEL_SYSCALLS__
-
-#include <linux/compiler.h>
-#include <linux/interrupt.h>
-#include <linux/types.h>
-
-/*
- * we need this inline - forking from kernel space will result
- * in NO COPY ON WRITE (!!!), until an execve is executed. This
- * is no problem, but for the stack. This is handled by not letting
- * main() use the stack at all after fork(). Thus, no function
- * calls - which means inline code for fork too, as otherwise we
- * would use the stack upon exit from 'fork()'.
- *
- * Actually only pause and fork are needed inline, so that there
- * won't be any messing with the stack from main(), but we define
- * some others too.
- */
-#define __NR__exit __NR_exit
-static inline _syscall0(int,pause)
-static inline _syscall0(int,sync)
-static inline _syscall0(pid_t,setsid)
-static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
-static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
-static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
-static inline _syscall1(int,dup,int,fd)
-static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
-static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
-static inline _syscall1(int,close,int,fd)
-static inline _syscall1(int,_exit,int,exitcode)
-static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
-static inline _syscall1(int,delete_module,const char *,name)
-
-static inline pid_t wait(int * wait_stat)
-{
-       return waitpid(-1,wait_stat,0);
-}
-asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
-                       unsigned long prot, unsigned long flags,
-                       unsigned long fd, unsigned long pgoff);
-asmlinkage int sys_execve(char *name, char **argv, char **envp);
-asmlinkage int sys_pipe(unsigned long *fildes);
-asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
-struct pt_regs;
-int sys_request_irq(unsigned int,
-                       irqreturn_t (*)(int, void *, struct pt_regs *),
-                       unsigned long, const char *, void *);
-void sys_free_irq(unsigned int, void *);
-struct sigaction;
-asmlinkage long sys_rt_sigaction(int sig,
-                               const struct sigaction __user *act,
-                               struct sigaction __user *oact,
-                               size_t sigsetsize);
-
-#endif
 
 /*
  * "Conditional" syscalls
@@ -461,6 +348,7 @@ asmlinkage long sys_rt_sigaction(int sig,
  * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
  * but it doesn't work on all toolchains, so we just do it by hand
  */
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
+#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
 
+#endif /* __KERNEL__ */
 #endif /* _ASM_M68K_UNISTD_H_ */