summaryrefslogtreecommitdiffstats
path: root/libc/arch-x86
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:28:35 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:28:35 -0800
commit1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 (patch)
tree3be0c520fae17689bbf5584e1136fb820caef26f /libc/arch-x86
parent1767f908af327fa388b1c66883760ad851267013 (diff)
downloadbionic-1dc9e472e19acfe6dc7f41e429236e7eef7ceda1.zip
bionic-1dc9e472e19acfe6dc7f41e429236e7eef7ceda1.tar.gz
bionic-1dc9e472e19acfe6dc7f41e429236e7eef7ceda1.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'libc/arch-x86')
-rw-r--r--libc/arch-x86/bionic/__get_sp.S35
-rwxr-xr-xlibc/arch-x86/bionic/__get_tls.c37
-rwxr-xr-xlibc/arch-x86/bionic/__set_tls.c95
-rw-r--r--libc/arch-x86/bionic/_exit_with_stack_teardown.S34
-rw-r--r--libc/arch-x86/bionic/_setjmp.S71
-rw-r--r--libc/arch-x86/bionic/atomics_x86.S140
-rw-r--r--libc/arch-x86/bionic/atomics_x86.c104
-rw-r--r--libc/arch-x86/bionic/clone.S50
-rw-r--r--libc/arch-x86/bionic/crtbegin_dynamic.S96
-rw-r--r--libc/arch-x86/bionic/crtbegin_so.S29
-rw-r--r--libc/arch-x86/bionic/crtbegin_static.S95
-rw-r--r--libc/arch-x86/bionic/crtend.S13
-rw-r--r--libc/arch-x86/bionic/crtend_so.S47
-rw-r--r--libc/arch-x86/bionic/dl_iterate_phdr_static.c74
-rw-r--r--libc/arch-x86/bionic/setjmp.S93
-rw-r--r--libc/arch-x86/bionic/vfork.S30
-rw-r--r--libc/arch-x86/include/endian.h70
-rw-r--r--libc/arch-x86/include/machine/_types.h123
-rw-r--r--libc/arch-x86/include/machine/asm.h124
-rw-r--r--libc/arch-x86/include/machine/cdefs.h24
-rw-r--r--libc/arch-x86/include/machine/exec.h51
-rw-r--r--libc/arch-x86/include/machine/ieee.h133
-rw-r--r--libc/arch-x86/include/machine/internal_types.h6
-rw-r--r--libc/arch-x86/include/machine/kernel.h41
-rw-r--r--libc/arch-x86/include/machine/limits.h63
-rw-r--r--libc/arch-x86/include/machine/setjmp.h8
-rw-r--r--libc/arch-x86/string/bcmp.S32
-rw-r--r--libc/arch-x86/string/bcopy.S93
-rw-r--r--libc/arch-x86/string/bzero.S43
-rw-r--r--libc/arch-x86/string/fss.S17
-rw-r--r--libc/arch-x86/string/index.S26
-rw-r--r--libc/arch-x86/string/memchr.S26
-rw-r--r--libc/arch-x86/string/memcmp.S43
-rw-r--r--libc/arch-x86/string/memcpy.S3
-rw-r--r--libc/arch-x86/string/memmove.S3
-rw-r--r--libc/arch-x86/string/memset.S55
-rw-r--r--libc/arch-x86/string/rindex.S29
-rw-r--r--libc/arch-x86/string/strcat.S73
-rw-r--r--libc/arch-x86/string/strchr.S3
-rw-r--r--libc/arch-x86/string/strcmp.S81
-rw-r--r--libc/arch-x86/string/strcpy.S63
-rw-r--r--libc/arch-x86/string/strlen.S20
-rw-r--r--libc/arch-x86/string/strncmp.S113
-rw-r--r--libc/arch-x86/string/strrchr.S3
-rw-r--r--libc/arch-x86/string/swab.S67
-rw-r--r--libc/arch-x86/syscalls.mk171
-rw-r--r--libc/arch-x86/syscalls/__brk.S23
-rw-r--r--libc/arch-x86/syscalls/__clone.S32
-rw-r--r--libc/arch-x86/syscalls/__fcntl.S29
-rw-r--r--libc/arch-x86/syscalls/__fcntl64.S29
-rw-r--r--libc/arch-x86/syscalls/__fork.S23
-rw-r--r--libc/arch-x86/syscalls/__getcwd.S26
-rw-r--r--libc/arch-x86/syscalls/__getpriority.S26
-rw-r--r--libc/arch-x86/syscalls/__ioctl.S29
-rw-r--r--libc/arch-x86/syscalls/__llseek.S35
-rw-r--r--libc/arch-x86/syscalls/__mmap2.S38
-rw-r--r--libc/arch-x86/syscalls/__open.S29
-rw-r--r--libc/arch-x86/syscalls/__openat.S32
-rw-r--r--libc/arch-x86/syscalls/__pread64.S35
-rw-r--r--libc/arch-x86/syscalls/__ptrace.S32
-rw-r--r--libc/arch-x86/syscalls/__pwrite64.S35
-rw-r--r--libc/arch-x86/syscalls/__reboot.S32
-rw-r--r--libc/arch-x86/syscalls/__rt_sigaction.S32
-rw-r--r--libc/arch-x86/syscalls/__rt_sigprocmask.S32
-rw-r--r--libc/arch-x86/syscalls/__rt_sigtimedwait.S32
-rw-r--r--libc/arch-x86/syscalls/__set_thread_area.S23
-rw-r--r--libc/arch-x86/syscalls/__sigsuspend.S29
-rw-r--r--libc/arch-x86/syscalls/__statfs64.S29
-rw-r--r--libc/arch-x86/syscalls/__syslog.S29
-rw-r--r--libc/arch-x86/syscalls/__timer_create.S29
-rw-r--r--libc/arch-x86/syscalls/__timer_delete.S23
-rw-r--r--libc/arch-x86/syscalls/__timer_getoverrun.S23
-rw-r--r--libc/arch-x86/syscalls/__timer_gettime.S26
-rw-r--r--libc/arch-x86/syscalls/__timer_settime.S32
-rw-r--r--libc/arch-x86/syscalls/__wait4.S32
-rw-r--r--libc/arch-x86/syscalls/_exit.S23
-rw-r--r--libc/arch-x86/syscalls/_exit_thread.S23
-rw-r--r--libc/arch-x86/syscalls/_waitpid.S32
-rw-r--r--libc/arch-x86/syscalls/accept.S27
-rw-r--r--libc/arch-x86/syscalls/access.S26
-rw-r--r--libc/arch-x86/syscalls/acct.S23
-rw-r--r--libc/arch-x86/syscalls/bind.S27
-rw-r--r--libc/arch-x86/syscalls/capget.S26
-rw-r--r--libc/arch-x86/syscalls/capset.S26
-rw-r--r--libc/arch-x86/syscalls/chdir.S23
-rw-r--r--libc/arch-x86/syscalls/chmod.S26
-rw-r--r--libc/arch-x86/syscalls/chown.S29
-rw-r--r--libc/arch-x86/syscalls/chroot.S23
-rw-r--r--libc/arch-x86/syscalls/clock_getres.S26
-rw-r--r--libc/arch-x86/syscalls/clock_gettime.S26
-rw-r--r--libc/arch-x86/syscalls/clock_nanosleep.S26
-rw-r--r--libc/arch-x86/syscalls/clock_settime.S26
-rw-r--r--libc/arch-x86/syscalls/close.S23
-rw-r--r--libc/arch-x86/syscalls/connect.S27
-rw-r--r--libc/arch-x86/syscalls/delete_module.S26
-rw-r--r--libc/arch-x86/syscalls/dup.S23
-rw-r--r--libc/arch-x86/syscalls/dup2.S26
-rw-r--r--libc/arch-x86/syscalls/epoll_create.S23
-rw-r--r--libc/arch-x86/syscalls/epoll_ctl.S32
-rw-r--r--libc/arch-x86/syscalls/epoll_wait.S32
-rw-r--r--libc/arch-x86/syscalls/execve.S29
-rw-r--r--libc/arch-x86/syscalls/fchdir.S23
-rw-r--r--libc/arch-x86/syscalls/fchmod.S26
-rw-r--r--libc/arch-x86/syscalls/fchmodat.S32
-rw-r--r--libc/arch-x86/syscalls/fchown.S29
-rw-r--r--libc/arch-x86/syscalls/fchownat.S35
-rw-r--r--libc/arch-x86/syscalls/flock.S26
-rw-r--r--libc/arch-x86/syscalls/fstat.S26
-rw-r--r--libc/arch-x86/syscalls/fstatat.S32
-rw-r--r--libc/arch-x86/syscalls/fstatfs.S29
-rw-r--r--libc/arch-x86/syscalls/fsync.S23
-rw-r--r--libc/arch-x86/syscalls/ftruncate.S26
-rw-r--r--libc/arch-x86/syscalls/futex.S38
-rw-r--r--libc/arch-x86/syscalls/getdents.S29
-rw-r--r--libc/arch-x86/syscalls/getegid.S20
-rw-r--r--libc/arch-x86/syscalls/geteuid.S20
-rw-r--r--libc/arch-x86/syscalls/getgid.S20
-rw-r--r--libc/arch-x86/syscalls/getgroups.S26
-rw-r--r--libc/arch-x86/syscalls/getitimer.S26
-rw-r--r--libc/arch-x86/syscalls/getpeername.S27
-rw-r--r--libc/arch-x86/syscalls/getpgid.S23
-rw-r--r--libc/arch-x86/syscalls/getpid.S20
-rw-r--r--libc/arch-x86/syscalls/getppid.S20
-rw-r--r--libc/arch-x86/syscalls/getresgid.S20
-rw-r--r--libc/arch-x86/syscalls/getresuid.S20
-rw-r--r--libc/arch-x86/syscalls/getrlimit.S26
-rw-r--r--libc/arch-x86/syscalls/getrusage.S26
-rw-r--r--libc/arch-x86/syscalls/getsockname.S27
-rw-r--r--libc/arch-x86/syscalls/getsockopt.S27
-rw-r--r--libc/arch-x86/syscalls/gettid.S20
-rw-r--r--libc/arch-x86/syscalls/gettimeofday.S26
-rw-r--r--libc/arch-x86/syscalls/getuid.S20
-rw-r--r--libc/arch-x86/syscalls/init_module.S29
-rw-r--r--libc/arch-x86/syscalls/inotify_add_watch.S29
-rw-r--r--libc/arch-x86/syscalls/inotify_init.S23
-rw-r--r--libc/arch-x86/syscalls/inotify_rm_watch.S26
-rw-r--r--libc/arch-x86/syscalls/kill.S26
-rw-r--r--libc/arch-x86/syscalls/klogctl.S29
-rw-r--r--libc/arch-x86/syscalls/lchown.S29
-rw-r--r--libc/arch-x86/syscalls/link.S26
-rw-r--r--libc/arch-x86/syscalls/listen.S27
-rw-r--r--libc/arch-x86/syscalls/lseek.S29
-rw-r--r--libc/arch-x86/syscalls/lstat.S26
-rw-r--r--libc/arch-x86/syscalls/madvise.S29
-rw-r--r--libc/arch-x86/syscalls/mincore.S29
-rw-r--r--libc/arch-x86/syscalls/mkdir.S26
-rw-r--r--libc/arch-x86/syscalls/mkdirat.S29
-rw-r--r--libc/arch-x86/syscalls/mknod.S29
-rw-r--r--libc/arch-x86/syscalls/mlock.S26
-rw-r--r--libc/arch-x86/syscalls/mount.S35
-rw-r--r--libc/arch-x86/syscalls/mprotect.S29
-rw-r--r--libc/arch-x86/syscalls/mremap.S32
-rw-r--r--libc/arch-x86/syscalls/msync.S29
-rw-r--r--libc/arch-x86/syscalls/munlock.S26
-rw-r--r--libc/arch-x86/syscalls/munmap.S26
-rw-r--r--libc/arch-x86/syscalls/nanosleep.S26
-rw-r--r--libc/arch-x86/syscalls/pause.S20
-rw-r--r--libc/arch-x86/syscalls/pipe.S23
-rw-r--r--libc/arch-x86/syscalls/poll.S29
-rw-r--r--libc/arch-x86/syscalls/prctl.S35
-rw-r--r--libc/arch-x86/syscalls/read.S29
-rw-r--r--libc/arch-x86/syscalls/readlink.S29
-rw-r--r--libc/arch-x86/syscalls/readv.S29
-rw-r--r--libc/arch-x86/syscalls/recvfrom.S27
-rw-r--r--libc/arch-x86/syscalls/recvmsg.S27
-rw-r--r--libc/arch-x86/syscalls/rename.S26
-rw-r--r--libc/arch-x86/syscalls/renameat.S32
-rw-r--r--libc/arch-x86/syscalls/rmdir.S23
-rw-r--r--libc/arch-x86/syscalls/sched_get_priority_max.S23
-rw-r--r--libc/arch-x86/syscalls/sched_get_priority_min.S23
-rw-r--r--libc/arch-x86/syscalls/sched_getparam.S26
-rw-r--r--libc/arch-x86/syscalls/sched_getscheduler.S23
-rw-r--r--libc/arch-x86/syscalls/sched_rr_get_interval.S26
-rw-r--r--libc/arch-x86/syscalls/sched_setparam.S26
-rw-r--r--libc/arch-x86/syscalls/sched_setscheduler.S29
-rw-r--r--libc/arch-x86/syscalls/sched_yield.S23
-rw-r--r--libc/arch-x86/syscalls/select.S35
-rw-r--r--libc/arch-x86/syscalls/sendfile.S32
-rw-r--r--libc/arch-x86/syscalls/sendmsg.S27
-rw-r--r--libc/arch-x86/syscalls/sendto.S27
-rw-r--r--libc/arch-x86/syscalls/setgid.S23
-rw-r--r--libc/arch-x86/syscalls/setgroups.S26
-rw-r--r--libc/arch-x86/syscalls/setitimer.S29
-rw-r--r--libc/arch-x86/syscalls/setpgid.S26
-rw-r--r--libc/arch-x86/syscalls/setpriority.S29
-rw-r--r--libc/arch-x86/syscalls/setregid.S26
-rw-r--r--libc/arch-x86/syscalls/setresgid.S29
-rw-r--r--libc/arch-x86/syscalls/setresuid.S29
-rw-r--r--libc/arch-x86/syscalls/setreuid.S26
-rw-r--r--libc/arch-x86/syscalls/setrlimit.S26
-rw-r--r--libc/arch-x86/syscalls/setsid.S20
-rw-r--r--libc/arch-x86/syscalls/setsockopt.S27
-rw-r--r--libc/arch-x86/syscalls/settimeofday.S26
-rw-r--r--libc/arch-x86/syscalls/setuid.S23
-rw-r--r--libc/arch-x86/syscalls/shutdown.S27
-rw-r--r--libc/arch-x86/syscalls/sigaction.S29
-rw-r--r--libc/arch-x86/syscalls/sigpending.S23
-rw-r--r--libc/arch-x86/syscalls/sigprocmask.S29
-rw-r--r--libc/arch-x86/syscalls/socket.S27
-rw-r--r--libc/arch-x86/syscalls/socketpair.S27
-rw-r--r--libc/arch-x86/syscalls/stat.S26
-rw-r--r--libc/arch-x86/syscalls/symlink.S26
-rw-r--r--libc/arch-x86/syscalls/sync.S23
-rw-r--r--libc/arch-x86/syscalls/times.S23
-rw-r--r--libc/arch-x86/syscalls/tkill.S26
-rw-r--r--libc/arch-x86/syscalls/truncate.S26
-rw-r--r--libc/arch-x86/syscalls/umask.S23
-rw-r--r--libc/arch-x86/syscalls/umount2.S26
-rw-r--r--libc/arch-x86/syscalls/uname.S23
-rw-r--r--libc/arch-x86/syscalls/unlink.S23
-rw-r--r--libc/arch-x86/syscalls/unlinkat.S29
-rw-r--r--libc/arch-x86/syscalls/utimes.S26
-rw-r--r--libc/arch-x86/syscalls/waitid.S35
-rw-r--r--libc/arch-x86/syscalls/write.S29
-rw-r--r--libc/arch-x86/syscalls/writev.S29
215 files changed, 7212 insertions, 0 deletions
diff --git a/libc/arch-x86/bionic/__get_sp.S b/libc/arch-x86/bionic/__get_sp.S
new file mode 100644
index 0000000..aeaaa66
--- /dev/null
+++ b/libc/arch-x86/bionic/__get_sp.S
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+ .text
+ .type __get_sp, @function
+ .global __get_sp
+ .align 4
+
+__get_sp:
+ mov %esp, %eax
+ ret
diff --git a/libc/arch-x86/bionic/__get_tls.c b/libc/arch-x86/bionic/__get_tls.c
new file mode 100755
index 0000000..5ac6e44
--- /dev/null
+++ b/libc/arch-x86/bionic/__get_tls.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/* see the implementation of __set_tls and pthread.c to understand this
+ * code. Basically, the content of gs:[0] always is a pointer to the base
+ * address of the tls region
+ */
+void* __get_tls(void)
+{
+ void* tls;
+ asm ( " movl %%gs:0, %0" : "=r"(tls) );
+ return tls;
+}
diff --git a/libc/arch-x86/bionic/__set_tls.c b/libc/arch-x86/bionic/__set_tls.c
new file mode 100755
index 0000000..48b55f0
--- /dev/null
+++ b/libc/arch-x86/bionic/__set_tls.c
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <pthread.h>
+
+
+struct user_desc {
+ unsigned int entry_number;
+ unsigned long base_addr;
+ unsigned int limit;
+ unsigned int seg_32bit:1;
+ unsigned int contents:2;
+ unsigned int read_exec_only:1;
+ unsigned int limit_in_pages:1;
+ unsigned int seg_not_present:1;
+ unsigned int useable:1;
+ unsigned int empty:25;
+};
+
+extern int __set_thread_area(struct user_desc *u_info);
+
+/* the following can't be const, since the first call will
+ * update the 'entry_number' field
+ */
+static struct user_desc _tls_desc =
+{
+ -1,
+ 0,
+ 0x1000,
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0
+};
+
+struct _thread_area_head {
+ void *self;
+};
+
+/* we implement thread local storage through the gs: segment descriptor
+ * we create a segment descriptor for the tls
+ */
+int __set_tls(void *ptr)
+{
+ int rc, segment;
+
+ _tls_desc.base_addr = (unsigned long)ptr;
+
+ /* We also need to write the location of the tls to ptr[0] */
+ ((struct _thread_area_head *)ptr)->self = ptr;
+
+ rc = __set_thread_area( &_tls_desc );
+ if (rc != 0)
+ {
+ /* could not set thread local area */
+ return -1;
+ }
+
+ /* this weird computation comes from GLibc */
+ segment = _tls_desc.entry_number*8 + 3;
+ asm __volatile__ (
+ " movw %w0, %%gs" :: "q"(segment)
+ );
+ return 0;
+}
+
+
+
diff --git a/libc/arch-x86/bionic/_exit_with_stack_teardown.S b/libc/arch-x86/bionic/_exit_with_stack_teardown.S
new file mode 100644
index 0000000..83a504d
--- /dev/null
+++ b/libc/arch-x86/bionic/_exit_with_stack_teardown.S
@@ -0,0 +1,34 @@
+#include <sys/linux-syscalls.h>
+
+.text
+.type _exit_with_stack_teardown, @function
+.globl _exit_with_stack_teardown
+.align 4
+
+/*
+ * void _exit_with_stack_teardown(void *stackBase, int stackSize, int *retCode)
+ */
+
+_exit_with_stack_teardown:
+ /* we can trash %ebx here since this call should never return. */
+ /* We can also take advantage of the fact that the linux syscall trap
+ * handler saves all the registers, so we don't need a stack to keep
+ * the retCode argument for exit while doing the munmap */
+
+ /* TODO(dmtriyz): No one expects this code to return, so even if
+ * munmap fails, we have to exit. This should probably be fixed, but
+ * since ARM side does the same thing, leave it as is.
+ */
+ mov 4(%esp), %ebx /* stackBase */
+ mov 8(%esp), %ecx /* stackSize */
+ mov 12(%esp), %edx /* retCode, not used for munmap */
+ mov $__NR_munmap, %eax
+ int $0x80
+ mov %edx, %ebx /* retrieve the retCode */
+ movl $__NR_exit, %eax
+ int $0x80
+ /* exit does not return */
+ /* can't have a ret here since we no longer have a usable stack. Seems
+ * that presently, 'hlt' will cause the program to segfault.. but this
+ * should never happen :) */
+ hlt
diff --git a/libc/arch-x86/bionic/_setjmp.S b/libc/arch-x86/bionic/_setjmp.S
new file mode 100644
index 0000000..ac62635
--- /dev/null
+++ b/libc/arch-x86/bionic/_setjmp.S
@@ -0,0 +1,71 @@
+/* $OpenBSD: _setjmp.S,v 1.5 2005/08/07 11:30:38 espie Exp $ */
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+
+/*
+ * C library -- _setjmp, _longjmp
+ *
+ * _longjmp(a,v)
+ * will generate a "return(v)" from the last call to
+ * _setjmp(a)
+ * by restoring registers from the stack.
+ * The previous signal state is NOT restored.
+ */
+
+ENTRY(_setjmp)
+ movl 4(%esp),%eax
+ movl 0(%esp),%edx
+ movl %edx, 0(%eax) /* rta */
+ movl %ebx, 4(%eax)
+ movl %esp, 8(%eax)
+ movl %ebp,12(%eax)
+ movl %esi,16(%eax)
+ movl %edi,20(%eax)
+ xorl %eax,%eax
+ ret
+
+ENTRY(_longjmp)
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ movl 0(%edx),%ecx
+ movl 4(%edx),%ebx
+ movl 8(%edx),%esp
+ movl 12(%edx),%ebp
+ movl 16(%edx),%esi
+ movl 20(%edx),%edi
+ testl %eax,%eax
+ jnz 1f
+ incl %eax
+1: movl %ecx,0(%esp)
+ ret
diff --git a/libc/arch-x86/bionic/atomics_x86.S b/libc/arch-x86/bionic/atomics_x86.S
new file mode 100644
index 0000000..2370f23
--- /dev/null
+++ b/libc/arch-x86/bionic/atomics_x86.S
@@ -0,0 +1,140 @@
+#include <sys/linux-syscalls.h>
+
+#define FUTEX_WAIT 0
+#define FUTEX_WAKE 1
+
+
+/*
+ * int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout)
+ */
+.text
+.globl __futex_wait
+.type __futex_wait, @function
+.align 4
+__futex_wait:
+ pushl %ebx
+ pushl %esi
+ mov 12(%esp), %ebx /* ftx */
+ movl $FUTEX_WAIT, %ecx
+ mov 16(%esp), %edx /* val */
+ mov 20(%esp), %esi /* timeout */
+ movl $__NR_futex, %eax
+ int $0x80
+ popl %esi
+ popl %ebx
+ ret
+
+
+/* int __futex_wake(volatile void *ftx, int count) */
+
+.text
+.globl __futex_wake
+.type __futex_wake, @function
+.align 4
+__futex_wake:
+ pushl %ebx
+ mov 8(%esp), %ebx /* ftx */
+ movl $FUTEX_WAKE, %ecx
+ mov 12(%esp), %edx /* count */
+ movl $__NR_futex, %eax
+ int $0x80
+ popl %ebx
+ ret
+
+
+/* int __atomic_cmpxchg(int old, int new, volatile int* addr) */
+
+.text
+.globl __atomic_cmpxchg
+.type __atomic_cmpxchg, @function
+.align 4
+__atomic_cmpxchg:
+ mov 4(%esp), %eax /* old */
+ mov 8(%esp), %ecx /* new */
+ mov 12(%esp), %edx /* addr */
+ lock cmpxchg %ecx, (%edx)
+ jnz 1f
+ xor %eax, %eax
+ jmp 2f
+1:
+ movl $1, %eax
+2:
+ ret /* 0 == success, 1 == failure */
+
+
+/* int __atomic_swap(int new, volatile int* addr) */
+
+.text
+.globl __atomic_swap
+.type __atomic_swap, @function
+.align 4
+__atomic_swap:
+ mov 4(%esp), %ecx /* new */
+ mov 8(%esp), %edx /* addr */
+ lock xchg %ecx, (%edx)
+ mov %ecx, %eax
+ ret
+
+
+/*
+ * int __atomic_dec(volatile int* addr)
+ *
+ * My x86 asm is really rusty.. this is probably suboptimal
+ */
+
+.text
+.globl __atomic_dec
+.type __atomic_dec, @function
+.align 4
+__atomic_dec:
+ pushl %ebx
+ pushl %esi
+ movl 12(%esp), %ebx /* addr */
+
+1:
+ movl (%ebx), %esi /* old = *addr */
+ movl %esi, %edx
+ subl $1, %edx /* new = old - 1 */
+
+ pushl %ebx
+ pushl %edx
+ pushl %esi
+ call __atomic_cmpxchg
+ addl $12, %esp
+ test %eax, %eax
+ jnz 1b
+
+ movl %esi, %eax /* return old */
+ popl %esi
+ popl %ebx
+ ret
+
+
+.text
+/* int __atomic_inc(volatile int* addr) */
+.globl __atomic_inc
+.type __atomic_inc, @function
+.align 4
+__atomic_inc:
+ pushl %ebx
+ pushl %esi
+ movl 12(%esp), %ebx /* addr */
+
+1:
+ movl (%ebx), %esi /* old = *addr */
+ movl %esi, %edx
+ addl $1, %edx /* new = old + 1 */
+
+ pushl %ebx
+ pushl %edx
+ pushl %esi
+ call __atomic_cmpxchg
+ addl $12, %esp
+ test %eax, %eax
+ jnz 1b
+
+ movl %esi, %eax /* return old */
+ popl %esi
+ popl %ebx
+ ret
+
diff --git a/libc/arch-x86/bionic/atomics_x86.c b/libc/arch-x86/bionic/atomics_x86.c
new file mode 100644
index 0000000..b7b20e6
--- /dev/null
+++ b/libc/arch-x86/bionic/atomics_x86.c
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <sys/atomics.h>
+
+#define FUTEX_SYSCALL 240
+#define FUTEX_WAIT 0
+#define FUTEX_WAKE 1
+
+int __futex_wait(volatile void *ftx, int val)
+{
+ int ret;
+ asm volatile (
+ "int $0x80;"
+ : "=a" (ret)
+ : "0" (FUTEX_SYSCALL),
+ "b" (ftx),
+ "c" (FUTEX_WAIT),
+ "d" (val),
+ "S" (0)
+ );
+ return ret;
+}
+
+int __futex_wake(volatile void *ftx, int count)
+{
+ int ret;
+ asm volatile (
+ "int $0x80;"
+ : "=a" (ret)
+ : "0" (FUTEX_SYSCALL),
+ "b" (ftx),
+ "c" (FUTEX_WAKE),
+ "d" (count)
+ );
+ return ret;
+}
+
+int __atomic_cmpxchg(int old, int new, volatile int* addr) {
+ int xchg;
+ asm volatile (
+ "lock;"
+ "cmpxchg %%ecx, (%%edx);"
+ "setne %%al;"
+ : "=a" (xchg)
+ : "a" (old),
+ "c" (new),
+ "d" (addr)
+ );
+ return xchg;
+}
+
+int __atomic_swap(int new, volatile int* addr) {
+ int old;
+ asm volatile (
+ "lock;"
+ "xchg %%ecx, (%%edx);"
+ : "=c" (old)
+ : "c" (new),
+ "d" (addr)
+ );
+ return old;
+}
+
+int __atomic_dec(volatile int* addr) {
+ int old;
+ do {
+ old = *addr;
+ } while (atomic_cmpxchg(old, old-1, addr));
+ return old;
+}
+
+int __atomic_inc(volatile int* addr) {
+ int old;
+ do {
+ old = *addr;
+ } while (atomic_cmpxchg(old, old+1, addr));
+ return old;
+}
+
diff --git a/libc/arch-x86/bionic/clone.S b/libc/arch-x86/bionic/clone.S
new file mode 100644
index 0000000..361808d
--- /dev/null
+++ b/libc/arch-x86/bionic/clone.S
@@ -0,0 +1,50 @@
+#include <sys/linux-syscalls.h>
+
+.text
+
+/*
+ * int __pthread_clone(int (*fn)(void*), void *tls, int flags,
+ * void *arg);
+ */
+.globl __pthread_clone
+.type __pthread_clone, @function
+.align 4
+__pthread_clone:
+ pushl %ebx
+ pushl %ecx
+ movl 16(%esp), %ecx
+ movl 20(%esp), %ebx
+
+ # insert arguments onto the child stack
+ movl 12(%esp), %eax
+ movl %eax, -12(%ecx)
+ movl 24(%esp), %eax
+ movl %eax, -8(%ecx)
+ lea (%ecx), %eax
+ movl %eax, -4(%ecx)
+
+ movl $__NR_clone, %eax
+ int $0x80
+ test %eax, %eax
+ jns 1f
+
+ # an error occured, set errno and return -1
+ negl %eax
+ call __set_errno
+ orl $-1, %eax
+ jmp 2f
+
+1:
+ jnz 2f
+
+ # we're in the child thread now, call __thread_entry
+ # with the appropriate arguments on the child stack
+ # we already placed most of them
+ subl $16, %esp
+ jmp __thread_entry
+ hlt
+
+2:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/bionic/crtbegin_dynamic.S b/libc/arch-x86/bionic/crtbegin_dynamic.S
new file mode 100644
index 0000000..3b47b18
--- /dev/null
+++ b/libc/arch-x86/bionic/crtbegin_dynamic.S
@@ -0,0 +1,96 @@
+# bionic/arch-x86/bionic/crtbegin_dynamic.S
+#
+# Copyright 2006, The Android Open Source Project
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. nor the names of its contributors may
+# be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY Google Inc. ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL Google Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ .text
+ .align 4
+ .type _start, @function
+ .globl _start
+
+# this is the small startup code that is first run when
+# any executable that is statically-linked with Bionic
+# runs.
+#
+# it's purpose is to call __libc_init with appropriate
+# arguments, which are:
+#
+# - the address of the raw data block setup by the Linux
+# kernel ELF loader
+#
+# - address of an "onexit" function, not used on any
+# platform supported by Bionic
+#
+# - address of the "main" function of the program. We
+# can't hard-code it in the adr pseudo instruction
+# so we use a tiny trampoline that will get relocated
+# by the dynamic linker before this code runs
+#
+# - address of the constructor list
+#
+_start:
+ mov %esp, %eax
+ mov $1f, %edx
+ pushl %edx
+ mov $0f, %edx
+ pushl %edx
+ mov $0, %edx
+ pushl %edx
+ pushl %eax
+ call __libc_init
+
+0:
+ jmp main
+
+1: .long __PREINIT_ARRAY__
+ .long __INIT_ARRAY__
+ .long __FINI_ARRAY__
+ .long __CTOR_LIST__
+
+# the .ctors section contains a list of pointers to "constructor"
+# functions that need to be called in order during C library initialization,
+# just before the program is being run. This is a C++ requirement
+#
+# the last entry shall be 0, and is defined in crtend.S
+#
+ .section .preinit_array, "aw"
+ .globl __PREINIT_ARRAY__
+__PREINIT_ARRAY__:
+ .long -1
+
+ .section .init_array, "aw"
+ .globl __INIT_ARRAY__
+__INIT_ARRAY__:
+ .long -1
+
+ .section .fini_array, "aw"
+ .globl __FINI_ARRAY__
+__FINI_ARRAY__:
+ .long -1
+
+ .section .ctors, "aw"
+ .globl __CTOR_LIST__
+__CTOR_LIST__:
+ .long -1
+
diff --git a/libc/arch-x86/bionic/crtbegin_so.S b/libc/arch-x86/bionic/crtbegin_so.S
new file mode 100644
index 0000000..d49e9df
--- /dev/null
+++ b/libc/arch-x86/bionic/crtbegin_so.S
@@ -0,0 +1,29 @@
+/* we put the _init() function here in case the user files for the shared
+ * libs want to drop things into .init section.
+ * We then will call our ctors from crtend_so.o */
+.section .init
+.align 4
+.type _init, @function
+.globl _init
+_init:
+
+.section .init_array, "aw"
+.align 4
+.type __INIT_ARRAY__, @object
+.globl __INIT_ARRAY__
+__INIT_ARRAY__:
+ .long -1
+
+.section .fini_array, "aw"
+.align 4
+.type __FINI_ARRAY__, @object
+.globl __FINI_ARRAY__
+__FINI_ARRAY__:
+ .long -1
+
+.section .ctors, "aw"
+.align 4
+.type __CTOR_LIST__, @object
+.globl __CTOR_LIST__
+__CTOR_LIST__:
+ .long -1
diff --git a/libc/arch-x86/bionic/crtbegin_static.S b/libc/arch-x86/bionic/crtbegin_static.S
new file mode 100644
index 0000000..eb4acee
--- /dev/null
+++ b/libc/arch-x86/bionic/crtbegin_static.S
@@ -0,0 +1,95 @@
+# bionic/arch-x86/bionic/crtbegin_static.S
+#
+# Copyright 2006, The Android Open Source Project
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. nor the names of its contributors may
+# be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY Google Inc. ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL Google Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ .text
+ .align 4
+ .type _start, @function
+ .globl _start
+
+# this is the small startup code that is first run when
+# any executable that is statically-linked with Bionic
+# runs.
+#
+# it's purpose is to call __libc_init with appropriate
+# arguments, which are:
+#
+# - the address of the raw data block setup by the Linux
+# kernel ELF loader
+#
+# - address of an "onexit" function, not used on any
+# platform supported by Bionic
+#
+# - address of the "main" function of the program. We
+# can't hard-code it in the adr pseudo instruction
+# so we use a tiny trampoline that will get relocated
+# by the dynamic linker before this code runs
+#
+# - address of the constructor list
+#
+_start:
+ mov %esp, %eax
+ mov $1f, %edx
+ pushl %edx
+ mov $0f, %edx
+ pushl %edx
+ mov $0, %edx
+ pushl %edx
+ pushl %eax
+ call __libc_init
+
+0: jmp main
+
+1: .long __PREINIT_ARRAY__
+ .long __INIT_ARRAY__
+ .long __FINI_ARRAY__
+ .long __CTOR_LIST__
+
+# the .ctors section contains a list of pointers to "constructor"
+# functions that need to be called in order during C library initialization,
+# just before the program is being run. This is a C++ requirement
+#
+# the last entry shall be 0, and is defined in crtend.S
+#
+ .section .preinit_array, "aw"
+ .globl __PREINIT_ARRAY__
+__PREINIT_ARRAY__:
+ .long -1
+
+ .section .init_array, "aw"
+ .globl __INIT_ARRAY__
+__INIT_ARRAY__:
+ .long -1
+
+ .section .fini_array, "aw"
+ .globl __FINI_ARRAY__
+__FINI_ARRAY__:
+ .long -1
+
+ .section .ctors, "aw"
+ .globl __CTOR_LIST__
+__CTOR_LIST__:
+ .long -1
+
diff --git a/libc/arch-x86/bionic/crtend.S b/libc/arch-x86/bionic/crtend.S
new file mode 100644
index 0000000..7f5fb66
--- /dev/null
+++ b/libc/arch-x86/bionic/crtend.S
@@ -0,0 +1,13 @@
+
+ .section .preinit_array, "aw"
+ .long 0
+
+ .section .init_array, "aw"
+ .long 0
+
+ .section .fini_array, "aw"
+ .long 0
+
+ .section .ctors, "aw"
+ .long 0
+
diff --git a/libc/arch-x86/bionic/crtend_so.S b/libc/arch-x86/bionic/crtend_so.S
new file mode 100644
index 0000000..7fb2280
--- /dev/null
+++ b/libc/arch-x86/bionic/crtend_so.S
@@ -0,0 +1,47 @@
+.text
+.align 4
+.type __bionic_call_ctors, @function
+
+/*
+ * The CTORS_LIST is marked by -1 (start) and 0 (end).
+ * We mark the end of the .ctors section with the __CTOR_END__ section so
+ * that we can just iterate backwards from it until we hit -1 and execute
+ * all the function pointers. This seems to be the way to do it for SVR4
+ * derived systems.
+ */
+__bionic_call_ctors:
+ pushl %esi
+ mov $__CTOR_END__, %esi
+
+0:
+ /* now grab the next function pointer and check if its -1. If not,
+ * call it, otherwise we're done. We use %esi since it's callee saved.
+ */
+ subl $4, %esi
+ mov (%esi), %eax
+ cmp $0xffffffff, %eax
+ je 1f
+ call *%eax
+ jmp 0b
+
+1:
+ /* we're done */
+ popl %esi
+ ret
+
+.section .init
+.align 4
+ call __bionic_call_ctors
+ ret
+
+.section .ctors, "aw", @progbits
+.align 4
+.type __CTOR_END__, @object
+__CTOR_END__:
+ .long 0
+
+.section .init_array, "aw"
+ .long 0
+
+.section .fini_array, "aw"
+ .long 0
diff --git a/libc/arch-x86/bionic/dl_iterate_phdr_static.c b/libc/arch-x86/bionic/dl_iterate_phdr_static.c
new file mode 100644
index 0000000..fd12106
--- /dev/null
+++ b/libc/arch-x86/bionic/dl_iterate_phdr_static.c
@@ -0,0 +1,74 @@
+/* bionic/arch-x86/bionic/dl_iterate_phdr_static.c
+**
+** Copyright 2006, The Android Open Source Project
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+** * Neither the name of Google Inc. nor the names of its contributors may
+** be used to endorse or promote products derived from this software
+** without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY Google Inc. ``AS IS'' AND ANY EXPRESS OR
+** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+** EVENT SHALL Google Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <sys/types.h>
+#include <linux/elf.h>
+
+/* TODO: Move this into a header that linker.h can also pull it in.
+ * Silly to have same struct in 2 places. This is temporary. */
+struct dl_phdr_info
+{
+ Elf32_Addr dlpi_addr;
+ const char *dlpi_name;
+ const Elf32_Phdr *dlpi_phdr;
+ Elf32_Half dlpi_phnum;
+};
+
+/* Dynamic binaries get this from the dynamic linker (system/linker), which
+ * we don't pull in for static bins. We also don't have a list of so's to
+ * iterate over, since there's really only a single monolithic blob of
+ * code/data.
+ *
+ * All we need to do is to find where the executable is in memory, and grab the
+ * phdr and phnum from there.
+ */
+
+/* ld provides this to us in the default link script */
+extern void *__executable_start;
+
+int
+dl_iterate_phdr(int (*cb)(struct dl_phdr_info *info, size_t size, void *data),
+ void *data)
+{
+ struct dl_phdr_info dl_info;
+ Elf32_Ehdr *ehdr = (Elf32_Ehdr *) &__executable_start;
+ Elf32_Phdr *phdr = (Elf32_Phdr *)((unsigned long)ehdr + ehdr->e_phoff);
+
+ /* TODO: again, copied from linker.c. Find a better home for this
+ * later. */
+ if (ehdr->e_ident[EI_MAG0] != ELFMAG0) return -1;
+ if (ehdr->e_ident[EI_MAG1] != ELFMAG1) return -1;
+ if (ehdr->e_ident[EI_MAG2] != ELFMAG2) return -1;
+ if (ehdr->e_ident[EI_MAG3] != ELFMAG3) return -1;
+
+ dl_info.dlpi_addr = 0;
+ dl_info.dlpi_name = NULL;
+ dl_info.dlpi_phdr = phdr;
+ dl_info.dlpi_phnum = ehdr->e_phnum;
+ return cb(&dl_info, sizeof (struct dl_phdr_info), data);
+}
+
diff --git a/libc/arch-x86/bionic/setjmp.S b/libc/arch-x86/bionic/setjmp.S
new file mode 100644
index 0000000..bcb5f9d
--- /dev/null
+++ b/libc/arch-x86/bionic/setjmp.S
@@ -0,0 +1,93 @@
+/* $OpenBSD: setjmp.S,v 1.8 2005/08/07 11:30:38 espie Exp $ */
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+
+/*
+ * C library -- setjmp, longjmp
+ *
+ * longjmp(a,v)
+ * will generate a "return(v)" from the last call to
+ * setjmp(a)
+ * by restoring registers from the stack.
+ * The previous signal state is restored.
+ */
+
+ENTRY(setjmp)
+ PIC_PROLOGUE
+ pushl $0
+#ifdef PIC
+ call PIC_PLT(_C_LABEL(sigblock))
+#else
+ call _C_LABEL(sigblock)
+#endif
+ addl $4,%esp
+ PIC_EPILOGUE
+
+ movl 4(%esp),%ecx
+ movl 0(%esp),%edx
+ movl %edx, 0(%ecx)
+ movl %ebx, 4(%ecx)
+ movl %esp, 8(%ecx)
+ movl %ebp,12(%ecx)
+ movl %esi,16(%ecx)
+ movl %edi,20(%ecx)
+ movl %eax,24(%ecx)
+ xorl %eax,%eax
+ ret
+
+ENTRY(longjmp)
+ movl 4(%esp),%edx
+ PIC_PROLOGUE
+ pushl 24(%edx)
+#ifdef PIC
+ call PIC_PLT(_C_LABEL(sigsetmask))
+#else
+ call _C_LABEL(sigsetmask)
+#endif
+ addl $4,%esp
+ PIC_EPILOGUE
+
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ movl 0(%edx),%ecx
+ movl 4(%edx),%ebx
+ movl 8(%edx),%esp
+ movl 12(%edx),%ebp
+ movl 16(%edx),%esi
+ movl 20(%edx),%edi
+ testl %eax,%eax
+ jnz 1f
+ incl %eax
+1: movl %ecx,0(%esp)
+ ret
diff --git a/libc/arch-x86/bionic/vfork.S b/libc/arch-x86/bionic/vfork.S
new file mode 100644
index 0000000..53910ab
--- /dev/null
+++ b/libc/arch-x86/bionic/vfork.S
@@ -0,0 +1,30 @@
+#include <sys/linux-syscalls.h>
+
+#ifndef __NR_vfork
+#define __NR_vfork 190
+#endif
+
+
+ .text
+ .type vfork, @function
+ .globl vfork
+ .align 4
+
+/* Get rid of the stack modifications (popl/ret) after vfork() success.
+ * vfork is VERY sneaky. One has to be very careful about what can be done
+ * between a successful vfork and a a subsequent execve()
+ */
+
+vfork:
+ /* grab the return address */
+ popl %ecx
+ movl $__NR_vfork, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ orl $-1, %eax
+1:
+ jmp *%ecx
diff --git a/libc/arch-x86/include/endian.h b/libc/arch-x86/include/endian.h
new file mode 100644
index 0000000..ad37919
--- /dev/null
+++ b/libc/arch-x86/include/endian.h
@@ -0,0 +1,70 @@
+/* $OpenBSD: endian.h,v 1.14 2005/12/13 00:35:23 millert Exp $ */
+
+/*-
+ * Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _I386_ENDIAN_H_
+#define _I386_ENDIAN_H_
+
+#ifdef __GNUC__
+
+#if defined(_KERNEL) && !defined(I386_CPU)
+#define __swap32md(x) ({ \
+ u_int32_t __swap32md_x = (x); \
+ \
+ __asm ("bswap %1" : "+r" (__swap32md_x)); \
+ __swap32md_x; \
+})
+#else
+#define __swap32md(x) ({ \
+ u_int32_t __swap32md_x = (x); \
+ \
+ __asm ("rorw $8, %w1; rorl $16, %1; rorw $8, %w1" : \
+ "+r" (__swap32md_x)); \
+ __swap32md_x; \
+})
+#endif /* _KERNEL && !I386_CPU */
+
+#define __swap64md(x) ({ \
+ u_int64_t __swap64md_x = (x); \
+ \
+ (u_int64_t)__swap32md(__swap64md_x >> 32) | \
+ (u_int64_t)__swap32md(__swap64md_x & 0xffffffff) << 32; \
+})
+#define __swap16md(x) ({ \
+ u_int16_t __swap16md_x = (x); \
+ \
+ __asm ("rorw $8, %w1" : "+r" (__swap16md_x)); \
+ __swap16md_x; \
+})
+
+/* Tell sys/endian.h we have MD variants of the swap macros. */
+#define MD_SWAP
+
+#endif /* __GNUC__ */
+
+#define _BYTE_ORDER _LITTLE_ENDIAN
+#include <sys/endian.h>
+
+#endif /* _I386_ENDIAN_H_ */
diff --git a/libc/arch-x86/include/machine/_types.h b/libc/arch-x86/include/machine/_types.h
new file mode 100644
index 0000000..3a31e22
--- /dev/null
+++ b/libc/arch-x86/include/machine/_types.h
@@ -0,0 +1,123 @@
+/* $OpenBSD: _types.h,v 1.2 2006/01/13 17:50:06 millert Exp $ */
+
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)types.h 8.3 (Berkeley) 1/5/94
+ * @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ */
+
+#ifndef _I386__TYPES_H_
+#define _I386__TYPES_H_
+
+/* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */
+#define _SIZE_T
+#define _PTRDIFF_T
+typedef unsigned int size_t;
+typedef int ptrdiff_t;
+
+#define _OFF_T_DEFINED_
+#define _SIZE_T_DEFINED_
+
+#include <linux/types.h>
+
+/* 7.18.1.1 Exact-width integer types */
+typedef __signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef short __int16_t;
+typedef unsigned short __uint16_t;
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+/* LONGLONG */
+typedef long long __int64_t;
+/* LONGLONG */
+typedef unsigned long long __uint64_t;
+
+/* 7.18.1.2 Minimum-width integer types */
+typedef __int8_t __int_least8_t;
+typedef __uint8_t __uint_least8_t;
+typedef __int16_t __int_least16_t;
+typedef __uint16_t __uint_least16_t;
+typedef __int32_t __int_least32_t;
+typedef __uint32_t __uint_least32_t;
+typedef __int64_t __int_least64_t;
+typedef __uint64_t __uint_least64_t;
+
+/* 7.18.1.3 Fastest minimum-width integer types */
+typedef __int32_t __int_fast8_t;
+typedef __uint32_t __uint_fast8_t;
+typedef __int32_t __int_fast16_t;
+typedef __uint32_t __uint_fast16_t;
+typedef __int32_t __int_fast32_t;
+typedef __uint32_t __uint_fast32_t;
+typedef __int64_t __int_fast64_t;
+typedef __uint64_t __uint_fast64_t;
+
+/* 7.18.1.4 Integer types capable of holding object pointers */
+typedef int __intptr_t;
+typedef unsigned int __uintptr_t;
+
+/* 7.18.1.5 Greatest-width integer types */
+typedef __int64_t __intmax_t;
+typedef __uint64_t __uintmax_t;
+
+/* Register size */
+typedef __int32_t __register_t;
+
+/* VM system types */
+typedef unsigned long __vaddr_t;
+typedef unsigned long __paddr_t;
+typedef unsigned long __vsize_t;
+typedef unsigned long __psize_t;
+
+/* Standard system types */
+typedef int __clock_t;
+typedef int __clockid_t;
+typedef long __ptrdiff_t;
+typedef int __time_t;
+typedef int __timer_t;
+#if defined(__GNUC__) && __GNUC__ >= 3
+typedef __builtin_va_list __va_list;
+#else
+typedef char * __va_list;
+#endif
+
+/* Wide character support types */
+#ifndef __cplusplus
+typedef int __wchar_t;
+#endif
+typedef int __wint_t;
+typedef int __rune_t;
+typedef void * __wctrans_t;
+typedef void * __wctype_t;
+
+/* Feature test macros */
+#define __HAVE_CPUINFO
+#define __HAVE_MUTEX
+
+#endif /* _I386__TYPES_H_ */
diff --git a/libc/arch-x86/include/machine/asm.h b/libc/arch-x86/include/machine/asm.h
new file mode 100644
index 0000000..7a23060
--- /dev/null
+++ b/libc/arch-x86/include/machine/asm.h
@@ -0,0 +1,124 @@
+/* $OpenBSD: asm.h,v 1.8 2004/06/13 21:49:16 niklas Exp $ */
+/* $NetBSD: asm.h,v 1.7 1994/10/27 04:15:56 cgd Exp $ */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)asm.h 5.5 (Berkeley) 5/7/91
+ */
+
+#ifndef _I386_ASM_H_
+#define _I386_ASM_H_
+
+/* This is borrowed from FreeBSD /src/sys/i386/include/asmacros.h v1.27 */
+/*
+ * CNAME and HIDENAME manage the relationship between symbol names in C
+ * and the equivalent assembly language names. CNAME is given a name as
+ * it would be used in a C program. It expands to the equivalent assembly
+ * language name. HIDENAME is given an assembly-language name, and expands
+ * to a possibly-modified form that will be invisible to C programs.
+ */
+#define CNAME(csym) csym
+#define HIDENAME(asmsym) .asmsym
+
+#ifdef PIC
+#define PIC_PROLOGUE \
+ pushl %ebx; \
+ call 666f; \
+666: \
+ popl %ebx; \
+ addl $_C_LABEL(_GLOBAL_OFFSET_TABLE_)+[.-666b], %ebx
+#define PIC_EPILOGUE \
+ popl %ebx
+#define PIC_PLT(x) x@PLT
+#define PIC_GOT(x) x@GOT(%ebx)
+#define PIC_GOTOFF(x) x@GOTOFF(%ebx)
+#else
+#define PIC_PROLOGUE
+#define PIC_EPILOGUE
+#define PIC_PLT(x) x
+#define PIC_GOT(x) x
+#define PIC_GOTOFF(x) x
+#endif
+
+#define _C_LABEL(name) name
+#define _ASM_LABEL(x) x
+
+#define CVAROFF(x, y) _C_LABEL(x) + y
+
+#ifdef __STDC__
+# define __CONCAT(x,y) x ## y
+# define __STRING(x) #x
+#else
+# define __CONCAT(x,y) x/**/y
+# define __STRING(x) "x"
+#endif
+
+/*
+ * WEAK ALIAS: create a weak alias
+ */
+#define WEAK_ALIAS(alias,sym) \
+ .weak alias; \
+ alias = sym
+
+/*
+ * WARN_REFERENCES: create a warning if the specified symbol is referenced
+ */
+#define WARN_REFERENCES(_sym,_msg) \
+ .section .gnu.warning. ## _sym ; .ascii _msg ; .text
+
+/* let kernels and others override entrypoint alignment */
+#ifndef _ALIGN_TEXT
+# define _ALIGN_TEXT .align 2, 0x90
+#endif
+
+#define _ENTRY(x) \
+ .text; _ALIGN_TEXT; .globl x; .type x,@function; x:
+
+#ifdef GPROF
+# define _PROF_PROLOGUE \
+ pushl %ebp; movl %esp,%ebp; call PIC_PLT(mcount); popl %ebp
+#else
+# define _PROF_PROLOGUE
+#endif
+
+#define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
+#define NENTRY(y) _ENTRY(_C_LABEL(y))
+#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
+
+#define ALTENTRY(name) .globl _C_LABEL(name); _C_LABEL(name):
+
+#define ASMSTR .asciz
+
+#define RCSID(x) .text; .asciz x
+#define __FBSDID(x) RCSID(x)
+
+#endif /* !_I386_ASM_H_ */
diff --git a/libc/arch-x86/include/machine/cdefs.h b/libc/arch-x86/include/machine/cdefs.h
new file mode 100644
index 0000000..6efee6a
--- /dev/null
+++ b/libc/arch-x86/include/machine/cdefs.h
@@ -0,0 +1,24 @@
+/* $OpenBSD: cdefs.h,v 1.9 2005/11/24 20:46:45 deraadt Exp $ */
+
+/*
+ * Written by J.T. Conklin <jtc@wimsey.com> 01/17/95.
+ * Public domain.
+ */
+
+#ifndef _MACHINE_CDEFS_H_
+#define _MACHINE_CDEFS_H_
+
+#if defined(lint)
+#define __indr_reference(sym,alias) __lint_equal__(sym,alias)
+#define __warn_references(sym,msg)
+#define __weak_alias(alias,sym) __lint_equal__(sym,alias)
+#elif defined(__GNUC__) && defined(__STDC__)
+#define __weak_alias(alias,sym) \
+ __asm__(".weak " __STRING(alias) " ; " \
+ __STRING(alias) " = " __STRING(sym));
+#define __warn_references(sym,msg) \
+ __asm__(".section .gnu.warning." __STRING(sym) \
+ " ; .ascii \"" msg "\" ; .text");
+#endif
+
+#endif /* !_MACHINE_CDEFS_H_ */
diff --git a/libc/arch-x86/include/machine/exec.h b/libc/arch-x86/include/machine/exec.h
new file mode 100644
index 0000000..d091741
--- /dev/null
+++ b/libc/arch-x86/include/machine/exec.h
@@ -0,0 +1,51 @@
+/* $OpenBSD: exec.h,v 1.9 2003/04/17 03:42:14 drahn Exp $ */
+/* $NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $ */
+
+/*
+ * Copyright (c) 1993 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _I386_EXEC_H_
+#define _I386_EXEC_H_
+
+#define __LDPGSZ 4096
+
+#define NATIVE_EXEC_ELF
+
+#define ARCH_ELFSIZE 32
+
+#define ELF_TARG_CLASS ELFCLASS32
+#define ELF_TARG_DATA ELFDATA2LSB
+#define ELF_TARG_MACH EM_386 /* XXX - EM_486 is currently unused
+ by all OSs/compilers/linkers */
+
+#define _NLIST_DO_AOUT
+#define _NLIST_DO_ELF
+
+#define _KERN_DO_AOUT
+#define _KERN_DO_ELF
+
+#endif /* _I386_EXEC_H_ */
diff --git a/libc/arch-x86/include/machine/ieee.h b/libc/arch-x86/include/machine/ieee.h
new file mode 100644
index 0000000..55b3703
--- /dev/null
+++ b/libc/arch-x86/include/machine/ieee.h
@@ -0,0 +1,133 @@
+/* $OpenBSD: ieee.h,v 1.2 2003/06/02 23:27:47 millert Exp $ */
+/* $NetBSD: ieee.h,v 1.1 1996/09/30 16:34:25 ws Exp $ */
+
+/*
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Lawrence Berkeley Laboratory.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ieee.h 8.1 (Berkeley) 6/11/93
+ */
+
+/*
+ * ieee.h defines the machine-dependent layout of the machine's IEEE
+ * floating point. It does *not* define (yet?) any of the rounding
+ * mode bits, exceptions, and so forth.
+ */
+
+/*
+ * Define the number of bits in each fraction and exponent.
+ *
+ * k k+1
+ * Note that 1.0 x 2 == 0.1 x 2 and that denorms are represented
+ *
+ * (-exp_bias+1)
+ * as fractions that look like 0.fffff x 2 . This means that
+ *
+ * -126
+ * the number 0.10000 x 2 , for instance, is the same as the normalized
+ *
+ * -127 -128
+ * float 1.0 x 2 . Thus, to represent 2 , we need one leading zero
+ *
+ * -129
+ * in the fraction; to represent 2 , we need two, and so on. This
+ *
+ * (-exp_bias-fracbits+1)
+ * implies that the smallest denormalized number is 2
+ *
+ * for whichever format we are talking about: for single precision, for
+ *
+ * -126 -149
+ * instance, we get .00000000000000000000001 x 2 , or 1.0 x 2 , and
+ *
+ * -149 == -127 - 23 + 1.
+ */
+#define SNG_EXPBITS 8
+#define SNG_FRACBITS 23
+
+#define DBL_EXPBITS 11
+#define DBL_FRACBITS 52
+
+#define EXT_EXPBITS 15
+#define EXT_FRACBITS 112
+
+struct ieee_single {
+ u_int sng_frac:23;
+ u_int sng_exp:8;
+ u_int sng_sign:1;
+};
+
+struct ieee_double {
+ u_int dbl_fracl;
+ u_int dbl_frach:20;
+ u_int dbl_exp:11;
+ u_int dbl_sign:1;
+};
+
+struct ieee_ext {
+ u_int ext_fracl;
+ u_int ext_fraclm;
+ u_int ext_frachm;
+ u_int ext_frach:16;
+ u_int ext_exp:15;
+ u_int ext_sign:1;
+};
+
+/*
+ * Floats whose exponent is in [1..INFNAN) (of whatever type) are
+ * `normal'. Floats whose exponent is INFNAN are either Inf or NaN.
+ * Floats whose exponent is zero are either zero (iff all fraction
+ * bits are zero) or subnormal values.
+ *
+ * A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its
+ * high fraction; if the bit is set, it is a `quiet NaN'.
+ */
+#define SNG_EXP_INFNAN 255
+#define DBL_EXP_INFNAN 2047
+#define EXT_EXP_INFNAN 32767
+
+#if 0
+#define SNG_QUIETNAN (1 << 22)
+#define DBL_QUIETNAN (1 << 19)
+#define EXT_QUIETNAN (1 << 15)
+#endif
+
+/*
+ * Exponent biases.
+ */
+#define SNG_EXP_BIAS 127
+#define DBL_EXP_BIAS 1023
+#define EXT_EXP_BIAS 16383
diff --git a/libc/arch-x86/include/machine/internal_types.h b/libc/arch-x86/include/machine/internal_types.h
new file mode 100644
index 0000000..4d1833c
--- /dev/null
+++ b/libc/arch-x86/include/machine/internal_types.h
@@ -0,0 +1,6 @@
+/* $OpenBSD: internal_types.h,v 1.1 2002/04/24 21:53:11 espie Exp $ */
+/* Public domain */
+#ifndef _MACHINE_INTERNAL_TYPES_H_
+#define _MACHINE_INTERNAL_TYPES_H_
+
+#endif
diff --git a/libc/arch-x86/include/machine/kernel.h b/libc/arch-x86/include/machine/kernel.h
new file mode 100644
index 0000000..19d1577
--- /dev/null
+++ b/libc/arch-x86/include/machine/kernel.h
@@ -0,0 +1,41 @@
+/* bionic/arch-arm/include/machine/kernel.h
+**
+** Copyright 2006-2008, The Android Open Source Project
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+** * Neither the name of Google Inc. nor the names of its contributors may
+** be used to endorse or promote products derived from this software
+** without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY Google Inc. ``AS IS'' AND ANY EXPRESS OR
+** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+** EVENT SHALL Google Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#ifndef _ARCH_X86_KERNEL_H
+#define _ARCH_X86_KERNEL_H
+
+/* this file contains kernel-specific definitions that were optimized out of
+ our processed kernel headers, but still useful nonetheless... */
+
+typedef unsigned long __kernel_blkcnt_t;
+typedef unsigned long __kernel_blksize_t;
+
+/* these aren't really defined by the kernel headers though... */
+typedef unsigned long __kernel_fsblkcnt_t;
+typedef unsigned long __kernel_fsfilcnt_t;
+typedef unsigned int __kernel_id_t;
+
+#endif /* _ARCH_X86_KERNEL_H */
diff --git a/libc/arch-x86/include/machine/limits.h b/libc/arch-x86/include/machine/limits.h
new file mode 100644
index 0000000..86fd854
--- /dev/null
+++ b/libc/arch-x86/include/machine/limits.h
@@ -0,0 +1,63 @@
+/* $OpenBSD: limits.h,v 1.11 2006/01/06 22:48:47 millert Exp $ */
+/* $NetBSD: limits.h,v 1.11 1995/12/21 01:08:59 mycroft Exp $ */
+
+/*
+ * Copyright (c) 1988 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)limits.h 7.2 (Berkeley) 6/28/90
+ */
+
+#ifndef _MACHINE_LIMITS_H_
+#define _MACHINE_LIMITS_H_
+
+#include <sys/cdefs.h>
+
+#define MB_LEN_MAX 1 /* no multibyte characters */
+
+#ifndef SIZE_MAX
+#define SIZE_MAX UINT_MAX /* max value for a size_t */
+#endif
+#ifndef SSIZE_MAX
+#define SSIZE_MAX INT_MAX /* max value for a ssize_t */
+#endif
+
+#if __BSD_VISIBLE
+#define SIZE_T_MAX UINT_MAX /* max value for a size_t (historic) */
+
+#define UQUAD_MAX 0xffffffffffffffffULL /* max unsigned quad */
+#define QUAD_MAX 0x7fffffffffffffffLL /* max signed quad */
+#define QUAD_MIN (-0x7fffffffffffffffLL-1) /* min signed quad */
+
+#endif /* __BSD_VISIBLE */
+
+#define LONGLONG_BIT 64
+#define LONGLONG_MIN (-9223372036854775807LL-1)
+#define LONGLONG_MAX 9223372036854775807LL
+#define ULONGLONG_MAX 18446744073709551615ULL
+
+#endif /* _MACHINE_LIMITS_H_ */
diff --git a/libc/arch-x86/include/machine/setjmp.h b/libc/arch-x86/include/machine/setjmp.h
new file mode 100644
index 0000000..ded095d
--- /dev/null
+++ b/libc/arch-x86/include/machine/setjmp.h
@@ -0,0 +1,8 @@
+/* $OpenBSD: setjmp.h,v 1.2 2000/08/05 22:07:32 niklas Exp $ */
+/* $NetBSD: setjmp.h,v 1.1 1994/12/20 10:36:43 cgd Exp $ */
+
+/*
+ * machine/setjmp.h: machine dependent setjmp-related information.
+ */
+
+#define _JBLEN 10 /* size, in longs, of a jmp_buf */
diff --git a/libc/arch-x86/string/bcmp.S b/libc/arch-x86/string/bcmp.S
new file mode 100644
index 0000000..a5b46ae
--- /dev/null
+++ b/libc/arch-x86/string/bcmp.S
@@ -0,0 +1,32 @@
+/* $OpenBSD: bcmp.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+ENTRY(bcmp)
+ pushl %edi
+ pushl %esi
+ movl 12(%esp),%edi
+ movl 16(%esp),%esi
+ xorl %eax,%eax /* clear return value */
+ cld /* set compare direction forward */
+
+ movl 20(%esp),%ecx /* compare by words */
+ shrl $2,%ecx
+ repe
+ cmpsl
+ jne L1
+
+ movl 20(%esp),%ecx /* compare remainder by bytes */
+ andl $3,%ecx
+ repe
+ cmpsb
+ je L2
+
+L1: incl %eax
+L2: popl %esi
+ popl %edi
+ ret
diff --git a/libc/arch-x86/string/bcopy.S b/libc/arch-x86/string/bcopy.S
new file mode 100644
index 0000000..dde5ae1
--- /dev/null
+++ b/libc/arch-x86/string/bcopy.S
@@ -0,0 +1,93 @@
+/* $OpenBSD: bcopy.S,v 1.5 2005/08/07 11:30:38 espie Exp $ */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from locore.s.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+
+ /*
+ * (ov)bcopy (src,dst,cnt)
+ * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
+ */
+
+#ifdef MEMCOPY
+ENTRY(memcpy)
+#else
+#ifdef MEMMOVE
+ENTRY(memmove)
+#else
+ENTRY(bcopy)
+#endif
+#endif
+ pushl %esi
+ pushl %edi
+#if defined(MEMCOPY) || defined(MEMMOVE)
+ movl 12(%esp),%edi
+ movl 16(%esp),%esi
+ movl %edi, %eax
+#else
+ movl 12(%esp),%esi
+ movl 16(%esp),%edi
+#endif
+ movl 20(%esp),%ecx
+ movl %ecx,%edx
+ cmpl %esi,%edi /* potentially overlapping? */
+ jnb 1f
+ cld /* nope, copy forwards. */
+ shrl $2,%ecx /* copy by words */
+ rep
+ movsl
+ movl %edx,%ecx
+ andl $3,%ecx /* any bytes left? */
+ rep
+ movsb
+ popl %edi
+ popl %esi
+ ret
+1:
+ addl %ecx,%edi /* copy backwards. */
+ addl %ecx,%esi
+ std
+ andl $3,%ecx /* any fractional bytes? */
+ decl %edi
+ decl %esi
+ rep
+ movsb
+ movl %edx,%ecx
+ shrl $2,%ecx
+ subl $3,%esi
+ subl $3,%edi
+ rep
+ movsl
+ popl %edi
+ popl %esi
+ cld
+ ret
diff --git a/libc/arch-x86/string/bzero.S b/libc/arch-x86/string/bzero.S
new file mode 100644
index 0000000..2ec9c7d
--- /dev/null
+++ b/libc/arch-x86/string/bzero.S
@@ -0,0 +1,43 @@
+/* $OpenBSD: bzero.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+ENTRY(bzero)
+ pushl %edi
+ movl 8(%esp),%edi
+ movl 12(%esp),%edx
+
+ cld /* set fill direction forward */
+ xorl %eax,%eax /* set fill data to 0 */
+
+ /*
+ * if the string is too short, it's really not worth the overhead
+ * of aligning to word boundries, etc. So we jump to a plain
+ * unaligned set.
+ */
+ cmpl $16,%edx
+ jb L1
+
+ movl %edi,%ecx /* compute misalignment */
+ negl %ecx
+ andl $3,%ecx
+ subl %ecx,%edx
+ rep /* zero until word aligned */
+ stosb
+
+ movl %edx,%ecx /* zero by words */
+ shrl $2,%ecx
+ andl $3,%edx
+ rep
+ stosl
+
+L1: movl %edx,%ecx /* zero remainder by bytes */
+ rep
+ stosb
+
+ popl %edi
+ ret
diff --git a/libc/arch-x86/string/fss.S b/libc/arch-x86/string/fss.S
new file mode 100644
index 0000000..96affab
--- /dev/null
+++ b/libc/arch-x86/string/fss.S
@@ -0,0 +1,17 @@
+/* $OpenBSD: ffs.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+ENTRY(ffs)
+ bsfl 4(%esp),%eax
+ jz L1 /* ZF is set if all bits are 0 */
+ incl %eax /* bits numbered from 1, not 0 */
+ ret
+
+ .align 2
+L1: xorl %eax,%eax /* clear result */
+ ret
diff --git a/libc/arch-x86/string/index.S b/libc/arch-x86/string/index.S
new file mode 100644
index 0000000..7f83ef5
--- /dev/null
+++ b/libc/arch-x86/string/index.S
@@ -0,0 +1,26 @@
+/* $OpenBSD: index.S,v 1.4 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+#ifdef STRCHR
+ENTRY(strchr)
+#else
+ENTRY(index)
+#endif
+ movl 4(%esp),%eax
+ movb 8(%esp),%cl
+ .align 2,0x90
+L1:
+ movb (%eax),%dl
+ cmpb %dl,%cl /* found char??? */
+ je L2
+ incl %eax
+ testb %dl,%dl /* null terminator??? */
+ jnz L1
+ xorl %eax,%eax
+L2:
+ ret
diff --git a/libc/arch-x86/string/memchr.S b/libc/arch-x86/string/memchr.S
new file mode 100644
index 0000000..d6bcbe6
--- /dev/null
+++ b/libc/arch-x86/string/memchr.S
@@ -0,0 +1,26 @@
+/* $OpenBSD: memchr.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+ENTRY(memchr)
+ pushl %edi
+ movl 8(%esp),%edi /* string address */
+ movl 12(%esp),%eax /* set character to search for */
+ movl 16(%esp),%ecx /* set length of search */
+ testl %ecx,%ecx /* test for len == 0 */
+ jz L1
+ cld /* set search forward */
+ repne /* search! */
+ scasb
+ jne L1 /* scan failed, return null */
+ leal -1(%edi),%eax /* adjust result of scan */
+ popl %edi
+ ret
+ .align 2,0x90
+L1: xorl %eax,%eax
+ popl %edi
+ ret
diff --git a/libc/arch-x86/string/memcmp.S b/libc/arch-x86/string/memcmp.S
new file mode 100644
index 0000000..1be189a
--- /dev/null
+++ b/libc/arch-x86/string/memcmp.S
@@ -0,0 +1,43 @@
+/* $OpenBSD: memcmp.S,v 1.4 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+ENTRY(memcmp)
+ pushl %edi
+ pushl %esi
+ movl 12(%esp),%edi
+ movl 16(%esp),%esi
+ cld /* set compare direction forward */
+
+ movl 20(%esp),%ecx /* compare by words */
+ shrl $2,%ecx
+ repe
+ cmpsl
+ jne L5 /* do we match so far? */
+
+ movl 20(%esp),%ecx /* compare remainder by bytes */
+ andl $3,%ecx
+ repe
+ cmpsb
+ jne L6 /* do we match? */
+
+ xorl %eax,%eax /* we match, return zero */
+ popl %esi
+ popl %edi
+ ret
+
+L5: movl $4,%ecx /* We know that one of the next */
+ subl %ecx,%edi /* four pairs of bytes do not */
+ subl %ecx,%esi /* match. */
+ repe
+ cmpsb
+L6: movzbl -1(%edi),%eax /* Perform unsigned comparison */
+ movzbl -1(%esi),%edx
+ subl %edx,%eax
+ popl %esi
+ popl %edi
+ ret
diff --git a/libc/arch-x86/string/memcpy.S b/libc/arch-x86/string/memcpy.S
new file mode 100644
index 0000000..95c8a83
--- /dev/null
+++ b/libc/arch-x86/string/memcpy.S
@@ -0,0 +1,3 @@
+/* $OpenBSD: memcpy.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+#define MEMCOPY
+#include "bcopy.S"
diff --git a/libc/arch-x86/string/memmove.S b/libc/arch-x86/string/memmove.S
new file mode 100644
index 0000000..c5bfd19
--- /dev/null
+++ b/libc/arch-x86/string/memmove.S
@@ -0,0 +1,3 @@
+/* $OpenBSD: memmove.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+#define MEMMOVE
+#include "bcopy.S"
diff --git a/libc/arch-x86/string/memset.S b/libc/arch-x86/string/memset.S
new file mode 100644
index 0000000..1059ccc
--- /dev/null
+++ b/libc/arch-x86/string/memset.S
@@ -0,0 +1,55 @@
+/* $OpenBSD: memset.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+ENTRY(memset)
+ pushl %edi
+ pushl %ebx
+ movl 12(%esp),%edi
+ movzbl 16(%esp),%eax /* unsigned char, zero extend */
+ movl 20(%esp),%ecx
+ pushl %edi /* push address of buffer */
+
+ cld /* set fill direction forward */
+
+ /*
+ * if the string is too short, it's really not worth the overhead
+ * of aligning to word boundries, etc. So we jump to a plain
+ * unaligned set.
+ */
+ cmpl $0x0f,%ecx
+ jle L1
+
+ movb %al,%ah /* copy char to all bytes in word */
+ movl %eax,%edx
+ sall $16,%eax
+ orl %edx,%eax
+
+ movl %edi,%edx /* compute misalignment */
+ negl %edx
+ andl $3,%edx
+ movl %ecx,%ebx
+ subl %edx,%ebx
+
+ movl %edx,%ecx /* set until word aligned */
+ rep
+ stosb
+
+ movl %ebx,%ecx
+ shrl $2,%ecx /* set by words */
+ rep
+ stosl
+
+ movl %ebx,%ecx /* set remainder by bytes */
+ andl $3,%ecx
+L1: rep
+ stosb
+
+ popl %eax /* pop address of buffer */
+ popl %ebx
+ popl %edi
+ ret
diff --git a/libc/arch-x86/string/rindex.S b/libc/arch-x86/string/rindex.S
new file mode 100644
index 0000000..0260d38
--- /dev/null
+++ b/libc/arch-x86/string/rindex.S
@@ -0,0 +1,29 @@
+/* $OpenBSD: rindex.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+#ifdef STRRCHR
+ENTRY(strrchr)
+#else
+ENTRY(rindex)
+#endif
+ pushl %ebx
+ movl 8(%esp),%edx
+ movb 12(%esp),%cl
+ xorl %eax,%eax /* init pointer to null */
+ .align 2,0x90
+L1:
+ movb (%edx),%bl
+ cmpb %bl,%cl
+ jne L2
+ movl %edx,%eax
+L2:
+ incl %edx
+ testb %bl,%bl /* null terminator??? */
+ jnz L1
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/string/strcat.S b/libc/arch-x86/string/strcat.S
new file mode 100644
index 0000000..60fdd55
--- /dev/null
+++ b/libc/arch-x86/string/strcat.S
@@ -0,0 +1,73 @@
+/* $OpenBSD: strcat.S,v 1.8 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+#if defined(APIWARN)
+#APP
+ .section .gnu.warning.strcat
+ .ascii "warning: strcat() is almost always misused, please use strlcat()"
+#NO_APP
+#endif
+
+/*
+ * NOTE: I've unrolled the loop eight times: large enough to make a
+ * significant difference, and small enough not to totally trash the
+ * cache.
+ */
+
+ENTRY(strcat)
+ pushl %edi /* save edi */
+ movl 8(%esp),%edi /* dst address */
+ movl 12(%esp),%edx /* src address */
+ pushl %edi /* push destination address */
+
+ cld /* set search forward */
+ xorl %eax,%eax /* set search for null terminator */
+ movl $-1,%ecx /* set search for lots of characters */
+ repne /* search! */
+ scasb
+
+ leal -1(%edi),%ecx /* correct dst address */
+
+ .align 2,0x90
+L1: movb (%edx),%al /* unroll loop, but not too much */
+ movb %al,(%ecx)
+ testb %al,%al
+ jz L2
+ movb 1(%edx),%al
+ movb %al,1(%ecx)
+ testb %al,%al
+ jz L2
+ movb 2(%edx),%al
+ movb %al,2(%ecx)
+ testb %al,%al
+ jz L2
+ movb 3(%edx),%al
+ movb %al,3(%ecx)
+ testb %al,%al
+ jz L2
+ movb 4(%edx),%al
+ movb %al,4(%ecx)
+ testb %al,%al
+ jz L2
+ movb 5(%edx),%al
+ movb %al,5(%ecx)
+ testb %al,%al
+ jz L2
+ movb 6(%edx),%al
+ movb %al,6(%ecx)
+ testb %al,%al
+ jz L2
+ movb 7(%edx),%al
+ movb %al,7(%ecx)
+ addl $8,%edx
+ addl $8,%ecx
+ testb %al,%al
+ jnz L1
+L2: popl %eax /* pop destination address */
+ popl %edi /* restore edi */
+ ret
diff --git a/libc/arch-x86/string/strchr.S b/libc/arch-x86/string/strchr.S
new file mode 100644
index 0000000..f76e593
--- /dev/null
+++ b/libc/arch-x86/string/strchr.S
@@ -0,0 +1,3 @@
+/* $OpenBSD: strchr.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+#define STRCHR
+#include "index.S"
diff --git a/libc/arch-x86/string/strcmp.S b/libc/arch-x86/string/strcmp.S
new file mode 100644
index 0000000..22ba546
--- /dev/null
+++ b/libc/arch-x86/string/strcmp.S
@@ -0,0 +1,81 @@
+/* $OpenBSD: strcmp.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+/*
+ * NOTE: I've unrolled the loop eight times: large enough to make a
+ * significant difference, and small enough not to totally trash the
+ * cache.
+ */
+
+ENTRY(strcmp)
+ movl 0x04(%esp),%eax
+ movl 0x08(%esp),%edx
+ jmp L2 /* Jump into the loop! */
+
+ .align 2,0x90
+L1: incl %eax
+ incl %edx
+L2: movb (%eax),%cl
+ testb %cl,%cl /* null terminator??? */
+ jz L3
+ cmpb %cl,(%edx) /* chars match??? */
+ jne L3
+ incl %eax
+ incl %edx
+ movb (%eax),%cl
+ testb %cl,%cl
+ jz L3
+ cmpb %cl,(%edx)
+ jne L3
+ incl %eax
+ incl %edx
+ movb (%eax),%cl
+ testb %cl,%cl
+ jz L3
+ cmpb %cl,(%edx)
+ jne L3
+ incl %eax
+ incl %edx
+ movb (%eax),%cl
+ testb %cl,%cl
+ jz L3
+ cmpb %cl,(%edx)
+ jne L3
+ incl %eax
+ incl %edx
+ movb (%eax),%cl
+ testb %cl,%cl
+ jz L3
+ cmpb %cl,(%edx)
+ jne L3
+ incl %eax
+ incl %edx
+ movb (%eax),%cl
+ testb %cl,%cl
+ jz L3
+ cmpb %cl,(%edx)
+ jne L3
+ incl %eax
+ incl %edx
+ movb (%eax),%cl
+ testb %cl,%cl
+ jz L3
+ cmpb %cl,(%edx)
+ jne L3
+ incl %eax
+ incl %edx
+ movb (%eax),%cl
+ testb %cl,%cl
+ jz L3
+ cmpb %cl,(%edx)
+ je L1
+ .align 2, 0x90
+L3: movzbl (%eax),%eax /* unsigned comparison */
+ movzbl (%edx),%edx
+ subl %edx,%eax
+ ret
diff --git a/libc/arch-x86/string/strcpy.S b/libc/arch-x86/string/strcpy.S
new file mode 100644
index 0000000..341eb6c
--- /dev/null
+++ b/libc/arch-x86/string/strcpy.S
@@ -0,0 +1,63 @@
+/* $OpenBSD: strcpy.S,v 1.8 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+#if defined(APIWARN)
+#APP
+ .section .gnu.warning.strcpy
+ .ascii "warning: strcpy() is almost always misused, please use strlcpy()"
+#NO_APP
+#endif
+
+/*
+ * NOTE: I've unrolled the loop eight times: large enough to make a
+ * significant difference, and small enough not to totally trash the
+ * cache.
+ */
+
+ENTRY(strcpy)
+ movl 4(%esp),%ecx /* dst address */
+ movl 8(%esp),%edx /* src address */
+ pushl %ecx /* push dst address */
+
+ .align 2,0x90
+L1: movb (%edx),%al /* unroll loop, but not too much */
+ movb %al,(%ecx)
+ testb %al,%al
+ jz L2
+ movb 1(%edx),%al
+ movb %al,1(%ecx)
+ testb %al,%al
+ jz L2
+ movb 2(%edx),%al
+ movb %al,2(%ecx)
+ testb %al,%al
+ jz L2
+ movb 3(%edx),%al
+ movb %al,3(%ecx)
+ testb %al,%al
+ jz L2
+ movb 4(%edx),%al
+ movb %al,4(%ecx)
+ testb %al,%al
+ jz L2
+ movb 5(%edx),%al
+ movb %al,5(%ecx)
+ testb %al,%al
+ jz L2
+ movb 6(%edx),%al
+ movb %al,6(%ecx)
+ testb %al,%al
+ jz L2
+ movb 7(%edx),%al
+ movb %al,7(%ecx)
+ addl $8,%edx
+ addl $8,%ecx
+ testb %al,%al
+ jnz L1
+L2: popl %eax /* pop dst address */
+ ret
diff --git a/libc/arch-x86/string/strlen.S b/libc/arch-x86/string/strlen.S
new file mode 100644
index 0000000..4f04ffc
--- /dev/null
+++ b/libc/arch-x86/string/strlen.S
@@ -0,0 +1,20 @@
+/* $OpenBSD: strlen.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+ENTRY(strlen)
+ pushl %edi
+ movl 8(%esp),%edi /* string address */
+ cld /* set search forward */
+ xorl %eax,%eax /* set search for null terminator */
+ movl $-1,%ecx /* set search for lots of characters */
+ repne /* search! */
+ scasb
+ notl %ecx /* get length by taking complement */
+ leal -1(%ecx),%eax /* and subtracting one */
+ popl %edi
+ ret
diff --git a/libc/arch-x86/string/strncmp.S b/libc/arch-x86/string/strncmp.S
new file mode 100644
index 0000000..5aa88d7
--- /dev/null
+++ b/libc/arch-x86/string/strncmp.S
@@ -0,0 +1,113 @@
+/* $OpenBSD: strncmp.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+/*
+ * NOTE: I've unrolled the loop eight times: large enough to make a
+ * significant difference, and small enough not to totally trash the
+ * cache.
+ */
+
+ENTRY(strncmp)
+ pushl %ebx
+ movl 8(%esp),%eax
+ movl 12(%esp),%ecx
+ movl 16(%esp),%edx
+ testl %edx,%edx
+ jmp L2 /* Jump into the loop! */
+
+ .align 2,0x90
+L1: incl %eax
+ incl %ecx
+ decl %edx
+L2: jz L4 /* strings are equal */
+ movb (%eax),%bl
+ testb %bl,%bl
+ jz L3
+ cmpb %bl,(%ecx)
+ jne L3
+
+ incl %eax
+ incl %ecx
+ decl %edx
+ jz L4
+ movb (%eax),%bl
+ testb %bl,%bl
+ jz L3
+ cmpb %bl,(%ecx)
+ jne L3
+
+ incl %eax
+ incl %ecx
+ decl %edx
+ jz L4
+ movb (%eax),%bl
+ testb %bl,%bl
+ jz L3
+ cmpb %bl,(%ecx)
+ jne L3
+
+ incl %eax
+ incl %ecx
+ decl %edx
+ jz L4
+ movb (%eax),%bl
+ testb %bl,%bl
+ jz L3
+ cmpb %bl,(%ecx)
+ jne L3
+
+ incl %eax
+ incl %ecx
+ decl %edx
+ jz L4
+ movb (%eax),%bl
+ testb %bl,%bl
+ jz L3
+ cmpb %bl,(%ecx)
+ jne L3
+
+ incl %eax
+ incl %ecx
+ decl %edx
+ jz L4
+ movb (%eax),%bl
+ testb %bl,%bl
+ jz L3
+ cmpb %bl,(%ecx)
+ jne L3
+
+ incl %eax
+ incl %ecx
+ decl %edx
+ jz L4
+ movb (%eax),%bl
+ testb %bl,%bl
+ jz L3
+ cmpb %bl,(%ecx)
+ jne L3
+
+ incl %eax
+ incl %ecx
+ decl %edx
+ jz L4
+ movb (%eax),%bl
+ testb %bl,%bl
+ jz L3
+ cmpb %bl,(%ecx)
+ je L1
+
+ .align 2,0x90
+L3: movzbl (%eax),%eax /* unsigned comparision */
+ movzbl (%ecx),%ecx
+ subl %ecx,%eax
+ popl %ebx
+ ret
+ .align 2,0x90
+L4: xorl %eax,%eax
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/string/strrchr.S b/libc/arch-x86/string/strrchr.S
new file mode 100644
index 0000000..4ee153f
--- /dev/null
+++ b/libc/arch-x86/string/strrchr.S
@@ -0,0 +1,3 @@
+/* $OpenBSD: strrchr.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+#define STRRCHR
+#include "rindex.S"
diff --git a/libc/arch-x86/string/swab.S b/libc/arch-x86/string/swab.S
new file mode 100644
index 0000000..3055860
--- /dev/null
+++ b/libc/arch-x86/string/swab.S
@@ -0,0 +1,67 @@
+/* $OpenBSD: swab.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+/*
+ * On the i486, this code is negligibly faster than the code generated
+ * by gcc at about half the size. If my i386 databook is correct, it
+ * should be considerably faster than the gcc code on a i386.
+ */
+
+ENTRY(swab)
+ pushl %esi
+ pushl %edi
+ movl 12(%esp),%esi
+ movl 16(%esp),%edi
+ movl 20(%esp),%ecx
+
+ cld # set direction forward
+
+ shrl $1,%ecx
+ testl $7,%ecx # copy first group of 1 to 7 words
+ jz L2 # while swaping alternate bytes.
+ .align 2,0x90
+L1: lodsw
+ rorw $8,%ax
+ stosw
+ decl %ecx
+ testl $7,%ecx
+ jnz L1
+
+L2: shrl $3,%ecx # copy remainder 8 words at a time
+ jz L4 # while swapping alternate bytes.
+ .align 2,0x90
+L3: lodsw
+ rorw $8,%ax
+ stosw
+ lodsw
+ rorw $8,%ax
+ stosw
+ lodsw
+ rorw $8,%ax
+ stosw
+ lodsw
+ rorw $8,%ax
+ stosw
+ lodsw
+ rorw $8,%ax
+ stosw
+ lodsw
+ rorw $8,%ax
+ stosw
+ lodsw
+ rorw $8,%ax
+ stosw
+ lodsw
+ rorw $8,%ax
+ stosw
+ decl %ecx
+ jnz L3
+
+L4: popl %edi
+ popl %esi
+ ret
diff --git a/libc/arch-x86/syscalls.mk b/libc/arch-x86/syscalls.mk
new file mode 100644
index 0000000..86d2308
--- /dev/null
+++ b/libc/arch-x86/syscalls.mk
@@ -0,0 +1,171 @@
+# auto-generated by gensyscalls.py, do not touch
+syscall_src :=
+syscall_src += arch-x86/syscalls/_exit.S
+syscall_src += arch-x86/syscalls/_exit_thread.S
+syscall_src += arch-x86/syscalls/__fork.S
+syscall_src += arch-x86/syscalls/_waitpid.S
+syscall_src += arch-x86/syscalls/waitid.S
+syscall_src += arch-x86/syscalls/__clone.S
+syscall_src += arch-x86/syscalls/execve.S
+syscall_src += arch-x86/syscalls/setuid.S
+syscall_src += arch-x86/syscalls/getuid.S
+syscall_src += arch-x86/syscalls/getgid.S
+syscall_src += arch-x86/syscalls/geteuid.S
+syscall_src += arch-x86/syscalls/getegid.S
+syscall_src += arch-x86/syscalls/getresuid.S
+syscall_src += arch-x86/syscalls/getresgid.S
+syscall_src += arch-x86/syscalls/gettid.S
+syscall_src += arch-x86/syscalls/getgroups.S
+syscall_src += arch-x86/syscalls/getpgid.S
+syscall_src += arch-x86/syscalls/getppid.S
+syscall_src += arch-x86/syscalls/setsid.S
+syscall_src += arch-x86/syscalls/setgid.S
+syscall_src += arch-x86/syscalls/setreuid.S
+syscall_src += arch-x86/syscalls/setresuid.S
+syscall_src += arch-x86/syscalls/setresgid.S
+syscall_src += arch-x86/syscalls/__brk.S
+syscall_src += arch-x86/syscalls/kill.S
+syscall_src += arch-x86/syscalls/tkill.S
+syscall_src += arch-x86/syscalls/__ptrace.S
+syscall_src += arch-x86/syscalls/__set_thread_area.S
+syscall_src += arch-x86/syscalls/__getpriority.S
+syscall_src += arch-x86/syscalls/setpriority.S
+syscall_src += arch-x86/syscalls/setrlimit.S
+syscall_src += arch-x86/syscalls/getrlimit.S
+syscall_src += arch-x86/syscalls/getrusage.S
+syscall_src += arch-x86/syscalls/setgroups.S
+syscall_src += arch-x86/syscalls/setpgid.S
+syscall_src += arch-x86/syscalls/setregid.S
+syscall_src += arch-x86/syscalls/chroot.S
+syscall_src += arch-x86/syscalls/prctl.S
+syscall_src += arch-x86/syscalls/capget.S
+syscall_src += arch-x86/syscalls/capset.S
+syscall_src += arch-x86/syscalls/acct.S
+syscall_src += arch-x86/syscalls/read.S
+syscall_src += arch-x86/syscalls/write.S
+syscall_src += arch-x86/syscalls/__pread64.S
+syscall_src += arch-x86/syscalls/__pwrite64.S
+syscall_src += arch-x86/syscalls/__open.S
+syscall_src += arch-x86/syscalls/__openat.S
+syscall_src += arch-x86/syscalls/close.S
+syscall_src += arch-x86/syscalls/lseek.S
+syscall_src += arch-x86/syscalls/__llseek.S
+syscall_src += arch-x86/syscalls/getpid.S
+syscall_src += arch-x86/syscalls/__mmap2.S
+syscall_src += arch-x86/syscalls/munmap.S
+syscall_src += arch-x86/syscalls/mremap.S
+syscall_src += arch-x86/syscalls/msync.S
+syscall_src += arch-x86/syscalls/mprotect.S
+syscall_src += arch-x86/syscalls/madvise.S
+syscall_src += arch-x86/syscalls/mlock.S
+syscall_src += arch-x86/syscalls/munlock.S
+syscall_src += arch-x86/syscalls/mincore.S
+syscall_src += arch-x86/syscalls/__ioctl.S
+syscall_src += arch-x86/syscalls/readv.S
+syscall_src += arch-x86/syscalls/writev.S
+syscall_src += arch-x86/syscalls/__fcntl.S
+syscall_src += arch-x86/syscalls/flock.S
+syscall_src += arch-x86/syscalls/fchmod.S
+syscall_src += arch-x86/syscalls/dup.S
+syscall_src += arch-x86/syscalls/pipe.S
+syscall_src += arch-x86/syscalls/dup2.S
+syscall_src += arch-x86/syscalls/select.S
+syscall_src += arch-x86/syscalls/ftruncate.S
+syscall_src += arch-x86/syscalls/getdents.S
+syscall_src += arch-x86/syscalls/fsync.S
+syscall_src += arch-x86/syscalls/fchown.S
+syscall_src += arch-x86/syscalls/sync.S
+syscall_src += arch-x86/syscalls/__fcntl64.S
+syscall_src += arch-x86/syscalls/fstatfs.S
+syscall_src += arch-x86/syscalls/sendfile.S
+syscall_src += arch-x86/syscalls/fstatat.S
+syscall_src += arch-x86/syscalls/mkdirat.S
+syscall_src += arch-x86/syscalls/fchownat.S
+syscall_src += arch-x86/syscalls/fchmodat.S
+syscall_src += arch-x86/syscalls/renameat.S
+syscall_src += arch-x86/syscalls/link.S
+syscall_src += arch-x86/syscalls/unlink.S
+syscall_src += arch-x86/syscalls/unlinkat.S
+syscall_src += arch-x86/syscalls/chdir.S
+syscall_src += arch-x86/syscalls/mknod.S
+syscall_src += arch-x86/syscalls/chmod.S
+syscall_src += arch-x86/syscalls/chown.S
+syscall_src += arch-x86/syscalls/lchown.S
+syscall_src += arch-x86/syscalls/mount.S
+syscall_src += arch-x86/syscalls/umount2.S
+syscall_src += arch-x86/syscalls/fstat.S
+syscall_src += arch-x86/syscalls/stat.S
+syscall_src += arch-x86/syscalls/lstat.S
+syscall_src += arch-x86/syscalls/mkdir.S
+syscall_src += arch-x86/syscalls/readlink.S
+syscall_src += arch-x86/syscalls/rmdir.S
+syscall_src += arch-x86/syscalls/rename.S
+syscall_src += arch-x86/syscalls/__getcwd.S
+syscall_src += arch-x86/syscalls/access.S
+syscall_src += arch-x86/syscalls/symlink.S
+syscall_src += arch-x86/syscalls/fchdir.S
+syscall_src += arch-x86/syscalls/truncate.S
+syscall_src += arch-x86/syscalls/__statfs64.S
+syscall_src += arch-x86/syscalls/pause.S
+syscall_src += arch-x86/syscalls/gettimeofday.S
+syscall_src += arch-x86/syscalls/settimeofday.S
+syscall_src += arch-x86/syscalls/times.S
+syscall_src += arch-x86/syscalls/nanosleep.S
+syscall_src += arch-x86/syscalls/clock_gettime.S
+syscall_src += arch-x86/syscalls/clock_settime.S
+syscall_src += arch-x86/syscalls/clock_getres.S
+syscall_src += arch-x86/syscalls/clock_nanosleep.S
+syscall_src += arch-x86/syscalls/getitimer.S
+syscall_src += arch-x86/syscalls/setitimer.S
+syscall_src += arch-x86/syscalls/__timer_create.S
+syscall_src += arch-x86/syscalls/__timer_settime.S
+syscall_src += arch-x86/syscalls/__timer_gettime.S
+syscall_src += arch-x86/syscalls/__timer_getoverrun.S
+syscall_src += arch-x86/syscalls/__timer_delete.S
+syscall_src += arch-x86/syscalls/utimes.S
+syscall_src += arch-x86/syscalls/sigaction.S
+syscall_src += arch-x86/syscalls/sigprocmask.S
+syscall_src += arch-x86/syscalls/__sigsuspend.S
+syscall_src += arch-x86/syscalls/__rt_sigaction.S
+syscall_src += arch-x86/syscalls/__rt_sigprocmask.S
+syscall_src += arch-x86/syscalls/__rt_sigtimedwait.S
+syscall_src += arch-x86/syscalls/sigpending.S
+syscall_src += arch-x86/syscalls/socket.S
+syscall_src += arch-x86/syscalls/bind.S
+syscall_src += arch-x86/syscalls/connect.S
+syscall_src += arch-x86/syscalls/listen.S
+syscall_src += arch-x86/syscalls/accept.S
+syscall_src += arch-x86/syscalls/getsockname.S
+syscall_src += arch-x86/syscalls/getpeername.S
+syscall_src += arch-x86/syscalls/socketpair.S
+syscall_src += arch-x86/syscalls/sendto.S
+syscall_src += arch-x86/syscalls/recvfrom.S
+syscall_src += arch-x86/syscalls/shutdown.S
+syscall_src += arch-x86/syscalls/setsockopt.S
+syscall_src += arch-x86/syscalls/getsockopt.S
+syscall_src += arch-x86/syscalls/sendmsg.S
+syscall_src += arch-x86/syscalls/recvmsg.S
+syscall_src += arch-x86/syscalls/sched_setscheduler.S
+syscall_src += arch-x86/syscalls/sched_getscheduler.S
+syscall_src += arch-x86/syscalls/sched_yield.S
+syscall_src += arch-x86/syscalls/sched_setparam.S
+syscall_src += arch-x86/syscalls/sched_getparam.S
+syscall_src += arch-x86/syscalls/sched_get_priority_max.S
+syscall_src += arch-x86/syscalls/sched_get_priority_min.S
+syscall_src += arch-x86/syscalls/sched_rr_get_interval.S
+syscall_src += arch-x86/syscalls/uname.S
+syscall_src += arch-x86/syscalls/__wait4.S
+syscall_src += arch-x86/syscalls/umask.S
+syscall_src += arch-x86/syscalls/__reboot.S
+syscall_src += arch-x86/syscalls/__syslog.S
+syscall_src += arch-x86/syscalls/init_module.S
+syscall_src += arch-x86/syscalls/delete_module.S
+syscall_src += arch-x86/syscalls/klogctl.S
+syscall_src += arch-x86/syscalls/futex.S
+syscall_src += arch-x86/syscalls/epoll_create.S
+syscall_src += arch-x86/syscalls/epoll_ctl.S
+syscall_src += arch-x86/syscalls/epoll_wait.S
+syscall_src += arch-x86/syscalls/inotify_init.S
+syscall_src += arch-x86/syscalls/inotify_add_watch.S
+syscall_src += arch-x86/syscalls/inotify_rm_watch.S
+syscall_src += arch-x86/syscalls/poll.S
diff --git a/libc/arch-x86/syscalls/__brk.S b/libc/arch-x86/syscalls/__brk.S
new file mode 100644
index 0000000..235cc4f
--- /dev/null
+++ b/libc/arch-x86/syscalls/__brk.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __brk, @function
+ .globl __brk
+ .align 4
+
+__brk:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_brk, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__clone.S b/libc/arch-x86/syscalls/__clone.S
new file mode 100644
index 0000000..5862129
--- /dev/null
+++ b/libc/arch-x86/syscalls/__clone.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __clone, @function
+ .globl __clone
+ .align 4
+
+__clone:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_clone, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__fcntl.S b/libc/arch-x86/syscalls/__fcntl.S
new file mode 100644
index 0000000..377f08e
--- /dev/null
+++ b/libc/arch-x86/syscalls/__fcntl.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __fcntl, @function
+ .globl __fcntl
+ .align 4
+
+__fcntl:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_fcntl, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__fcntl64.S b/libc/arch-x86/syscalls/__fcntl64.S
new file mode 100644
index 0000000..2ed47fe
--- /dev/null
+++ b/libc/arch-x86/syscalls/__fcntl64.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __fcntl64, @function
+ .globl __fcntl64
+ .align 4
+
+__fcntl64:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_fcntl64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__fork.S b/libc/arch-x86/syscalls/__fork.S
new file mode 100644
index 0000000..4b5d1c6
--- /dev/null
+++ b/libc/arch-x86/syscalls/__fork.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __fork, @function
+ .globl __fork
+ .align 4
+
+__fork:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_fork, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__getcwd.S b/libc/arch-x86/syscalls/__getcwd.S
new file mode 100644
index 0000000..f2bd520
--- /dev/null
+++ b/libc/arch-x86/syscalls/__getcwd.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __getcwd, @function
+ .globl __getcwd
+ .align 4
+
+__getcwd:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_getcwd, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__getpriority.S b/libc/arch-x86/syscalls/__getpriority.S
new file mode 100644
index 0000000..08503d8
--- /dev/null
+++ b/libc/arch-x86/syscalls/__getpriority.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __getpriority, @function
+ .globl __getpriority
+ .align 4
+
+__getpriority:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_getpriority, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__ioctl.S b/libc/arch-x86/syscalls/__ioctl.S
new file mode 100644
index 0000000..cdde9ab
--- /dev/null
+++ b/libc/arch-x86/syscalls/__ioctl.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __ioctl, @function
+ .globl __ioctl
+ .align 4
+
+__ioctl:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_ioctl, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__llseek.S b/libc/arch-x86/syscalls/__llseek.S
new file mode 100644
index 0000000..df49a94
--- /dev/null
+++ b/libc/arch-x86/syscalls/__llseek.S
@@ -0,0 +1,35 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __llseek, @function
+ .globl __llseek
+ .align 4
+
+__llseek:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ mov 24(%esp), %ebx
+ mov 28(%esp), %ecx
+ mov 32(%esp), %edx
+ mov 36(%esp), %esi
+ mov 40(%esp), %edi
+ movl $__NR__llseek, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__mmap2.S b/libc/arch-x86/syscalls/__mmap2.S
new file mode 100644
index 0000000..fea571f
--- /dev/null
+++ b/libc/arch-x86/syscalls/__mmap2.S
@@ -0,0 +1,38 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __mmap2, @function
+ .globl __mmap2
+ .align 4
+
+__mmap2:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ pushl %ebp
+ mov 28(%esp), %ebx
+ mov 32(%esp), %ecx
+ mov 36(%esp), %edx
+ mov 40(%esp), %esi
+ mov 44(%esp), %edi
+ mov 48(%esp), %ebp
+ movl $__NR_mmap2, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebp
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__open.S b/libc/arch-x86/syscalls/__open.S
new file mode 100644
index 0000000..df6fd93
--- /dev/null
+++ b/libc/arch-x86/syscalls/__open.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __open, @function
+ .globl __open
+ .align 4
+
+__open:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_open, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__openat.S b/libc/arch-x86/syscalls/__openat.S
new file mode 100644
index 0000000..aa14927
--- /dev/null
+++ b/libc/arch-x86/syscalls/__openat.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __openat, @function
+ .globl __openat
+ .align 4
+
+__openat:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_openat, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__pread64.S b/libc/arch-x86/syscalls/__pread64.S
new file mode 100644
index 0000000..3114673
--- /dev/null
+++ b/libc/arch-x86/syscalls/__pread64.S
@@ -0,0 +1,35 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __pread64, @function
+ .globl __pread64
+ .align 4
+
+__pread64:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ mov 24(%esp), %ebx
+ mov 28(%esp), %ecx
+ mov 32(%esp), %edx
+ mov 36(%esp), %esi
+ mov 40(%esp), %edi
+ movl $__NR_pread64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__ptrace.S b/libc/arch-x86/syscalls/__ptrace.S
new file mode 100644
index 0000000..bec952b
--- /dev/null
+++ b/libc/arch-x86/syscalls/__ptrace.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __ptrace, @function
+ .globl __ptrace
+ .align 4
+
+__ptrace:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_ptrace, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__pwrite64.S b/libc/arch-x86/syscalls/__pwrite64.S
new file mode 100644
index 0000000..28f6536
--- /dev/null
+++ b/libc/arch-x86/syscalls/__pwrite64.S
@@ -0,0 +1,35 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __pwrite64, @function
+ .globl __pwrite64
+ .align 4
+
+__pwrite64:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ mov 24(%esp), %ebx
+ mov 28(%esp), %ecx
+ mov 32(%esp), %edx
+ mov 36(%esp), %esi
+ mov 40(%esp), %edi
+ movl $__NR_pwrite64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__reboot.S b/libc/arch-x86/syscalls/__reboot.S
new file mode 100644
index 0000000..6cb74e2
--- /dev/null
+++ b/libc/arch-x86/syscalls/__reboot.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __reboot, @function
+ .globl __reboot
+ .align 4
+
+__reboot:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_reboot, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__rt_sigaction.S b/libc/arch-x86/syscalls/__rt_sigaction.S
new file mode 100644
index 0000000..c57f580
--- /dev/null
+++ b/libc/arch-x86/syscalls/__rt_sigaction.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __rt_sigaction, @function
+ .globl __rt_sigaction
+ .align 4
+
+__rt_sigaction:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_rt_sigaction, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__rt_sigprocmask.S b/libc/arch-x86/syscalls/__rt_sigprocmask.S
new file mode 100644
index 0000000..623331b
--- /dev/null
+++ b/libc/arch-x86/syscalls/__rt_sigprocmask.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __rt_sigprocmask, @function
+ .globl __rt_sigprocmask
+ .align 4
+
+__rt_sigprocmask:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_rt_sigprocmask, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__rt_sigtimedwait.S b/libc/arch-x86/syscalls/__rt_sigtimedwait.S
new file mode 100644
index 0000000..8e14a89
--- /dev/null
+++ b/libc/arch-x86/syscalls/__rt_sigtimedwait.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __rt_sigtimedwait, @function
+ .globl __rt_sigtimedwait
+ .align 4
+
+__rt_sigtimedwait:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_rt_sigtimedwait, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__set_thread_area.S b/libc/arch-x86/syscalls/__set_thread_area.S
new file mode 100644
index 0000000..cd22040
--- /dev/null
+++ b/libc/arch-x86/syscalls/__set_thread_area.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __set_thread_area, @function
+ .globl __set_thread_area
+ .align 4
+
+__set_thread_area:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_set_thread_area, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__sigsuspend.S b/libc/arch-x86/syscalls/__sigsuspend.S
new file mode 100644
index 0000000..64de756
--- /dev/null
+++ b/libc/arch-x86/syscalls/__sigsuspend.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __sigsuspend, @function
+ .globl __sigsuspend
+ .align 4
+
+__sigsuspend:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_sigsuspend, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__statfs64.S b/libc/arch-x86/syscalls/__statfs64.S
new file mode 100644
index 0000000..a0685b7
--- /dev/null
+++ b/libc/arch-x86/syscalls/__statfs64.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __statfs64, @function
+ .globl __statfs64
+ .align 4
+
+__statfs64:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_statfs64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__syslog.S b/libc/arch-x86/syscalls/__syslog.S
new file mode 100644
index 0000000..3982db4
--- /dev/null
+++ b/libc/arch-x86/syscalls/__syslog.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __syslog, @function
+ .globl __syslog
+ .align 4
+
+__syslog:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_syslog, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__timer_create.S b/libc/arch-x86/syscalls/__timer_create.S
new file mode 100644
index 0000000..66b0cea
--- /dev/null
+++ b/libc/arch-x86/syscalls/__timer_create.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __timer_create, @function
+ .globl __timer_create
+ .align 4
+
+__timer_create:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_timer_create, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__timer_delete.S b/libc/arch-x86/syscalls/__timer_delete.S
new file mode 100644
index 0000000..4344d08
--- /dev/null
+++ b/libc/arch-x86/syscalls/__timer_delete.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __timer_delete, @function
+ .globl __timer_delete
+ .align 4
+
+__timer_delete:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_timer_delete, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__timer_getoverrun.S b/libc/arch-x86/syscalls/__timer_getoverrun.S
new file mode 100644
index 0000000..4371415
--- /dev/null
+++ b/libc/arch-x86/syscalls/__timer_getoverrun.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __timer_getoverrun, @function
+ .globl __timer_getoverrun
+ .align 4
+
+__timer_getoverrun:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_timer_getoverrun, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__timer_gettime.S b/libc/arch-x86/syscalls/__timer_gettime.S
new file mode 100644
index 0000000..3923b0a
--- /dev/null
+++ b/libc/arch-x86/syscalls/__timer_gettime.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __timer_gettime, @function
+ .globl __timer_gettime
+ .align 4
+
+__timer_gettime:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_timer_gettime, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__timer_settime.S b/libc/arch-x86/syscalls/__timer_settime.S
new file mode 100644
index 0000000..cabb7df
--- /dev/null
+++ b/libc/arch-x86/syscalls/__timer_settime.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __timer_settime, @function
+ .globl __timer_settime
+ .align 4
+
+__timer_settime:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_timer_settime, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/__wait4.S b/libc/arch-x86/syscalls/__wait4.S
new file mode 100644
index 0000000..75ffb95
--- /dev/null
+++ b/libc/arch-x86/syscalls/__wait4.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type __wait4, @function
+ .globl __wait4
+ .align 4
+
+__wait4:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_wait4, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/_exit.S b/libc/arch-x86/syscalls/_exit.S
new file mode 100644
index 0000000..21aa49f
--- /dev/null
+++ b/libc/arch-x86/syscalls/_exit.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type _exit, @function
+ .globl _exit
+ .align 4
+
+_exit:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_exit_group, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/_exit_thread.S b/libc/arch-x86/syscalls/_exit_thread.S
new file mode 100644
index 0000000..16aaa5b
--- /dev/null
+++ b/libc/arch-x86/syscalls/_exit_thread.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type _exit_thread, @function
+ .globl _exit_thread
+ .align 4
+
+_exit_thread:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_exit, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/_waitpid.S b/libc/arch-x86/syscalls/_waitpid.S
new file mode 100644
index 0000000..7e76496
--- /dev/null
+++ b/libc/arch-x86/syscalls/_waitpid.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type _waitpid, @function
+ .globl _waitpid
+ .align 4
+
+_waitpid:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_waitpid, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/accept.S b/libc/arch-x86/syscalls/accept.S
new file mode 100644
index 0000000..ccd56e7
--- /dev/null
+++ b/libc/arch-x86/syscalls/accept.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type accept, @function
+ .globl accept
+ .align 4
+
+accept:
+ pushl %ebx
+ pushl %ecx
+ mov $5, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/access.S b/libc/arch-x86/syscalls/access.S
new file mode 100644
index 0000000..fff26a9
--- /dev/null
+++ b/libc/arch-x86/syscalls/access.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type access, @function
+ .globl access
+ .align 4
+
+access:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_access, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/acct.S b/libc/arch-x86/syscalls/acct.S
new file mode 100644
index 0000000..711b6fc
--- /dev/null
+++ b/libc/arch-x86/syscalls/acct.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type acct, @function
+ .globl acct
+ .align 4
+
+acct:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_acct, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/bind.S b/libc/arch-x86/syscalls/bind.S
new file mode 100644
index 0000000..2172cfb
--- /dev/null
+++ b/libc/arch-x86/syscalls/bind.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type bind, @function
+ .globl bind
+ .align 4
+
+bind:
+ pushl %ebx
+ pushl %ecx
+ mov $2, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/capget.S b/libc/arch-x86/syscalls/capget.S
new file mode 100644
index 0000000..e287cb2
--- /dev/null
+++ b/libc/arch-x86/syscalls/capget.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type capget, @function
+ .globl capget
+ .align 4
+
+capget:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_capget, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/capset.S b/libc/arch-x86/syscalls/capset.S
new file mode 100644
index 0000000..ce71f6e
--- /dev/null
+++ b/libc/arch-x86/syscalls/capset.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type capset, @function
+ .globl capset
+ .align 4
+
+capset:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_capset, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/chdir.S b/libc/arch-x86/syscalls/chdir.S
new file mode 100644
index 0000000..be88847
--- /dev/null
+++ b/libc/arch-x86/syscalls/chdir.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type chdir, @function
+ .globl chdir
+ .align 4
+
+chdir:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_chdir, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/chmod.S b/libc/arch-x86/syscalls/chmod.S
new file mode 100644
index 0000000..d023a7d
--- /dev/null
+++ b/libc/arch-x86/syscalls/chmod.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type chmod, @function
+ .globl chmod
+ .align 4
+
+chmod:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_chmod, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/chown.S b/libc/arch-x86/syscalls/chown.S
new file mode 100644
index 0000000..5646088
--- /dev/null
+++ b/libc/arch-x86/syscalls/chown.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type chown, @function
+ .globl chown
+ .align 4
+
+chown:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_chown32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/chroot.S b/libc/arch-x86/syscalls/chroot.S
new file mode 100644
index 0000000..461087c
--- /dev/null
+++ b/libc/arch-x86/syscalls/chroot.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type chroot, @function
+ .globl chroot
+ .align 4
+
+chroot:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_chroot, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/clock_getres.S b/libc/arch-x86/syscalls/clock_getres.S
new file mode 100644
index 0000000..07742ae
--- /dev/null
+++ b/libc/arch-x86/syscalls/clock_getres.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type clock_getres, @function
+ .globl clock_getres
+ .align 4
+
+clock_getres:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_clock_getres, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/clock_gettime.S b/libc/arch-x86/syscalls/clock_gettime.S
new file mode 100644
index 0000000..bfe14a4
--- /dev/null
+++ b/libc/arch-x86/syscalls/clock_gettime.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type clock_gettime, @function
+ .globl clock_gettime
+ .align 4
+
+clock_gettime:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_clock_gettime, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/clock_nanosleep.S b/libc/arch-x86/syscalls/clock_nanosleep.S
new file mode 100644
index 0000000..c400e3f
--- /dev/null
+++ b/libc/arch-x86/syscalls/clock_nanosleep.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type clock_nanosleep, @function
+ .globl clock_nanosleep
+ .align 4
+
+clock_nanosleep:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_clock_nanosleep, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/clock_settime.S b/libc/arch-x86/syscalls/clock_settime.S
new file mode 100644
index 0000000..58495ba
--- /dev/null
+++ b/libc/arch-x86/syscalls/clock_settime.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type clock_settime, @function
+ .globl clock_settime
+ .align 4
+
+clock_settime:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_clock_settime, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/close.S b/libc/arch-x86/syscalls/close.S
new file mode 100644
index 0000000..1944a83
--- /dev/null
+++ b/libc/arch-x86/syscalls/close.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type close, @function
+ .globl close
+ .align 4
+
+close:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_close, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/connect.S b/libc/arch-x86/syscalls/connect.S
new file mode 100644
index 0000000..8b8ce4e
--- /dev/null
+++ b/libc/arch-x86/syscalls/connect.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type connect, @function
+ .globl connect
+ .align 4
+
+connect:
+ pushl %ebx
+ pushl %ecx
+ mov $3, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/delete_module.S b/libc/arch-x86/syscalls/delete_module.S
new file mode 100644
index 0000000..6865d6a
--- /dev/null
+++ b/libc/arch-x86/syscalls/delete_module.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type delete_module, @function
+ .globl delete_module
+ .align 4
+
+delete_module:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_delete_module, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/dup.S b/libc/arch-x86/syscalls/dup.S
new file mode 100644
index 0000000..155de79
--- /dev/null
+++ b/libc/arch-x86/syscalls/dup.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type dup, @function
+ .globl dup
+ .align 4
+
+dup:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_dup, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/dup2.S b/libc/arch-x86/syscalls/dup2.S
new file mode 100644
index 0000000..59f8329
--- /dev/null
+++ b/libc/arch-x86/syscalls/dup2.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type dup2, @function
+ .globl dup2
+ .align 4
+
+dup2:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_dup2, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/epoll_create.S b/libc/arch-x86/syscalls/epoll_create.S
new file mode 100644
index 0000000..8106c58
--- /dev/null
+++ b/libc/arch-x86/syscalls/epoll_create.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type epoll_create, @function
+ .globl epoll_create
+ .align 4
+
+epoll_create:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_epoll_create, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/epoll_ctl.S b/libc/arch-x86/syscalls/epoll_ctl.S
new file mode 100644
index 0000000..ff2c112
--- /dev/null
+++ b/libc/arch-x86/syscalls/epoll_ctl.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type epoll_ctl, @function
+ .globl epoll_ctl
+ .align 4
+
+epoll_ctl:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_epoll_ctl, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/epoll_wait.S b/libc/arch-x86/syscalls/epoll_wait.S
new file mode 100644
index 0000000..3d81a14
--- /dev/null
+++ b/libc/arch-x86/syscalls/epoll_wait.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type epoll_wait, @function
+ .globl epoll_wait
+ .align 4
+
+epoll_wait:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_epoll_wait, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/execve.S b/libc/arch-x86/syscalls/execve.S
new file mode 100644
index 0000000..0ab1d75
--- /dev/null
+++ b/libc/arch-x86/syscalls/execve.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type execve, @function
+ .globl execve
+ .align 4
+
+execve:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_execve, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/fchdir.S b/libc/arch-x86/syscalls/fchdir.S
new file mode 100644
index 0000000..4e681be
--- /dev/null
+++ b/libc/arch-x86/syscalls/fchdir.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type fchdir, @function
+ .globl fchdir
+ .align 4
+
+fchdir:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_fchdir, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/fchmod.S b/libc/arch-x86/syscalls/fchmod.S
new file mode 100644
index 0000000..58f8a94
--- /dev/null
+++ b/libc/arch-x86/syscalls/fchmod.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type fchmod, @function
+ .globl fchmod
+ .align 4
+
+fchmod:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_fchmod, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/fchmodat.S b/libc/arch-x86/syscalls/fchmodat.S
new file mode 100644
index 0000000..b5b9c6d
--- /dev/null
+++ b/libc/arch-x86/syscalls/fchmodat.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type fchmodat, @function
+ .globl fchmodat
+ .align 4
+
+fchmodat:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_fchmodat, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/fchown.S b/libc/arch-x86/syscalls/fchown.S
new file mode 100644
index 0000000..c648d7f
--- /dev/null
+++ b/libc/arch-x86/syscalls/fchown.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type fchown, @function
+ .globl fchown
+ .align 4
+
+fchown:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_fchown32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/fchownat.S b/libc/arch-x86/syscalls/fchownat.S
new file mode 100644
index 0000000..3bec843
--- /dev/null
+++ b/libc/arch-x86/syscalls/fchownat.S
@@ -0,0 +1,35 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type fchownat, @function
+ .globl fchownat
+ .align 4
+
+fchownat:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ mov 24(%esp), %ebx
+ mov 28(%esp), %ecx
+ mov 32(%esp), %edx
+ mov 36(%esp), %esi
+ mov 40(%esp), %edi
+ movl $__NR_fchownat, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/flock.S b/libc/arch-x86/syscalls/flock.S
new file mode 100644
index 0000000..1ca09a5
--- /dev/null
+++ b/libc/arch-x86/syscalls/flock.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type flock, @function
+ .globl flock
+ .align 4
+
+flock:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_flock, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/fstat.S b/libc/arch-x86/syscalls/fstat.S
new file mode 100644
index 0000000..8f58316
--- /dev/null
+++ b/libc/arch-x86/syscalls/fstat.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type fstat, @function
+ .globl fstat
+ .align 4
+
+fstat:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_fstat64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/fstatat.S b/libc/arch-x86/syscalls/fstatat.S
new file mode 100644
index 0000000..4926e99
--- /dev/null
+++ b/libc/arch-x86/syscalls/fstatat.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type fstatat, @function
+ .globl fstatat
+ .align 4
+
+fstatat:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_fstatat64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/fstatfs.S b/libc/arch-x86/syscalls/fstatfs.S
new file mode 100644
index 0000000..f72b3d4
--- /dev/null
+++ b/libc/arch-x86/syscalls/fstatfs.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type fstatfs, @function
+ .globl fstatfs
+ .align 4
+
+fstatfs:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_fstatfs64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/fsync.S b/libc/arch-x86/syscalls/fsync.S
new file mode 100644
index 0000000..d9fd225
--- /dev/null
+++ b/libc/arch-x86/syscalls/fsync.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type fsync, @function
+ .globl fsync
+ .align 4
+
+fsync:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_fsync, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/ftruncate.S b/libc/arch-x86/syscalls/ftruncate.S
new file mode 100644
index 0000000..25b7df5
--- /dev/null
+++ b/libc/arch-x86/syscalls/ftruncate.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type ftruncate, @function
+ .globl ftruncate
+ .align 4
+
+ftruncate:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_ftruncate, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/futex.S b/libc/arch-x86/syscalls/futex.S
new file mode 100644
index 0000000..ac51316
--- /dev/null
+++ b/libc/arch-x86/syscalls/futex.S
@@ -0,0 +1,38 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type futex, @function
+ .globl futex
+ .align 4
+
+futex:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ pushl %ebp
+ mov 28(%esp), %ebx
+ mov 32(%esp), %ecx
+ mov 36(%esp), %edx
+ mov 40(%esp), %esi
+ mov 44(%esp), %edi
+ mov 48(%esp), %ebp
+ movl $__NR_futex, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebp
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getdents.S b/libc/arch-x86/syscalls/getdents.S
new file mode 100644
index 0000000..b8c527f
--- /dev/null
+++ b/libc/arch-x86/syscalls/getdents.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getdents, @function
+ .globl getdents
+ .align 4
+
+getdents:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_getdents64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getegid.S b/libc/arch-x86/syscalls/getegid.S
new file mode 100644
index 0000000..e34a147
--- /dev/null
+++ b/libc/arch-x86/syscalls/getegid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getegid, @function
+ .globl getegid
+ .align 4
+
+getegid:
+ movl $__NR_getegid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/geteuid.S b/libc/arch-x86/syscalls/geteuid.S
new file mode 100644
index 0000000..8ec7297
--- /dev/null
+++ b/libc/arch-x86/syscalls/geteuid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type geteuid, @function
+ .globl geteuid
+ .align 4
+
+geteuid:
+ movl $__NR_geteuid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/getgid.S b/libc/arch-x86/syscalls/getgid.S
new file mode 100644
index 0000000..d69d722
--- /dev/null
+++ b/libc/arch-x86/syscalls/getgid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getgid, @function
+ .globl getgid
+ .align 4
+
+getgid:
+ movl $__NR_getgid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/getgroups.S b/libc/arch-x86/syscalls/getgroups.S
new file mode 100644
index 0000000..f6a9912
--- /dev/null
+++ b/libc/arch-x86/syscalls/getgroups.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getgroups, @function
+ .globl getgroups
+ .align 4
+
+getgroups:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_getgroups32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getitimer.S b/libc/arch-x86/syscalls/getitimer.S
new file mode 100644
index 0000000..f170ebf
--- /dev/null
+++ b/libc/arch-x86/syscalls/getitimer.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getitimer, @function
+ .globl getitimer
+ .align 4
+
+getitimer:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_getitimer, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getpeername.S b/libc/arch-x86/syscalls/getpeername.S
new file mode 100644
index 0000000..b6f8eb8
--- /dev/null
+++ b/libc/arch-x86/syscalls/getpeername.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getpeername, @function
+ .globl getpeername
+ .align 4
+
+getpeername:
+ pushl %ebx
+ pushl %ecx
+ mov $7, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getpgid.S b/libc/arch-x86/syscalls/getpgid.S
new file mode 100644
index 0000000..ca1e659
--- /dev/null
+++ b/libc/arch-x86/syscalls/getpgid.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getpgid, @function
+ .globl getpgid
+ .align 4
+
+getpgid:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_getpgid, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getpid.S b/libc/arch-x86/syscalls/getpid.S
new file mode 100644
index 0000000..df43b88
--- /dev/null
+++ b/libc/arch-x86/syscalls/getpid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getpid, @function
+ .globl getpid
+ .align 4
+
+getpid:
+ movl $__NR_getpid, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/getppid.S b/libc/arch-x86/syscalls/getppid.S
new file mode 100644
index 0000000..9a882bd
--- /dev/null
+++ b/libc/arch-x86/syscalls/getppid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getppid, @function
+ .globl getppid
+ .align 4
+
+getppid:
+ movl $__NR_getppid, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/getresgid.S b/libc/arch-x86/syscalls/getresgid.S
new file mode 100644
index 0000000..454d32b
--- /dev/null
+++ b/libc/arch-x86/syscalls/getresgid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getresgid, @function
+ .globl getresgid
+ .align 4
+
+getresgid:
+ movl $__NR_getresgid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/getresuid.S b/libc/arch-x86/syscalls/getresuid.S
new file mode 100644
index 0000000..f07b5c5
--- /dev/null
+++ b/libc/arch-x86/syscalls/getresuid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getresuid, @function
+ .globl getresuid
+ .align 4
+
+getresuid:
+ movl $__NR_getresuid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/getrlimit.S b/libc/arch-x86/syscalls/getrlimit.S
new file mode 100644
index 0000000..f4c334f
--- /dev/null
+++ b/libc/arch-x86/syscalls/getrlimit.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getrlimit, @function
+ .globl getrlimit
+ .align 4
+
+getrlimit:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_ugetrlimit, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getrusage.S b/libc/arch-x86/syscalls/getrusage.S
new file mode 100644
index 0000000..750ab5b
--- /dev/null
+++ b/libc/arch-x86/syscalls/getrusage.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getrusage, @function
+ .globl getrusage
+ .align 4
+
+getrusage:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_getrusage, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getsockname.S b/libc/arch-x86/syscalls/getsockname.S
new file mode 100644
index 0000000..884acd9
--- /dev/null
+++ b/libc/arch-x86/syscalls/getsockname.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getsockname, @function
+ .globl getsockname
+ .align 4
+
+getsockname:
+ pushl %ebx
+ pushl %ecx
+ mov $6, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getsockopt.S b/libc/arch-x86/syscalls/getsockopt.S
new file mode 100644
index 0000000..a606532
--- /dev/null
+++ b/libc/arch-x86/syscalls/getsockopt.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getsockopt, @function
+ .globl getsockopt
+ .align 4
+
+getsockopt:
+ pushl %ebx
+ pushl %ecx
+ mov $15, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/gettid.S b/libc/arch-x86/syscalls/gettid.S
new file mode 100644
index 0000000..2e8cb59
--- /dev/null
+++ b/libc/arch-x86/syscalls/gettid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type gettid, @function
+ .globl gettid
+ .align 4
+
+gettid:
+ movl $__NR_gettid, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/gettimeofday.S b/libc/arch-x86/syscalls/gettimeofday.S
new file mode 100644
index 0000000..feffe92
--- /dev/null
+++ b/libc/arch-x86/syscalls/gettimeofday.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type gettimeofday, @function
+ .globl gettimeofday
+ .align 4
+
+gettimeofday:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_gettimeofday, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/getuid.S b/libc/arch-x86/syscalls/getuid.S
new file mode 100644
index 0000000..635105e
--- /dev/null
+++ b/libc/arch-x86/syscalls/getuid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type getuid, @function
+ .globl getuid
+ .align 4
+
+getuid:
+ movl $__NR_getuid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/init_module.S b/libc/arch-x86/syscalls/init_module.S
new file mode 100644
index 0000000..2e2b088
--- /dev/null
+++ b/libc/arch-x86/syscalls/init_module.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type init_module, @function
+ .globl init_module
+ .align 4
+
+init_module:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_init_module, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/inotify_add_watch.S b/libc/arch-x86/syscalls/inotify_add_watch.S
new file mode 100644
index 0000000..12a12e4
--- /dev/null
+++ b/libc/arch-x86/syscalls/inotify_add_watch.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type inotify_add_watch, @function
+ .globl inotify_add_watch
+ .align 4
+
+inotify_add_watch:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_inotify_add_watch, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/inotify_init.S b/libc/arch-x86/syscalls/inotify_init.S
new file mode 100644
index 0000000..2d186c4
--- /dev/null
+++ b/libc/arch-x86/syscalls/inotify_init.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type inotify_init, @function
+ .globl inotify_init
+ .align 4
+
+inotify_init:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_inotify_init, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/inotify_rm_watch.S b/libc/arch-x86/syscalls/inotify_rm_watch.S
new file mode 100644
index 0000000..f931833
--- /dev/null
+++ b/libc/arch-x86/syscalls/inotify_rm_watch.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type inotify_rm_watch, @function
+ .globl inotify_rm_watch
+ .align 4
+
+inotify_rm_watch:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_inotify_rm_watch, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/kill.S b/libc/arch-x86/syscalls/kill.S
new file mode 100644
index 0000000..e495c54
--- /dev/null
+++ b/libc/arch-x86/syscalls/kill.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type kill, @function
+ .globl kill
+ .align 4
+
+kill:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_kill, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/klogctl.S b/libc/arch-x86/syscalls/klogctl.S
new file mode 100644
index 0000000..e46c8ae
--- /dev/null
+++ b/libc/arch-x86/syscalls/klogctl.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type klogctl, @function
+ .globl klogctl
+ .align 4
+
+klogctl:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_syslog, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/lchown.S b/libc/arch-x86/syscalls/lchown.S
new file mode 100644
index 0000000..f584a32
--- /dev/null
+++ b/libc/arch-x86/syscalls/lchown.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type lchown, @function
+ .globl lchown
+ .align 4
+
+lchown:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_lchown32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/link.S b/libc/arch-x86/syscalls/link.S
new file mode 100644
index 0000000..3946dbf
--- /dev/null
+++ b/libc/arch-x86/syscalls/link.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type link, @function
+ .globl link
+ .align 4
+
+link:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_link, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/listen.S b/libc/arch-x86/syscalls/listen.S
new file mode 100644
index 0000000..de310cf
--- /dev/null
+++ b/libc/arch-x86/syscalls/listen.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type listen, @function
+ .globl listen
+ .align 4
+
+listen:
+ pushl %ebx
+ pushl %ecx
+ mov $4, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/lseek.S b/libc/arch-x86/syscalls/lseek.S
new file mode 100644
index 0000000..0b2c57c
--- /dev/null
+++ b/libc/arch-x86/syscalls/lseek.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type lseek, @function
+ .globl lseek
+ .align 4
+
+lseek:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_lseek, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/lstat.S b/libc/arch-x86/syscalls/lstat.S
new file mode 100644
index 0000000..4739f32
--- /dev/null
+++ b/libc/arch-x86/syscalls/lstat.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type lstat, @function
+ .globl lstat
+ .align 4
+
+lstat:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_lstat64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/madvise.S b/libc/arch-x86/syscalls/madvise.S
new file mode 100644
index 0000000..2423cc2
--- /dev/null
+++ b/libc/arch-x86/syscalls/madvise.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type madvise, @function
+ .globl madvise
+ .align 4
+
+madvise:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_madvise, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/mincore.S b/libc/arch-x86/syscalls/mincore.S
new file mode 100644
index 0000000..1e02ac2
--- /dev/null
+++ b/libc/arch-x86/syscalls/mincore.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type mincore, @function
+ .globl mincore
+ .align 4
+
+mincore:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_mincore, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/mkdir.S b/libc/arch-x86/syscalls/mkdir.S
new file mode 100644
index 0000000..4f1d157
--- /dev/null
+++ b/libc/arch-x86/syscalls/mkdir.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type mkdir, @function
+ .globl mkdir
+ .align 4
+
+mkdir:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_mkdir, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/mkdirat.S b/libc/arch-x86/syscalls/mkdirat.S
new file mode 100644
index 0000000..10406d3
--- /dev/null
+++ b/libc/arch-x86/syscalls/mkdirat.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type mkdirat, @function
+ .globl mkdirat
+ .align 4
+
+mkdirat:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_mkdirat, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/mknod.S b/libc/arch-x86/syscalls/mknod.S
new file mode 100644
index 0000000..8df1013
--- /dev/null
+++ b/libc/arch-x86/syscalls/mknod.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type mknod, @function
+ .globl mknod
+ .align 4
+
+mknod:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_mknod, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/mlock.S b/libc/arch-x86/syscalls/mlock.S
new file mode 100644
index 0000000..85323d2
--- /dev/null
+++ b/libc/arch-x86/syscalls/mlock.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type mlock, @function
+ .globl mlock
+ .align 4
+
+mlock:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_mlock, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/mount.S b/libc/arch-x86/syscalls/mount.S
new file mode 100644
index 0000000..46237d3
--- /dev/null
+++ b/libc/arch-x86/syscalls/mount.S
@@ -0,0 +1,35 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type mount, @function
+ .globl mount
+ .align 4
+
+mount:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ mov 24(%esp), %ebx
+ mov 28(%esp), %ecx
+ mov 32(%esp), %edx
+ mov 36(%esp), %esi
+ mov 40(%esp), %edi
+ movl $__NR_mount, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/mprotect.S b/libc/arch-x86/syscalls/mprotect.S
new file mode 100644
index 0000000..f44d564
--- /dev/null
+++ b/libc/arch-x86/syscalls/mprotect.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type mprotect, @function
+ .globl mprotect
+ .align 4
+
+mprotect:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_mprotect, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/mremap.S b/libc/arch-x86/syscalls/mremap.S
new file mode 100644
index 0000000..891261c
--- /dev/null
+++ b/libc/arch-x86/syscalls/mremap.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type mremap, @function
+ .globl mremap
+ .align 4
+
+mremap:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_mremap, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/msync.S b/libc/arch-x86/syscalls/msync.S
new file mode 100644
index 0000000..b83ce01
--- /dev/null
+++ b/libc/arch-x86/syscalls/msync.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type msync, @function
+ .globl msync
+ .align 4
+
+msync:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_msync, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/munlock.S b/libc/arch-x86/syscalls/munlock.S
new file mode 100644
index 0000000..75ee75e
--- /dev/null
+++ b/libc/arch-x86/syscalls/munlock.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type munlock, @function
+ .globl munlock
+ .align 4
+
+munlock:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_munlock, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/munmap.S b/libc/arch-x86/syscalls/munmap.S
new file mode 100644
index 0000000..b251844
--- /dev/null
+++ b/libc/arch-x86/syscalls/munmap.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type munmap, @function
+ .globl munmap
+ .align 4
+
+munmap:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_munmap, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/nanosleep.S b/libc/arch-x86/syscalls/nanosleep.S
new file mode 100644
index 0000000..c274d4f
--- /dev/null
+++ b/libc/arch-x86/syscalls/nanosleep.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type nanosleep, @function
+ .globl nanosleep
+ .align 4
+
+nanosleep:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_nanosleep, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/pause.S b/libc/arch-x86/syscalls/pause.S
new file mode 100644
index 0000000..3fe1546
--- /dev/null
+++ b/libc/arch-x86/syscalls/pause.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type pause, @function
+ .globl pause
+ .align 4
+
+pause:
+ movl $__NR_pause, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/pipe.S b/libc/arch-x86/syscalls/pipe.S
new file mode 100644
index 0000000..d130909
--- /dev/null
+++ b/libc/arch-x86/syscalls/pipe.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type pipe, @function
+ .globl pipe
+ .align 4
+
+pipe:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_pipe, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/poll.S b/libc/arch-x86/syscalls/poll.S
new file mode 100644
index 0000000..b732af6
--- /dev/null
+++ b/libc/arch-x86/syscalls/poll.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type poll, @function
+ .globl poll
+ .align 4
+
+poll:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_poll, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/prctl.S b/libc/arch-x86/syscalls/prctl.S
new file mode 100644
index 0000000..4ce5d89
--- /dev/null
+++ b/libc/arch-x86/syscalls/prctl.S
@@ -0,0 +1,35 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type prctl, @function
+ .globl prctl
+ .align 4
+
+prctl:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ mov 24(%esp), %ebx
+ mov 28(%esp), %ecx
+ mov 32(%esp), %edx
+ mov 36(%esp), %esi
+ mov 40(%esp), %edi
+ movl $__NR_prctl, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/read.S b/libc/arch-x86/syscalls/read.S
new file mode 100644
index 0000000..63549dc
--- /dev/null
+++ b/libc/arch-x86/syscalls/read.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type read, @function
+ .globl read
+ .align 4
+
+read:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_read, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/readlink.S b/libc/arch-x86/syscalls/readlink.S
new file mode 100644
index 0000000..53c7632
--- /dev/null
+++ b/libc/arch-x86/syscalls/readlink.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type readlink, @function
+ .globl readlink
+ .align 4
+
+readlink:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_readlink, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/readv.S b/libc/arch-x86/syscalls/readv.S
new file mode 100644
index 0000000..ed352d2
--- /dev/null
+++ b/libc/arch-x86/syscalls/readv.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type readv, @function
+ .globl readv
+ .align 4
+
+readv:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_readv, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/recvfrom.S b/libc/arch-x86/syscalls/recvfrom.S
new file mode 100644
index 0000000..3a38518
--- /dev/null
+++ b/libc/arch-x86/syscalls/recvfrom.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type recvfrom, @function
+ .globl recvfrom
+ .align 4
+
+recvfrom:
+ pushl %ebx
+ pushl %ecx
+ mov $12, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/recvmsg.S b/libc/arch-x86/syscalls/recvmsg.S
new file mode 100644
index 0000000..aee69d6
--- /dev/null
+++ b/libc/arch-x86/syscalls/recvmsg.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type recvmsg, @function
+ .globl recvmsg
+ .align 4
+
+recvmsg:
+ pushl %ebx
+ pushl %ecx
+ mov $17, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/rename.S b/libc/arch-x86/syscalls/rename.S
new file mode 100644
index 0000000..79ae119
--- /dev/null
+++ b/libc/arch-x86/syscalls/rename.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type rename, @function
+ .globl rename
+ .align 4
+
+rename:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_rename, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/renameat.S b/libc/arch-x86/syscalls/renameat.S
new file mode 100644
index 0000000..30ba210
--- /dev/null
+++ b/libc/arch-x86/syscalls/renameat.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type renameat, @function
+ .globl renameat
+ .align 4
+
+renameat:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_renameat, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/rmdir.S b/libc/arch-x86/syscalls/rmdir.S
new file mode 100644
index 0000000..124c10d
--- /dev/null
+++ b/libc/arch-x86/syscalls/rmdir.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type rmdir, @function
+ .globl rmdir
+ .align 4
+
+rmdir:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_rmdir, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sched_get_priority_max.S b/libc/arch-x86/syscalls/sched_get_priority_max.S
new file mode 100644
index 0000000..e2d09a6
--- /dev/null
+++ b/libc/arch-x86/syscalls/sched_get_priority_max.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sched_get_priority_max, @function
+ .globl sched_get_priority_max
+ .align 4
+
+sched_get_priority_max:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_sched_get_priority_max, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sched_get_priority_min.S b/libc/arch-x86/syscalls/sched_get_priority_min.S
new file mode 100644
index 0000000..0f66eee
--- /dev/null
+++ b/libc/arch-x86/syscalls/sched_get_priority_min.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sched_get_priority_min, @function
+ .globl sched_get_priority_min
+ .align 4
+
+sched_get_priority_min:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_sched_get_priority_min, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sched_getparam.S b/libc/arch-x86/syscalls/sched_getparam.S
new file mode 100644
index 0000000..2a8bd0e
--- /dev/null
+++ b/libc/arch-x86/syscalls/sched_getparam.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sched_getparam, @function
+ .globl sched_getparam
+ .align 4
+
+sched_getparam:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_sched_getparam, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sched_getscheduler.S b/libc/arch-x86/syscalls/sched_getscheduler.S
new file mode 100644
index 0000000..aaa5f8c
--- /dev/null
+++ b/libc/arch-x86/syscalls/sched_getscheduler.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sched_getscheduler, @function
+ .globl sched_getscheduler
+ .align 4
+
+sched_getscheduler:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_sched_getscheduler, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sched_rr_get_interval.S b/libc/arch-x86/syscalls/sched_rr_get_interval.S
new file mode 100644
index 0000000..58ccddd
--- /dev/null
+++ b/libc/arch-x86/syscalls/sched_rr_get_interval.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sched_rr_get_interval, @function
+ .globl sched_rr_get_interval
+ .align 4
+
+sched_rr_get_interval:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_sched_rr_get_interval, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sched_setparam.S b/libc/arch-x86/syscalls/sched_setparam.S
new file mode 100644
index 0000000..4b869bf
--- /dev/null
+++ b/libc/arch-x86/syscalls/sched_setparam.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sched_setparam, @function
+ .globl sched_setparam
+ .align 4
+
+sched_setparam:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_sched_setparam, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sched_setscheduler.S b/libc/arch-x86/syscalls/sched_setscheduler.S
new file mode 100644
index 0000000..099a6d1
--- /dev/null
+++ b/libc/arch-x86/syscalls/sched_setscheduler.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sched_setscheduler, @function
+ .globl sched_setscheduler
+ .align 4
+
+sched_setscheduler:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_sched_setscheduler, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sched_yield.S b/libc/arch-x86/syscalls/sched_yield.S
new file mode 100644
index 0000000..fcd7281
--- /dev/null
+++ b/libc/arch-x86/syscalls/sched_yield.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sched_yield, @function
+ .globl sched_yield
+ .align 4
+
+sched_yield:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_sched_yield, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/select.S b/libc/arch-x86/syscalls/select.S
new file mode 100644
index 0000000..27359a9
--- /dev/null
+++ b/libc/arch-x86/syscalls/select.S
@@ -0,0 +1,35 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type select, @function
+ .globl select
+ .align 4
+
+select:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ mov 24(%esp), %ebx
+ mov 28(%esp), %ecx
+ mov 32(%esp), %edx
+ mov 36(%esp), %esi
+ mov 40(%esp), %edi
+ movl $__NR__newselect, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sendfile.S b/libc/arch-x86/syscalls/sendfile.S
new file mode 100644
index 0000000..2752eec
--- /dev/null
+++ b/libc/arch-x86/syscalls/sendfile.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sendfile, @function
+ .globl sendfile
+ .align 4
+
+sendfile:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ mov 20(%esp), %ebx
+ mov 24(%esp), %ecx
+ mov 28(%esp), %edx
+ mov 32(%esp), %esi
+ movl $__NR_sendfile, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sendmsg.S b/libc/arch-x86/syscalls/sendmsg.S
new file mode 100644
index 0000000..5f26623
--- /dev/null
+++ b/libc/arch-x86/syscalls/sendmsg.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sendmsg, @function
+ .globl sendmsg
+ .align 4
+
+sendmsg:
+ pushl %ebx
+ pushl %ecx
+ mov $16, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sendto.S b/libc/arch-x86/syscalls/sendto.S
new file mode 100644
index 0000000..d79a2ba
--- /dev/null
+++ b/libc/arch-x86/syscalls/sendto.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sendto, @function
+ .globl sendto
+ .align 4
+
+sendto:
+ pushl %ebx
+ pushl %ecx
+ mov $11, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setgid.S b/libc/arch-x86/syscalls/setgid.S
new file mode 100644
index 0000000..67fd02e
--- /dev/null
+++ b/libc/arch-x86/syscalls/setgid.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setgid, @function
+ .globl setgid
+ .align 4
+
+setgid:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_setgid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setgroups.S b/libc/arch-x86/syscalls/setgroups.S
new file mode 100644
index 0000000..b6bab11
--- /dev/null
+++ b/libc/arch-x86/syscalls/setgroups.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setgroups, @function
+ .globl setgroups
+ .align 4
+
+setgroups:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_setgroups32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setitimer.S b/libc/arch-x86/syscalls/setitimer.S
new file mode 100644
index 0000000..29d4bc6
--- /dev/null
+++ b/libc/arch-x86/syscalls/setitimer.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setitimer, @function
+ .globl setitimer
+ .align 4
+
+setitimer:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_setitimer, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setpgid.S b/libc/arch-x86/syscalls/setpgid.S
new file mode 100644
index 0000000..df72382
--- /dev/null
+++ b/libc/arch-x86/syscalls/setpgid.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setpgid, @function
+ .globl setpgid
+ .align 4
+
+setpgid:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_setpgid, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setpriority.S b/libc/arch-x86/syscalls/setpriority.S
new file mode 100644
index 0000000..39d7a18
--- /dev/null
+++ b/libc/arch-x86/syscalls/setpriority.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setpriority, @function
+ .globl setpriority
+ .align 4
+
+setpriority:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_setpriority, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setregid.S b/libc/arch-x86/syscalls/setregid.S
new file mode 100644
index 0000000..c3112de
--- /dev/null
+++ b/libc/arch-x86/syscalls/setregid.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setregid, @function
+ .globl setregid
+ .align 4
+
+setregid:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_setregid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setresgid.S b/libc/arch-x86/syscalls/setresgid.S
new file mode 100644
index 0000000..8e6c8c9
--- /dev/null
+++ b/libc/arch-x86/syscalls/setresgid.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setresgid, @function
+ .globl setresgid
+ .align 4
+
+setresgid:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_setresgid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setresuid.S b/libc/arch-x86/syscalls/setresuid.S
new file mode 100644
index 0000000..f81cb39
--- /dev/null
+++ b/libc/arch-x86/syscalls/setresuid.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setresuid, @function
+ .globl setresuid
+ .align 4
+
+setresuid:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_setresuid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setreuid.S b/libc/arch-x86/syscalls/setreuid.S
new file mode 100644
index 0000000..99e5d5b
--- /dev/null
+++ b/libc/arch-x86/syscalls/setreuid.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setreuid, @function
+ .globl setreuid
+ .align 4
+
+setreuid:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_setreuid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setrlimit.S b/libc/arch-x86/syscalls/setrlimit.S
new file mode 100644
index 0000000..31613c5
--- /dev/null
+++ b/libc/arch-x86/syscalls/setrlimit.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setrlimit, @function
+ .globl setrlimit
+ .align 4
+
+setrlimit:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_setrlimit, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setsid.S b/libc/arch-x86/syscalls/setsid.S
new file mode 100644
index 0000000..db31380
--- /dev/null
+++ b/libc/arch-x86/syscalls/setsid.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setsid, @function
+ .globl setsid
+ .align 4
+
+setsid:
+ movl $__NR_setsid, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ ret
diff --git a/libc/arch-x86/syscalls/setsockopt.S b/libc/arch-x86/syscalls/setsockopt.S
new file mode 100644
index 0000000..d1c986a
--- /dev/null
+++ b/libc/arch-x86/syscalls/setsockopt.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setsockopt, @function
+ .globl setsockopt
+ .align 4
+
+setsockopt:
+ pushl %ebx
+ pushl %ecx
+ mov $14, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/settimeofday.S b/libc/arch-x86/syscalls/settimeofday.S
new file mode 100644
index 0000000..e77fa1e
--- /dev/null
+++ b/libc/arch-x86/syscalls/settimeofday.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type settimeofday, @function
+ .globl settimeofday
+ .align 4
+
+settimeofday:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_settimeofday, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/setuid.S b/libc/arch-x86/syscalls/setuid.S
new file mode 100644
index 0000000..de334c0
--- /dev/null
+++ b/libc/arch-x86/syscalls/setuid.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type setuid, @function
+ .globl setuid
+ .align 4
+
+setuid:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_setuid32, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/shutdown.S b/libc/arch-x86/syscalls/shutdown.S
new file mode 100644
index 0000000..45f0664
--- /dev/null
+++ b/libc/arch-x86/syscalls/shutdown.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type shutdown, @function
+ .globl shutdown
+ .align 4
+
+shutdown:
+ pushl %ebx
+ pushl %ecx
+ mov $13, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sigaction.S b/libc/arch-x86/syscalls/sigaction.S
new file mode 100644
index 0000000..b16e3aa
--- /dev/null
+++ b/libc/arch-x86/syscalls/sigaction.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sigaction, @function
+ .globl sigaction
+ .align 4
+
+sigaction:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_sigaction, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sigpending.S b/libc/arch-x86/syscalls/sigpending.S
new file mode 100644
index 0000000..2280886
--- /dev/null
+++ b/libc/arch-x86/syscalls/sigpending.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sigpending, @function
+ .globl sigpending
+ .align 4
+
+sigpending:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_sigpending, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sigprocmask.S b/libc/arch-x86/syscalls/sigprocmask.S
new file mode 100644
index 0000000..42fcf92
--- /dev/null
+++ b/libc/arch-x86/syscalls/sigprocmask.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sigprocmask, @function
+ .globl sigprocmask
+ .align 4
+
+sigprocmask:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_sigprocmask, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/socket.S b/libc/arch-x86/syscalls/socket.S
new file mode 100644
index 0000000..89a8358
--- /dev/null
+++ b/libc/arch-x86/syscalls/socket.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type socket, @function
+ .globl socket
+ .align 4
+
+socket:
+ pushl %ebx
+ pushl %ecx
+ mov $1, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/socketpair.S b/libc/arch-x86/syscalls/socketpair.S
new file mode 100644
index 0000000..0222989
--- /dev/null
+++ b/libc/arch-x86/syscalls/socketpair.S
@@ -0,0 +1,27 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type socketpair, @function
+ .globl socketpair
+ .align 4
+
+socketpair:
+ pushl %ebx
+ pushl %ecx
+ mov $8, %ebx
+ mov %esp, %ecx
+ addl $12, %ecx
+ movl $__NR_socketcall, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/stat.S b/libc/arch-x86/syscalls/stat.S
new file mode 100644
index 0000000..c9984f1
--- /dev/null
+++ b/libc/arch-x86/syscalls/stat.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type stat, @function
+ .globl stat
+ .align 4
+
+stat:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_stat64, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/symlink.S b/libc/arch-x86/syscalls/symlink.S
new file mode 100644
index 0000000..04c4298
--- /dev/null
+++ b/libc/arch-x86/syscalls/symlink.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type symlink, @function
+ .globl symlink
+ .align 4
+
+symlink:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_symlink, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/sync.S b/libc/arch-x86/syscalls/sync.S
new file mode 100644
index 0000000..5a6a727
--- /dev/null
+++ b/libc/arch-x86/syscalls/sync.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sync, @function
+ .globl sync
+ .align 4
+
+sync:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_sync, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/times.S b/libc/arch-x86/syscalls/times.S
new file mode 100644
index 0000000..543f2be
--- /dev/null
+++ b/libc/arch-x86/syscalls/times.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type times, @function
+ .globl times
+ .align 4
+
+times:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_times, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/tkill.S b/libc/arch-x86/syscalls/tkill.S
new file mode 100644
index 0000000..f1f174b
--- /dev/null
+++ b/libc/arch-x86/syscalls/tkill.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type tkill, @function
+ .globl tkill
+ .align 4
+
+tkill:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_tkill, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/truncate.S b/libc/arch-x86/syscalls/truncate.S
new file mode 100644
index 0000000..8c6646d
--- /dev/null
+++ b/libc/arch-x86/syscalls/truncate.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type truncate, @function
+ .globl truncate
+ .align 4
+
+truncate:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_truncate, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/umask.S b/libc/arch-x86/syscalls/umask.S
new file mode 100644
index 0000000..fe3d8cd
--- /dev/null
+++ b/libc/arch-x86/syscalls/umask.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type umask, @function
+ .globl umask
+ .align 4
+
+umask:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_umask, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/umount2.S b/libc/arch-x86/syscalls/umount2.S
new file mode 100644
index 0000000..fdb5354
--- /dev/null
+++ b/libc/arch-x86/syscalls/umount2.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type umount2, @function
+ .globl umount2
+ .align 4
+
+umount2:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_umount2, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/uname.S b/libc/arch-x86/syscalls/uname.S
new file mode 100644
index 0000000..b5e8bfa
--- /dev/null
+++ b/libc/arch-x86/syscalls/uname.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type uname, @function
+ .globl uname
+ .align 4
+
+uname:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_uname, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/unlink.S b/libc/arch-x86/syscalls/unlink.S
new file mode 100644
index 0000000..0fe52bf
--- /dev/null
+++ b/libc/arch-x86/syscalls/unlink.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type unlink, @function
+ .globl unlink
+ .align 4
+
+unlink:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_unlink, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/unlinkat.S b/libc/arch-x86/syscalls/unlinkat.S
new file mode 100644
index 0000000..f6f8c17
--- /dev/null
+++ b/libc/arch-x86/syscalls/unlinkat.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type unlinkat, @function
+ .globl unlinkat
+ .align 4
+
+unlinkat:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_unlinkat, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/utimes.S b/libc/arch-x86/syscalls/utimes.S
new file mode 100644
index 0000000..1a1b51d
--- /dev/null
+++ b/libc/arch-x86/syscalls/utimes.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type utimes, @function
+ .globl utimes
+ .align 4
+
+utimes:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_utimes, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/waitid.S b/libc/arch-x86/syscalls/waitid.S
new file mode 100644
index 0000000..9a5328b
--- /dev/null
+++ b/libc/arch-x86/syscalls/waitid.S
@@ -0,0 +1,35 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type waitid, @function
+ .globl waitid
+ .align 4
+
+waitid:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushl %esi
+ pushl %edi
+ mov 24(%esp), %ebx
+ mov 28(%esp), %ecx
+ mov 32(%esp), %edx
+ mov 36(%esp), %esi
+ mov 40(%esp), %edi
+ movl $__NR_waitid, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edi
+ popl %esi
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/write.S b/libc/arch-x86/syscalls/write.S
new file mode 100644
index 0000000..caa450f
--- /dev/null
+++ b/libc/arch-x86/syscalls/write.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type write, @function
+ .globl write
+ .align 4
+
+write:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_write, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret
diff --git a/libc/arch-x86/syscalls/writev.S b/libc/arch-x86/syscalls/writev.S
new file mode 100644
index 0000000..53d3731
--- /dev/null
+++ b/libc/arch-x86/syscalls/writev.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type writev, @function
+ .globl writev
+ .align 4
+
+writev:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_writev, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret