summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/mips
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-02-01 11:45:39 +0000
committerEric Andersen <andersen@codepoet.org>2002-02-01 11:45:39 +0000
commitc5ffc06cace91cf3aa4a6c0c14ca19411f546cb1 (patch)
tree18d0ba1d5d99b77040248cdf651d40e96df5eb58 /libc/sysdeps/linux/mips
parent7fa1ecbbee59a40ec35de8f22968ea6cf05a2969 (diff)
Add in syscalls.h for mipsel, thanks to Steven J. Hill.
Remove and ignore generated syscall.h files from sparc and mipsel.
Diffstat (limited to 'libc/sysdeps/linux/mips')
-rw-r--r--libc/sysdeps/linux/mips/bits/.cvsignore1
-rw-r--r--libc/sysdeps/linux/mips/bits/syscall.h229
-rw-r--r--libc/sysdeps/linux/mips/bits/syscalls.h224
3 files changed, 225 insertions, 229 deletions
diff --git a/libc/sysdeps/linux/mips/bits/.cvsignore b/libc/sysdeps/linux/mips/bits/.cvsignore
new file mode 100644
index 000000000..414354767
--- /dev/null
+++ b/libc/sysdeps/linux/mips/bits/.cvsignore
@@ -0,0 +1 @@
+syscall.h
diff --git a/libc/sysdeps/linux/mips/bits/syscall.h b/libc/sysdeps/linux/mips/bits/syscall.h
deleted file mode 100644
index 1bed539d4..000000000
--- a/libc/sysdeps/linux/mips/bits/syscall.h
+++ /dev/null
@@ -1,229 +0,0 @@
-/* Generated at libc build time from kernel syscall list. */
-
-#ifndef _SYSCALL_H
-# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
-#endif
-
-#define SYS_write __NR_write
-#define SYS_setrlimit __NR_setrlimit
-#define SYS_getdents __NR_getdents
-#define SYS_umount __NR_umount
-#define SYS_munlock __NR_munlock
-#define SYS_delete_module __NR_delete_module
-#define SYS_fstat __NR_fstat
-#define SYS_getpgid __NR_getpgid
-#define SYS_madvise __NR_madvise
-#define SYS_rt_sigaction __NR_rt_sigaction
-#define SYS_setfsgid __NR_setfsgid
-#define SYS_chroot __NR_chroot
-#define SYS_modify_ldt __NR_modify_ldt
-#define SYS_times __NR_times
-#define SYS_rt_sigsuspend __NR_rt_sigsuspend
-#define SYS_setpgid __NR_setpgid
-#define SYS_getpgrp __NR_getpgrp
-#define SYS_break __NR_break
-#define SYS_getsockopt __NR_getsockopt
-#define SYS_putpmsg __NR_putpmsg
-#define SYS_query_module __NR_query_module
-#define SYS_pause __NR_pause
-#define SYS_writev __NR_writev
-#define SYS_rename __NR_rename
-#define SYS_truncate __NR_truncate
-#define SYS_profil __NR_profil
-#define SYS_waitpid __NR_waitpid
-#define SYS_sigreturn __NR_sigreturn
-#define SYS_setresgid __NR_setresgid
-#define SYS_readdir __NR_readdir
-#define SYS_fsync __NR_fsync
-#define SYS_sigaltstack __NR_sigaltstack
-#define SYS_lstat __NR_lstat
-#define SYS_dup2 __NR_dup2
-#define SYS_getpmsg __NR_getpmsg
-#define SYS_clone __NR_clone
-#define SYS_lstat64 __NR_lstat64
-#define SYS_getppid __NR_getppid
-#define SYS_umount2 __NR_umount2
-#define SYS_close __NR_close
-#define SYS_setgid __NR_setgid
-#define SYS_bdflush __NR_bdflush
-#define SYS_statfs __NR_statfs
-#define SYS_mount __NR_mount
-#define SYS_sgetmask __NR_sgetmask
-#define SYS_idle __NR_idle
-#define SYS_sigaction __NR_sigaction
-#define SYS_wait4 __NR_wait4
-#define SYS_fork __NR_fork
-#define SYS_setfsuid __NR_setfsuid
-#define SYS_settimeofday __NR_settimeofday
-#define SYS_pwrite __NR_pwrite
-#define SYS_ssetmask __NR_ssetmask
-#define SYS_rt_sigpending __NR_rt_sigpending
-#define SYS_setsockopt __NR_setsockopt
-#define SYS_oldfstat __NR_oldfstat
-#define SYS_afs_syscall __NR_afs_syscall
-#define SYS_exit __NR_exit
-#define SYS_sysinfo __NR_sysinfo
-#define SYS_getdents64 __NR_getdents64
-#define SYS_getsockname __NR_getsockname
-#define SYS_socket __NR_socket
-#define SYS_symlink __NR_symlink
-#define SYS_ioctl __NR_ioctl
-#define SYS_ftruncate __NR_ftruncate
-#define SYS_sched_getparam __NR_sched_getparam
-#define SYS_creat __NR_creat
-#define SYS_lchown __NR_lchown
-#define SYS_setresuid __NR_setresuid
-#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
-#define SYS_fcntl __NR_fcntl
-#define SYS_setsid __NR_setsid
-#define SYS_mprotect __NR_mprotect
-#define SYS_setuid __NR_setuid
-#define SYS_socketpair __NR_socketpair
-#define SYS_gtty __NR_gtty
-#define SYS_oldlstat __NR_oldlstat
-#define SYS_umask __NR_umask
-#define SYS_iopl __NR_iopl
-#define SYS_kill __NR_kill
-#define SYS_nanosleep __NR_nanosleep
-#define SYS_uname __NR_uname
-#define SYS_stime __NR_stime
-#define SYS_signal __NR_signal
-#define SYS_getitimer __NR_getitimer
-#define SYS_truncate64 __NR_truncate64
-#define SYS_readv __NR_readv
-#define SYS_getcwd __NR_getcwd
-#define SYS_getpriority __NR_getpriority
-#define SYS_msync __NR_msync
-#define SYS_link __NR_link
-#define SYS_sched_setparam __NR_sched_setparam
-#define SYS_getgid __NR_getgid
-#define SYS_sysmips __NR_sysmips
-#define SYS__newselect __NR__newselect
-#define SYS_recvmsg __NR_recvmsg
-#define SYS_getrusage __NR_getrusage
-#define SYS_lock __NR_lock
-#define SYS_recvfrom __NR_recvfrom
-#define SYS__llseek __NR__llseek
-#define SYS_connect __NR_connect
-#define SYS_sched_yield __NR_sched_yield
-#define SYS_nice __NR_nice
-#define SYS_mmap __NR_mmap
-#define SYS_pivot_root __NR_pivot_root
-#define SYS_get_kernel_syms __NR_get_kernel_syms
-#define SYS_setgroups __NR_setgroups
-#define SYS_ulimit __NR_ulimit
-#define SYS_munmap __NR_munmap
-#define SYS_quotactl __NR_quotactl
-#define SYS_getrlimit __NR_getrlimit
-#define SYS_brk __NR_brk
-#define SYS_sched_getscheduler __NR_sched_getscheduler
-#define SYS_personality __NR_personality
-#define SYS_getpid __NR_getpid
-#define SYS_vhangup __NR_vhangup
-#define SYS_ioperm __NR_ioperm
-#define SYS_mremap __NR_mremap
-#define SYS_ptrace __NR_ptrace
-#define SYS_sendmsg __NR_sendmsg
-#define SYS_dup __NR_dup
-#define SYS_getsid __NR_getsid
-#define SYS_getegid __NR_getegid
-#define SYS_uselib __NR_uselib
-#define SYS_rt_sigprocmask __NR_rt_sigprocmask
-#define SYS_shutdown __NR_shutdown
-#define SYS_getuid __NR_getuid
-#define SYS_init_module __NR_init_module
-#define SYS_ipc __NR_ipc
-#define SYS_capget __NR_capget
-#define SYS_getresgid __NR_getresgid
-#define SYS_pipe __NR_pipe
-#define SYS_read __NR_read
-#define SYS_Linux_syscalls __NR_Linux_syscalls
-#define SYS_cacheflush __NR_cacheflush
-#define SYS_open __NR_open
-#define SYS_setdomainname __NR_setdomainname
-#define SYS_recv __NR_recv
-#define SYS_setregid __NR_setregid
-#define SYS_fstat64 __NR_fstat64
-#define SYS_fcntl64 __NR_fcntl64
-#define SYS_mpx __NR_mpx
-#define SYS_alarm __NR_alarm
-#define SYS_pread __NR_pread
-#define SYS_poll __NR_poll
-#define SYS_flock __NR_flock
-#define SYS_sigsuspend __NR_sigsuspend
-#define SYS_send __NR_send
-#define SYS_fdatasync __NR_fdatasync
-#define SYS_prctl __NR_prctl
-#define SYS_prof __NR_prof
-#define SYS_sysfs __NR_sysfs
-#define SYS_sethostname __NR_sethostname
-#define SYS_geteuid __NR_geteuid
-#define SYS_swapon __NR_swapon
-#define SYS_capset __NR_capset
-#define SYS_vm86 __NR_vm86
-#define SYS_create_module __NR_create_module
-#define SYS_execve __NR_execve
-#define SYS_utime __NR_utime
-#define SYS_reboot __NR_reboot
-#define SYS_socketcall __NR_socketcall
-#define SYS_fchdir __NR_fchdir
-#define SYS_getresuid __NR_getresuid
-#define SYS_sendfile __NR_sendfile
-#define SYS_time __NR_time
-#define SYS_setreuid __NR_setreuid
-#define SYS_getpeername __NR_getpeername
-#define SYS_ustat __NR_ustat
-#define SYS_mkdir __NR_mkdir
-#define SYS_rmdir __NR_rmdir
-#define SYS_unused109 __NR_unused109
-#define SYS_adjtimex __NR_adjtimex
-#define SYS_acct __NR_acct
-#define SYS_sched_setscheduler __NR_sched_setscheduler
-#define SYS_mlockall __NR_mlockall
-#define SYS_unused150 __NR_unused150
-#define SYS_fstatfs __NR_fstatfs
-#define SYS_stat __NR_stat
-#define SYS_sigpending __NR_sigpending
-#define SYS_mmap2 __NR_mmap2
-#define SYS_chdir __NR_chdir
-#define SYS_Linux __NR_Linux
-#define SYS_swapoff __NR_swapoff
-#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
-#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
-#define SYS_cachectl __NR_cachectl
-#define SYS_syslog __NR_syslog
-#define SYS_syscall __NR_syscall
-#define SYS_fchmod __NR_fchmod
-#define SYS_nfsservctl __NR_nfsservctl
-#define SYS_oldstat __NR_oldstat
-#define SYS_readlink __NR_readlink
-#define SYS_munlockall __NR_munlockall
-#define SYS_ftruncate64 __NR_ftruncate64
-#define SYS_stty __NR_stty
-#define SYS_listen __NR_listen
-#define SYS_accept __NR_accept
-#define SYS_reserved82 __NR_reserved82
-#define SYS_sendto __NR_sendto
-#define SYS_sync __NR_sync
-#define SYS_setitimer __NR_setitimer
-#define SYS_fchown __NR_fchown
-#define SYS_access __NR_access
-#define SYS_mincore __NR_mincore
-#define SYS_sched_get_priority_max __NR_sched_get_priority_max
-#define SYS_gettimeofday __NR_gettimeofday
-#define SYS_mknod __NR_mknod
-#define SYS_sched_get_priority_min __NR_sched_get_priority_min
-#define SYS_unused59 __NR_unused59
-#define SYS_getgroups __NR_getgroups
-#define SYS_bind __NR_bind
-#define SYS_chmod __NR_chmod
-#define SYS_mlock __NR_mlock
-#define SYS_unlink __NR_unlink
-#define SYS__sysctl __NR__sysctl
-#define SYS_sigprocmask __NR_sigprocmask
-#define SYS_rt_sigreturn __NR_rt_sigreturn
-#define SYS_lseek __NR_lseek
-#define SYS_setpriority __NR_setpriority
-#define SYS_ftime __NR_ftime
-#define SYS_chown __NR_chown
-#define SYS_stat64 __NR_stat64
diff --git a/libc/sysdeps/linux/mips/bits/syscalls.h b/libc/sysdeps/linux/mips/bits/syscalls.h
new file mode 100644
index 000000000..b0eae19f8
--- /dev/null
+++ b/libc/sysdeps/linux/mips/bits/syscalls.h
@@ -0,0 +1,224 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING.LIB" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2002 by Steven Hill <sjhill@realitydiluted.com>
+ */
+
+/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
+#define _syscall0(type,name) \
+type name(void) \
+{ \
+ register unsigned long __v0 asm("$2") = __NR_##name; \
+ register unsigned long __a3 asm("$7"); \
+ \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ "li\t$2, %2\t\t\t# " #name "\n\t" \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=&r" (__v0), "=r" (__a3) \
+ : "i" (__NR_##name) \
+ : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+ errno = __v0; \
+ return -1; \
+}
+
+/*
+ * DANGER: This macro isn't usable for the pipe(2) call
+ * which has a unusual return convention.
+ */
+#define _syscall1(type,name,atype,a) \
+type name(atype a) \
+{ \
+ register unsigned long __v0 asm("$2") = __NR_##name; \
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
+ register unsigned long __a3 asm("$7"); \
+ \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ "li\t$2, %3\t\t\t# " #name "\n\t" \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=&r" (__v0), "=r" (__a3) \
+ : "r" (__a0), "i" (__NR_##name) \
+ : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+ errno = __v0; \
+ return -1; \
+}
+
+#define _syscall2(type,name,atype,a,btype,b) \
+type name(atype a, btype b) \
+{ \
+ register unsigned long __v0 asm("$2") = __NR_##name; \
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
+ register unsigned long __a3 asm("$7"); \
+ \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ "li\t$2, %4\t\t\t# " #name "\n\t" \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=&r" (__v0), "=r" (__a3) \
+ : "r" (__a0), "r" (__a1), "i" (__NR_##name) \
+ : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+ errno = __v0; \
+ return -1; \
+}
+
+#define _syscall3(type,name,atype,a,btype,b,ctype,c) \
+type name(atype a, btype b, ctype c) \
+{ \
+ register unsigned long __v0 asm("$2") = __NR_##name; \
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
+ register unsigned long __a3 asm("$7"); \
+ \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ "li\t$2, %5\t\t\t# " #name "\n\t" \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=&r" (__v0), "=r" (__a3) \
+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name) \
+ : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+ errno = __v0; \
+ return -1; \
+}
+
+#define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
+type name(atype a, btype b, ctype c, dtype d) \
+{ \
+ register unsigned long __v0 asm("$2") = __NR_##name; \
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
+ \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ "li\t$2, %5\t\t\t# " #name "\n\t" \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=&r" (__v0), "+r" (__a3) \
+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name) \
+ : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+ errno = __v0; \
+ return -1; \
+}
+
+/*
+ * Using those means your brain needs more than an oil change ;-)
+ */
+
+#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 unsigned long __v0 asm("$2") = __NR_##name; \
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
+ \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ "lw\t$2, %6\n\t" \
+ "subu\t$29, 32\n\t" \
+ "sw\t$2, 16($29)\n\t" \
+ "li\t$2, %5\t\t\t# " #name "\n\t" \
+ "syscall\n\t" \
+ "addiu\t$29, 32\n\t" \
+ ".set\treorder" \
+ : "=&r" (__v0), "+r" (__a3) \
+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name), \
+ "m" ((unsigned long)e) \
+ : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+ errno = __v0; \
+ return -1; \
+}
+
+#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 unsigned long __v0 asm("$2") = __NR_##name; \
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
+ \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ "lw\t$2, %6\n\t" \
+ "lw\t$8, %7\n\t" \
+ "subu\t$29, 32\n\t" \
+ "sw\t$2, 16($29)\n\t" \
+ "sw\t$8, 20($29)\n\t" \
+ "li\t$2, %5\t\t\t# " #name "\n\t" \
+ "syscall\n\t" \
+ "addiu\t$29, 32\n\t" \
+ ".set\treorder" \
+ : "=&r" (__v0), "+r" (__a3) \
+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name), \
+ "m" ((unsigned long)e), "m" ((unsigned long)f) \
+ : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+ errno = __v0; \
+ return -1; \
+}
+
+#define _syscall7(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f,gtype,g) \
+type name(atype a, btype b, ctype c, dtype d, etype e, ftype f, gtype g) \
+{ \
+ register unsigned long __v0 asm("$2") = __NR_##name; \
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
+ \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ "lw\t$2, %6\n\t" \
+ "lw\t$8, %7\n\t" \
+ "lw\t$9, %8\n\t" \
+ "subu\t$29, 32\n\t" \
+ "sw\t$2, 16($29)\n\t" \
+ "sw\t$8, 20($29)\n\t" \
+ "sw\t$9, 24($29)\n\t" \
+ "li\t$2, %5\t\t\t# " #name "\n\t" \
+ "syscall\n\t" \
+ "addiu\t$29, 32\n\t" \
+ ".set\treorder" \
+ : "=&r" (__v0), "+r" (__a3) \
+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name), \
+ "m" ((unsigned long)e), "m" ((unsigned long)f), \
+ "m" ((unsigned long)g), \
+ : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+ errno = __v0; \
+ return -1; \
+}