fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / asm-h8300 / unistd.h
index 4f73d08..7ddd414 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
 #define __NR_clock_gettime     (__NR_timer_create+6)
 #define __NR_clock_getres      (__NR_timer_create+7)
 #define __NR_clock_nanosleep   (__NR_timer_create+8)
+#define __NR_statfs64          268
+#define __NR_fstatfs64         269
+#define __NR_tgkill            270
+#define __NR_utimes            271
+#define __NR_fadvise64_64      272
+#define __NR_vserver           273
+#define __NR_mbind             274
+#define __NR_get_mempolicy     275
+#define __NR_set_mempolicy     276
+#define __NR_mq_open           277
+#define __NR_mq_unlink         (__NR_mq_open+1)
+#define __NR_mq_timedsend      (__NR_mq_open+2)
+#define __NR_mq_timedreceive   (__NR_mq_open+3)
+#define __NR_mq_notify         (__NR_mq_open+4)
+#define __NR_mq_getsetattr     (__NR_mq_open+5)
+#define __NR_kexec_load                283
+#define __NR_waitid            284
+/* #define __NR_sys_setaltroot 285 */
+#define __NR_add_key           286
+#define __NR_request_key       287
+#define __NR_keyctl            288
 
-#define NR_syscalls 268
+#ifdef __KERNEL__
 
+#define NR_syscalls 289
 
-/* 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)                                                                        \
-{                                                                              \
-  register long __res __asm__("er0");                                          \
-  __asm__ __volatile__ ("mov.l %1,er0\n\t"                                     \
-                       "trapa  #0\n\t"                                         \
-                       : "=r" (__res)                                          \
-                       : "ir" (__NR_##name)                                    \
-                       : "cc");                                                \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                       \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
-
-#define _syscall1(type, name, atype, a)                                                \
-type name(atype a)                                                             \
-{                                                                              \
-  register long __res __asm__("er0");                                          \
-  __asm__ __volatile__ ("mov.l %2, er1\n\t"                                    \
-                       "mov.l  %1, er0\n\t"                                    \
-                       "trapa  #0\n\t"                                         \
-                       : "=r" (__res)                                          \
-                       : "ir" (__NR_##name),                                   \
-                         "g" ((long)a)                                         \
-                       : "cc", "er1");                                 \
-  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)                                                    \
-{                                                                              \
-  register long __res __asm__("er0");                                          \
-  __asm__ __volatile__ ("mov.l %3, er2\n\t"                                    \
-                       "mov.l  %2, er1\n\t"                                    \
-                       "mov.l  %1, er0\n\t"                                    \
-                       "trapa  #0\n\t"                                         \
-                       : "=r" (__res)                                          \
-                       : "ir" (__NR_##name),                                   \
-                         "g" ((long)a),                                        \
-                         "g" ((long)b)                                         \
-                       : "cc", "er1", "er2");                          \
-  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)                                           \
-{                                                                              \
-  register long __res __asm__("er0");                                          \
-  __asm__ __volatile__ ("mov.l %4, er3\n\t"                                    \
-                       "mov.l  %3, er2\n\t"                                    \
-                       "mov.l  %2, er1\n\t"                                    \
-                       "mov.l  %1, er0\n\t"                                    \
-                       "trapa  #0\n\t"                                         \
-                       : "=r" (__res)                                          \
-                       : "ir" (__NR_##name),                                   \
-                         "g" ((long)a),                                        \
-                         "g" ((long)b),                                        \
-                         "g" ((long)c)                                         \
-                       : "cc", "er1", "er2", "er3");                   \
-  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)                                  \
-{                                                                              \
-  register long __res __asm__("er0");                                          \
-  __asm__ __volatile__ ("mov.l %5, er4\n\t"                                    \
-                       "mov.l  %4, er3\n\t"                                    \
-                       "mov.l  %3, er2\n\t"                                    \
-                       "mov.l  %2, er1\n\t"                                    \
-                       "mov.l  %1, er0\n\t"                                    \
-                       "trapa  #0\n\t"                                         \
-                       : "=r" (__res)                                          \
-                       : "ir" (__NR_##name),                                   \
-                         "g" ((long)a),                                        \
-                         "g" ((long)b),                                        \
-                         "g" ((long)c),                                        \
-                         "g" ((long)d)                                         \
-                       : "cc", "er1", "er2", "er3", "er4");                    \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                       \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
-
-#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)                         \
-{                                                                              \
-  register long __res __asm__("er0");                                          \
-  __asm__ __volatile__ ("mov.l %6, er5\n\t"                                    \
-                       "mov.l  %5, er4\n\t"                                    \
-                       "mov.l  %4, er3\n\t"                                    \
-                       "mov.l  %3, er2\n\t"                                    \
-                       "mov.l  %2, er1\n\t"                                    \
-                       "mov.l  %1, er0\n\t"                                    \
-                       "trapa  #0\n\t"                                         \
-                       : "=r" (__res)                                          \
-                       : "ir" (__NR_##name),                                   \
-                         "g" ((long)a),                                        \
-                         "g" ((long)b),                                        \
-                         "g" ((long)c),                                        \
-                         "g" ((long)d),                                        \
-                         "m" ((long)e)                                         \
-                       : "cc", "er1", "er2", "er3", "er4", "er5");             \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                       \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
-               
-#define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d,           \
-                              etype, e, ftype, f)                              \
-type name(atype a, btype b, ctype c, dtype d, etype e, ftype f)                        \
-{                                                                              \
-  register long __res __asm__("er0");                                          \
-  __asm__ __volatile__ ("mov.l er6,@-sp\n\t"                                   \
-                        "mov.l %7, er6\n\t"                                    \
-                        "mov.l %6, er5\n\t"                                    \
-                       "mov.l  %5, er4\n\t"                                    \
-                       "mov.l  %4, er3\n\t"                                    \
-                       "mov.l  %3, er2\n\t"                                    \
-                       "mov.l  %2, er1\n\t"                                    \
-                       "mov.l  %1, er0\n\t"                                    \
-                       "trapa  #0\n\t"                                         \
-                       "mov.l  @sp+,er6"                                       \
-                       : "=r" (__res)                                          \
-                       : "ir" (__NR_##name),                                   \
-                         "g" ((long)a),                                        \
-                         "g" ((long)b),                                        \
-                         "g" ((long)c),                                        \
-                         "g" ((long)d),                                        \
-                         "m" ((long)e),                                        \
-                         "m" ((long)e)                                         \
-                       : "cc", "er1", "er2", "er3", "er4", "er5");             \
-  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                       \
-    errno = -__res;                                                            \
-    __res = -1;                                                                        \
-  }                                                                            \
-  return (type)__res;                                                          \
-}
-               
-
-#ifdef __KERNEL_SYSCALLS__
-
-#include <linux/compiler.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,
-                       int dummy, ...);
-asmlinkage int sys_pipe(unsigned long *fildes);
-asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
-struct sigaction;
-asmlinkage long sys_rt_sigaction(int sig,
-                               const struct sigaction __user *act,
-                               struct sigaction __user *oact,
-                               size_t sigsetsize);
-
-#endif
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
 
 /*
  * "Conditional" syscalls
@@ -505,4 +326,5 @@ asmlinkage long sys_rt_sigaction(int sig,
   asm (".weak\t_" #name "\n"                           \
        ".set\t_" #name ",_sys_ni_syscall");
 
+#endif /* __KERNEL__ */
 #endif /* _ASM_H8300_UNISTD_H_ */