Merge "Fix up failing glibc tests."
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index ca1784f..f31073f 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -6,7 +6,7 @@
#
# where:
# arch_list ::= "all" | arch+
-# arch ::= "arm" | "mips" | "x86" | "x86_64"
+# arch ::= "aarch64" | "arm" | "mips" | "x86" | "x86_64"
#
# Note:
# - syscall_name corresponds to the name of the syscall, which may differ from
@@ -27,54 +27,54 @@
int execve(const char*, char* const*, char* const*) all
uid_t getuid:getuid32() arm,x86
-uid_t getuid:getuid() mips,x86_64
+uid_t getuid:getuid() aarch64,mips,x86_64
gid_t getgid:getgid32() arm,x86
-gid_t getgid:getgid() mips,x86_64
+gid_t getgid:getgid() aarch64,mips,x86_64
uid_t geteuid:geteuid32() arm,x86
-uid_t geteuid:geteuid() mips,x86_64
+uid_t geteuid:geteuid() aarch64,mips,x86_64
gid_t getegid:getegid32() arm,x86
-gid_t getegid:getegid() mips,x86_64
+gid_t getegid:getegid() aarch64,mips,x86_64
uid_t getresuid:getresuid32(uid_t* ruid, uid_t* euid, uid_t* suid) arm,x86
-uid_t getresuid:getresuid(uid_t* ruid, uid_t* euid, uid_t* suid) mips,x86_64
+uid_t getresuid:getresuid(uid_t* ruid, uid_t* euid, uid_t* suid) aarch64,mips,x86_64
gid_t getresgid:getresgid32(gid_t* rgid, gid_t* egid, gid_t* sgid) arm,x86
-gid_t getresgid:getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid) mips,x86_64
+gid_t getresgid:getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid) aarch64,mips,x86_64
pid_t gettid() all
ssize_t readahead(int, off64_t, size_t) all
int getgroups:getgroups32(int, gid_t*) arm,x86
-int getgroups:getgroups(int, gid_t*) mips,x86_64
+int getgroups:getgroups(int, gid_t*) aarch64,mips,x86_64
pid_t getpgid(pid_t) all
pid_t getppid() all
pid_t getsid(pid_t) all
pid_t setsid() all
int setgid:setgid32(gid_t) arm,x86
-int setgid:setgid(gid_t) mips,x86_64
+int setgid:setgid(gid_t) aarch64,mips,x86_64
int setuid:setuid32(uid_t) arm,x86
-int setuid:setuid(uid_t) mips,x86_64
+int setuid:setuid(uid_t) aarch64,mips,x86_64
int setreuid:setreuid32(uid_t, uid_t) arm,x86
-int setreuid:setreuid(uid_t, uid_t) mips,x86_64
+int setreuid:setreuid(uid_t, uid_t) aarch64,mips,x86_64
int setresuid:setresuid32(uid_t, uid_t, uid_t) arm,x86
-int setresuid:setresuid(uid_t, uid_t, uid_t) mips,x86_64
+int setresuid:setresuid(uid_t, uid_t, uid_t) aarch64,mips,x86_64
int setresgid:setresgid32(gid_t, gid_t, gid_t) arm,x86
-int setresgid:setresgid(gid_t, gid_t, gid_t) mips,x86_64
+int setresgid:setresgid(gid_t, gid_t, gid_t) aarch64,mips,x86_64
void* __brk:brk(void*) all
# See comments in kill.S to understand why we don't generate ARM stubs for kill/tkill/tgkill.
-int kill(pid_t, int) mips,x86,x86_64
-int tkill(pid_t tid, int sig) mips,x86,x86_64
-int tgkill(pid_t tgid, pid_t tid, int sig) mips,x86,x86_64
+int kill(pid_t, int) aarch64,mips,x86,x86_64
+int tkill(pid_t tid, int sig) aarch64,mips,x86,x86_64
+int tgkill(pid_t tgid, pid_t tid, int sig) aarch64,mips,x86,x86_64
int __ptrace:ptrace(int request, int pid, void* addr, void* data) all
int __set_thread_area:set_thread_area(void* user_desc) mips,x86
int __getpriority:getpriority(int, int) all
int setpriority(int, int, int) all
int setrlimit(int resource, const struct rlimit* rlp) all
int getrlimit:ugetrlimit(int resource, struct rlimit* rlp) arm,x86
-int getrlimit:getrlimit(int resource, struct rlimit* rlp) mips,x86_64
+int getrlimit:getrlimit(int resource, struct rlimit* rlp) aarch64,mips,x86_64
int getrusage(int who, struct rusage* r_usage) all
int setgroups:setgroups32(int, const gid_t*) arm,x86
-int setgroups:setgroups(int, const gid_t*) mips,x86_64
+int setgroups:setgroups(int, const gid_t*) aarch64,mips,x86_64
int setpgid(pid_t, pid_t) all
pid_t vfork(void) arm
int setregid:setregid32(gid_t, gid_t) arm,x86
-int setregid:setregid(gid_t, gid_t) mips,x86_64
+int setregid:setregid(gid_t, gid_t) aarch64,mips,x86_64
int chroot(const char*) all
# IMPORTANT: Even though <sys/prctl.h> declares prctl(int, ...), the syscall stub must take 6 arguments
# to match the kernel implementation.
@@ -92,8 +92,8 @@
ssize_t pwrite64(int, void*, size_t, off64_t) all
int close(int) all
pid_t getpid() all
-void* mmap(void*, size_t, int, int, int, long) x86_64
-void* __mmap2:mmap2(void*, size_t, int, int, int, long) arm,x86,mips
+void* mmap(void*, size_t, int, int, int, long) aarch64,x86_64
+void* __mmap2:mmap2(void*, size_t, int, int, int, long) arm,mips,x86
int munmap(void*, size_t) all
void* mremap(void*, size_t, size_t, unsigned long) all
int msync(const void*, size_t, int) all
@@ -107,8 +107,8 @@
int __ioctl:ioctl(int, int, void*) all
int readv(int, const struct iovec*, int) all
int writev(int, const struct iovec*, int) all
-int __fcntl:fcntl(int, int, void*) arm,x86,mips
-int fcntl(int, void*) x86_64
+int __fcntl:fcntl(int, int, void*) arm,mips,x86
+int fcntl(int, void*) aarch64,x86_64
int flock(int, int) all
int fchmod(int, mode_t) all
int dup(int) all
@@ -118,11 +118,11 @@
int fsync(int) all
int fdatasync(int) all
int fchown:fchown32(int, uid_t, gid_t) arm,x86
-int fchown:fchown(int, uid_t, gid_t) mips,x86_64
+int fchown:fchown(int, uid_t, gid_t) aarch64,mips,x86_64
void sync(void) all
-int __fcntl64:fcntl64(int, int, void*) arm,x86,mips
-int __fstatfs64:fstatfs64(int, size_t, struct statfs*) arm,x86,mips
-int fstatfs(int, struct statfs*) x86_64
+int __fcntl64:fcntl64(int, int, void*) arm,mips,x86
+int __fstatfs64:fstatfs64(int, size_t, struct statfs*) arm,mips,x86
+int fstatfs(int, struct statfs*) aarch64,x86_64
int fsetxattr(int, const char*, const void*, size_t, int) all
ssize_t fgetxattr(int, const char*, void*, size_t) all
ssize_t flistxattr(int, char*, size_t) all
@@ -132,8 +132,8 @@
int faccessat(int, const char*, int, int) all
int fchmodat(int, const char*, mode_t, int) all
int fchownat(int, const char*, uid_t, gid_t, int) all
-int fstatat:fstatat64(int, const char*, struct stat*, int) arm,x86,mips
-int fstatat:newfstatat(int, const char*, struct stat*, int) x86_64
+int fstatat:fstatat64(int, const char*, struct stat*, int) arm,mips,x86
+int fstatat:newfstatat(int, const char*, struct stat*, int) aarch64,x86_64
int linkat(int, const char*, int, const char*, int) all
int mkdirat(int, const char*, mode_t) all
int mknodat(int, const char*, mode_t, dev_t) all
@@ -149,23 +149,23 @@
# That means that every system call in this section should take three lines.
off_t lseek(int, off_t, int) arm,mips,x86
int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) arm,mips,x86
-off_t lseek|lseek64(int, off_t, int) x86_64
+off_t lseek|lseek64(int, off_t, int) aarch64,x86_64
int ftruncate(int, off_t) arm,mips,x86
int ftruncate64(int, off64_t) arm,mips,x86
-int ftruncate|ftruncate64(int, off_t) x86_64
+int ftruncate|ftruncate64(int, off_t) aarch64,x86_64
ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) arm,mips,x86
ssize_t sendfile64(int out_fd, int in_fd, off64_t* offset, size_t count) arm,mips,x86
-ssize_t sendfile|sendfile64(int out_fd, int in_fd, off_t* offset, size_t count) x86_64
+ssize_t sendfile|sendfile64(int out_fd, int in_fd, off_t* offset, size_t count) aarch64,x86_64
int truncate(const char*, off_t) arm,mips,x86
int truncate64(const char*, off64_t) arm,mips,x86
-int truncate|truncate64(const char*, off_t) x86_64
+int truncate|truncate64(const char*, off_t) aarch64,x86_64
# file system
int chdir(const char*) all
int mount(const char*, const char*, const char*, unsigned long, const void*) all
int umount2(const char*, int) all
-int fstat:fstat64(int, struct stat*) arm,x86,mips
-int fstat(int, struct stat*) x86_64
+int fstat:fstat64(int, struct stat*) arm,mips,x86
+int fstat(int, struct stat*) aarch64,x86_64
int __getcwd:getcwd(char* buf, size_t size) all
int fchdir(int) all
int setxattr(const char*, const char*, const void*, size_t, int) all
@@ -176,8 +176,8 @@
ssize_t llistxattr(const char*, char*, size_t) all
int removexattr(const char*, const char*) all
int lremovexattr(const char*, const char*) all
-int __statfs64:statfs64(const char*, size_t, struct statfs*) arm,x86,mips
-int statfs(const char*, struct statfs*) x86_64
+int __statfs64:statfs64(const char*, size_t, struct statfs*) arm,mips,x86
+int statfs(const char*, struct statfs*) aarch64,x86_64
long unshare(unsigned long) all
int swapon(const char*, int) all
int swapoff(const char*) all
@@ -212,21 +212,21 @@
int signalfd4(int, const sigset_t*, size_t, int) all
# sockets
-int socket(int, int, int) arm,mips,x86_64
-int socketpair(int, int, int, int*) arm,mips,x86_64
-int bind(int, struct sockaddr*, int) arm,mips,x86_64
-int connect(int, struct sockaddr*, socklen_t) arm,mips,x86_64
-int listen(int, int) arm,mips,x86_64
-int accept(int, struct sockaddr*, socklen_t*) arm,mips,x86_64
-int getsockname(int, struct sockaddr*, socklen_t*) arm,mips,x86_64
-int getpeername(int, struct sockaddr*, socklen_t*) arm,mips,x86_64
-int sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t) arm,mips,x86_64
-int recvfrom(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*) arm,mips,x86_64
-int shutdown(int, int) arm,mips,x86_64
-int setsockopt(int, int, int, const void*, socklen_t) arm,mips,x86_64
-int getsockopt(int, int, int, void*, socklen_t*) arm,mips,x86_64
-int sendmsg(int, const struct msghdr*, unsigned int) arm,mips,x86_64
-int recvmsg(int, struct msghdr*, unsigned int) arm,mips,x86_64
+int socket(int, int, int) aarch64,arm,mips,x86_64
+int socketpair(int, int, int, int*) aarch64,arm,mips,x86_64
+int bind(int, struct sockaddr*, int) aarch64,arm,mips,x86_64
+int connect(int, struct sockaddr*, socklen_t) aarch64,arm,mips,x86_64
+int listen(int, int) aarch64,arm,mips,x86_64
+int accept(int, struct sockaddr*, socklen_t*) aarch64,arm,mips,x86_64
+int getsockname(int, struct sockaddr*, socklen_t*) aarch64,arm,mips,x86_64
+int getpeername(int, struct sockaddr*, socklen_t*) aarch64,arm,mips,x86_64
+int sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t) aarch64,arm,mips,x86_64
+int recvfrom(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*) aarch64,arm,mips,x86_64
+int shutdown(int, int) aarch64,arm,mips,x86_64
+int setsockopt(int, int, int, const void*, socklen_t) aarch64,arm,mips,x86_64
+int getsockopt(int, int, int, void*, socklen_t*) aarch64,arm,mips,x86_64
+int sendmsg(int, const struct msghdr*, unsigned int) aarch64,arm,mips,x86_64
+int recvmsg(int, struct msghdr*, unsigned int) aarch64,arm,mips,x86_64
# sockets for x86. These are done as an "indexed" call to socketcall syscall.
int socket:socketcall:1(int, int, int) x86
diff --git a/libc/arch-aarch64/syscalls.mk b/libc/arch-aarch64/syscalls.mk
new file mode 100644
index 0000000..995d44a
--- /dev/null
+++ b/libc/arch-aarch64/syscalls.mk
@@ -0,0 +1,188 @@
+# Generated by gensyscalls.py. Do not edit.
+syscall_src :=
+syscall_src += arch-aarch64/syscalls/__brk.S
+syscall_src += arch-aarch64/syscalls/__clone.S
+syscall_src += arch-aarch64/syscalls/__epoll_pwait.S
+syscall_src += arch-aarch64/syscalls/__exit.S
+syscall_src += arch-aarch64/syscalls/__getcpu.S
+syscall_src += arch-aarch64/syscalls/__getcwd.S
+syscall_src += arch-aarch64/syscalls/__getpriority.S
+syscall_src += arch-aarch64/syscalls/__ioctl.S
+syscall_src += arch-aarch64/syscalls/__openat.S
+syscall_src += arch-aarch64/syscalls/__ppoll.S
+syscall_src += arch-aarch64/syscalls/__pselect6.S
+syscall_src += arch-aarch64/syscalls/__ptrace.S
+syscall_src += arch-aarch64/syscalls/__reboot.S
+syscall_src += arch-aarch64/syscalls/__rt_sigaction.S
+syscall_src += arch-aarch64/syscalls/__rt_sigpending.S
+syscall_src += arch-aarch64/syscalls/__rt_sigprocmask.S
+syscall_src += arch-aarch64/syscalls/__rt_sigsuspend.S
+syscall_src += arch-aarch64/syscalls/__rt_sigtimedwait.S
+syscall_src += arch-aarch64/syscalls/__sched_getaffinity.S
+syscall_src += arch-aarch64/syscalls/__syslog.S
+syscall_src += arch-aarch64/syscalls/__timer_create.S
+syscall_src += arch-aarch64/syscalls/__timer_delete.S
+syscall_src += arch-aarch64/syscalls/__timer_getoverrun.S
+syscall_src += arch-aarch64/syscalls/__timer_gettime.S
+syscall_src += arch-aarch64/syscalls/__timer_settime.S
+syscall_src += arch-aarch64/syscalls/__waitid.S
+syscall_src += arch-aarch64/syscalls/_exit.S
+syscall_src += arch-aarch64/syscalls/accept.S
+syscall_src += arch-aarch64/syscalls/acct.S
+syscall_src += arch-aarch64/syscalls/bind.S
+syscall_src += arch-aarch64/syscalls/capget.S
+syscall_src += arch-aarch64/syscalls/capset.S
+syscall_src += arch-aarch64/syscalls/chdir.S
+syscall_src += arch-aarch64/syscalls/chroot.S
+syscall_src += arch-aarch64/syscalls/clock_getres.S
+syscall_src += arch-aarch64/syscalls/clock_gettime.S
+syscall_src += arch-aarch64/syscalls/clock_nanosleep.S
+syscall_src += arch-aarch64/syscalls/clock_settime.S
+syscall_src += arch-aarch64/syscalls/close.S
+syscall_src += arch-aarch64/syscalls/connect.S
+syscall_src += arch-aarch64/syscalls/delete_module.S
+syscall_src += arch-aarch64/syscalls/dup.S
+syscall_src += arch-aarch64/syscalls/dup3.S
+syscall_src += arch-aarch64/syscalls/epoll_create1.S
+syscall_src += arch-aarch64/syscalls/epoll_ctl.S
+syscall_src += arch-aarch64/syscalls/eventfd.S
+syscall_src += arch-aarch64/syscalls/execve.S
+syscall_src += arch-aarch64/syscalls/faccessat.S
+syscall_src += arch-aarch64/syscalls/fchdir.S
+syscall_src += arch-aarch64/syscalls/fchmod.S
+syscall_src += arch-aarch64/syscalls/fchmodat.S
+syscall_src += arch-aarch64/syscalls/fchown.S
+syscall_src += arch-aarch64/syscalls/fchownat.S
+syscall_src += arch-aarch64/syscalls/fcntl.S
+syscall_src += arch-aarch64/syscalls/fdatasync.S
+syscall_src += arch-aarch64/syscalls/fgetxattr.S
+syscall_src += arch-aarch64/syscalls/flistxattr.S
+syscall_src += arch-aarch64/syscalls/flock.S
+syscall_src += arch-aarch64/syscalls/fremovexattr.S
+syscall_src += arch-aarch64/syscalls/fsetxattr.S
+syscall_src += arch-aarch64/syscalls/fstat.S
+syscall_src += arch-aarch64/syscalls/fstatat.S
+syscall_src += arch-aarch64/syscalls/fstatfs.S
+syscall_src += arch-aarch64/syscalls/fsync.S
+syscall_src += arch-aarch64/syscalls/ftruncate.S
+syscall_src += arch-aarch64/syscalls/futex.S
+syscall_src += arch-aarch64/syscalls/getdents.S
+syscall_src += arch-aarch64/syscalls/getegid.S
+syscall_src += arch-aarch64/syscalls/geteuid.S
+syscall_src += arch-aarch64/syscalls/getgid.S
+syscall_src += arch-aarch64/syscalls/getgroups.S
+syscall_src += arch-aarch64/syscalls/getitimer.S
+syscall_src += arch-aarch64/syscalls/getpeername.S
+syscall_src += arch-aarch64/syscalls/getpgid.S
+syscall_src += arch-aarch64/syscalls/getpid.S
+syscall_src += arch-aarch64/syscalls/getppid.S
+syscall_src += arch-aarch64/syscalls/getresgid.S
+syscall_src += arch-aarch64/syscalls/getresuid.S
+syscall_src += arch-aarch64/syscalls/getrlimit.S
+syscall_src += arch-aarch64/syscalls/getrusage.S
+syscall_src += arch-aarch64/syscalls/getsid.S
+syscall_src += arch-aarch64/syscalls/getsockname.S
+syscall_src += arch-aarch64/syscalls/getsockopt.S
+syscall_src += arch-aarch64/syscalls/gettid.S
+syscall_src += arch-aarch64/syscalls/gettimeofday.S
+syscall_src += arch-aarch64/syscalls/getuid.S
+syscall_src += arch-aarch64/syscalls/getxattr.S
+syscall_src += arch-aarch64/syscalls/init_module.S
+syscall_src += arch-aarch64/syscalls/inotify_add_watch.S
+syscall_src += arch-aarch64/syscalls/inotify_init1.S
+syscall_src += arch-aarch64/syscalls/inotify_rm_watch.S
+syscall_src += arch-aarch64/syscalls/ioprio_get.S
+syscall_src += arch-aarch64/syscalls/ioprio_set.S
+syscall_src += arch-aarch64/syscalls/kill.S
+syscall_src += arch-aarch64/syscalls/klogctl.S
+syscall_src += arch-aarch64/syscalls/lgetxattr.S
+syscall_src += arch-aarch64/syscalls/linkat.S
+syscall_src += arch-aarch64/syscalls/listen.S
+syscall_src += arch-aarch64/syscalls/listxattr.S
+syscall_src += arch-aarch64/syscalls/llistxattr.S
+syscall_src += arch-aarch64/syscalls/lremovexattr.S
+syscall_src += arch-aarch64/syscalls/lseek.S
+syscall_src += arch-aarch64/syscalls/lsetxattr.S
+syscall_src += arch-aarch64/syscalls/madvise.S
+syscall_src += arch-aarch64/syscalls/mincore.S
+syscall_src += arch-aarch64/syscalls/mkdirat.S
+syscall_src += arch-aarch64/syscalls/mknodat.S
+syscall_src += arch-aarch64/syscalls/mlock.S
+syscall_src += arch-aarch64/syscalls/mlockall.S
+syscall_src += arch-aarch64/syscalls/mmap.S
+syscall_src += arch-aarch64/syscalls/mount.S
+syscall_src += arch-aarch64/syscalls/mprotect.S
+syscall_src += arch-aarch64/syscalls/mremap.S
+syscall_src += arch-aarch64/syscalls/msync.S
+syscall_src += arch-aarch64/syscalls/munlock.S
+syscall_src += arch-aarch64/syscalls/munlockall.S
+syscall_src += arch-aarch64/syscalls/munmap.S
+syscall_src += arch-aarch64/syscalls/nanosleep.S
+syscall_src += arch-aarch64/syscalls/perf_event_open.S
+syscall_src += arch-aarch64/syscalls/personality.S
+syscall_src += arch-aarch64/syscalls/pipe2.S
+syscall_src += arch-aarch64/syscalls/prctl.S
+syscall_src += arch-aarch64/syscalls/pread64.S
+syscall_src += arch-aarch64/syscalls/pwrite64.S
+syscall_src += arch-aarch64/syscalls/read.S
+syscall_src += arch-aarch64/syscalls/readahead.S
+syscall_src += arch-aarch64/syscalls/readlinkat.S
+syscall_src += arch-aarch64/syscalls/readv.S
+syscall_src += arch-aarch64/syscalls/recvfrom.S
+syscall_src += arch-aarch64/syscalls/recvmsg.S
+syscall_src += arch-aarch64/syscalls/removexattr.S
+syscall_src += arch-aarch64/syscalls/renameat.S
+syscall_src += arch-aarch64/syscalls/sched_get_priority_max.S
+syscall_src += arch-aarch64/syscalls/sched_get_priority_min.S
+syscall_src += arch-aarch64/syscalls/sched_getparam.S
+syscall_src += arch-aarch64/syscalls/sched_getscheduler.S
+syscall_src += arch-aarch64/syscalls/sched_rr_get_interval.S
+syscall_src += arch-aarch64/syscalls/sched_setaffinity.S
+syscall_src += arch-aarch64/syscalls/sched_setparam.S
+syscall_src += arch-aarch64/syscalls/sched_setscheduler.S
+syscall_src += arch-aarch64/syscalls/sched_yield.S
+syscall_src += arch-aarch64/syscalls/sendfile.S
+syscall_src += arch-aarch64/syscalls/sendmsg.S
+syscall_src += arch-aarch64/syscalls/sendto.S
+syscall_src += arch-aarch64/syscalls/setgid.S
+syscall_src += arch-aarch64/syscalls/setgroups.S
+syscall_src += arch-aarch64/syscalls/setitimer.S
+syscall_src += arch-aarch64/syscalls/setpgid.S
+syscall_src += arch-aarch64/syscalls/setpriority.S
+syscall_src += arch-aarch64/syscalls/setregid.S
+syscall_src += arch-aarch64/syscalls/setresgid.S
+syscall_src += arch-aarch64/syscalls/setresuid.S
+syscall_src += arch-aarch64/syscalls/setreuid.S
+syscall_src += arch-aarch64/syscalls/setrlimit.S
+syscall_src += arch-aarch64/syscalls/setsid.S
+syscall_src += arch-aarch64/syscalls/setsockopt.S
+syscall_src += arch-aarch64/syscalls/settimeofday.S
+syscall_src += arch-aarch64/syscalls/setuid.S
+syscall_src += arch-aarch64/syscalls/setxattr.S
+syscall_src += arch-aarch64/syscalls/shutdown.S
+syscall_src += arch-aarch64/syscalls/sigaltstack.S
+syscall_src += arch-aarch64/syscalls/signalfd4.S
+syscall_src += arch-aarch64/syscalls/socket.S
+syscall_src += arch-aarch64/syscalls/socketpair.S
+syscall_src += arch-aarch64/syscalls/statfs.S
+syscall_src += arch-aarch64/syscalls/swapoff.S
+syscall_src += arch-aarch64/syscalls/swapon.S
+syscall_src += arch-aarch64/syscalls/symlinkat.S
+syscall_src += arch-aarch64/syscalls/sync.S
+syscall_src += arch-aarch64/syscalls/sysinfo.S
+syscall_src += arch-aarch64/syscalls/tgkill.S
+syscall_src += arch-aarch64/syscalls/timerfd_create.S
+syscall_src += arch-aarch64/syscalls/timerfd_gettime.S
+syscall_src += arch-aarch64/syscalls/timerfd_settime.S
+syscall_src += arch-aarch64/syscalls/times.S
+syscall_src += arch-aarch64/syscalls/tkill.S
+syscall_src += arch-aarch64/syscalls/truncate.S
+syscall_src += arch-aarch64/syscalls/umask.S
+syscall_src += arch-aarch64/syscalls/umount2.S
+syscall_src += arch-aarch64/syscalls/uname.S
+syscall_src += arch-aarch64/syscalls/unlinkat.S
+syscall_src += arch-aarch64/syscalls/unshare.S
+syscall_src += arch-aarch64/syscalls/utimensat.S
+syscall_src += arch-aarch64/syscalls/wait4.S
+syscall_src += arch-aarch64/syscalls/write.S
+syscall_src += arch-aarch64/syscalls/writev.S
diff --git a/libc/arch-aarch64/syscalls/__brk.S b/libc/arch-aarch64/syscalls/__brk.S
new file mode 100644
index 0000000..91e5ee4
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__brk.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__brk)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_brk
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__brk)
+.hidden _C_LABEL(__brk)
diff --git a/libc/arch-aarch64/syscalls/__clone.S b/libc/arch-aarch64/syscalls/__clone.S
new file mode 100644
index 0000000..817ae58
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__clone.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__clone)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_clone
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__clone)
+.hidden _C_LABEL(__clone)
diff --git a/libc/arch-aarch64/syscalls/__epoll_pwait.S b/libc/arch-aarch64/syscalls/__epoll_pwait.S
new file mode 100644
index 0000000..b65c5a9
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__epoll_pwait.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__epoll_pwait)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_epoll_pwait
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__epoll_pwait)
+.hidden _C_LABEL(__epoll_pwait)
diff --git a/libc/arch-aarch64/syscalls/__exit.S b/libc/arch-aarch64/syscalls/__exit.S
new file mode 100644
index 0000000..7443176
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__exit.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__exit)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_exit
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__exit)
+.hidden _C_LABEL(__exit)
diff --git a/libc/arch-aarch64/syscalls/__getcpu.S b/libc/arch-aarch64/syscalls/__getcpu.S
new file mode 100644
index 0000000..907b769
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__getcpu.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__getcpu)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getcpu
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__getcpu)
+.hidden _C_LABEL(__getcpu)
diff --git a/libc/arch-aarch64/syscalls/__getcwd.S b/libc/arch-aarch64/syscalls/__getcwd.S
new file mode 100644
index 0000000..723c550
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__getcwd.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__getcwd)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getcwd
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__getcwd)
+.hidden _C_LABEL(__getcwd)
diff --git a/libc/arch-aarch64/syscalls/__getpriority.S b/libc/arch-aarch64/syscalls/__getpriority.S
new file mode 100644
index 0000000..c0df90f
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__getpriority.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__getpriority)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getpriority
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__getpriority)
+.hidden _C_LABEL(__getpriority)
diff --git a/libc/arch-aarch64/syscalls/__ioctl.S b/libc/arch-aarch64/syscalls/__ioctl.S
new file mode 100644
index 0000000..be1ae0d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__ioctl.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__ioctl)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_ioctl
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__ioctl)
+.hidden _C_LABEL(__ioctl)
diff --git a/libc/arch-aarch64/syscalls/__openat.S b/libc/arch-aarch64/syscalls/__openat.S
new file mode 100644
index 0000000..4a81443
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__openat.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__openat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_openat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__openat)
+.hidden _C_LABEL(__openat)
diff --git a/libc/arch-aarch64/syscalls/__ppoll.S b/libc/arch-aarch64/syscalls/__ppoll.S
new file mode 100644
index 0000000..985a569
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__ppoll.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__ppoll)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_ppoll
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__ppoll)
+.hidden _C_LABEL(__ppoll)
diff --git a/libc/arch-aarch64/syscalls/__pselect6.S b/libc/arch-aarch64/syscalls/__pselect6.S
new file mode 100644
index 0000000..1f38048
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__pselect6.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__pselect6)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_pselect6
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__pselect6)
+.hidden _C_LABEL(__pselect6)
diff --git a/libc/arch-aarch64/syscalls/__ptrace.S b/libc/arch-aarch64/syscalls/__ptrace.S
new file mode 100644
index 0000000..5084dbe
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__ptrace.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__ptrace)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_ptrace
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__ptrace)
+.hidden _C_LABEL(__ptrace)
diff --git a/libc/arch-aarch64/syscalls/__reboot.S b/libc/arch-aarch64/syscalls/__reboot.S
new file mode 100644
index 0000000..80cb855
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__reboot.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__reboot)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_reboot
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__reboot)
+.hidden _C_LABEL(__reboot)
diff --git a/libc/arch-aarch64/syscalls/__rt_sigaction.S b/libc/arch-aarch64/syscalls/__rt_sigaction.S
new file mode 100644
index 0000000..82dc79e
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__rt_sigaction.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__rt_sigaction)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_rt_sigaction
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__rt_sigaction)
+.hidden _C_LABEL(__rt_sigaction)
diff --git a/libc/arch-aarch64/syscalls/__rt_sigpending.S b/libc/arch-aarch64/syscalls/__rt_sigpending.S
new file mode 100644
index 0000000..ace2866
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__rt_sigpending.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__rt_sigpending)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_rt_sigpending
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__rt_sigpending)
+.hidden _C_LABEL(__rt_sigpending)
diff --git a/libc/arch-aarch64/syscalls/__rt_sigprocmask.S b/libc/arch-aarch64/syscalls/__rt_sigprocmask.S
new file mode 100644
index 0000000..31ee86f
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__rt_sigprocmask.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__rt_sigprocmask)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_rt_sigprocmask
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__rt_sigprocmask)
+.hidden _C_LABEL(__rt_sigprocmask)
diff --git a/libc/arch-aarch64/syscalls/__rt_sigsuspend.S b/libc/arch-aarch64/syscalls/__rt_sigsuspend.S
new file mode 100644
index 0000000..58f711c
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__rt_sigsuspend.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__rt_sigsuspend)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_rt_sigsuspend
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__rt_sigsuspend)
+.hidden _C_LABEL(__rt_sigsuspend)
diff --git a/libc/arch-aarch64/syscalls/__rt_sigtimedwait.S b/libc/arch-aarch64/syscalls/__rt_sigtimedwait.S
new file mode 100644
index 0000000..748d81b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__rt_sigtimedwait.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__rt_sigtimedwait)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_rt_sigtimedwait
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__rt_sigtimedwait)
+.hidden _C_LABEL(__rt_sigtimedwait)
diff --git a/libc/arch-aarch64/syscalls/__sched_getaffinity.S b/libc/arch-aarch64/syscalls/__sched_getaffinity.S
new file mode 100644
index 0000000..76c51b0
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__sched_getaffinity.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__sched_getaffinity)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_getaffinity
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__sched_getaffinity)
+.hidden _C_LABEL(__sched_getaffinity)
diff --git a/libc/arch-aarch64/syscalls/__syslog.S b/libc/arch-aarch64/syscalls/__syslog.S
new file mode 100644
index 0000000..379926d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__syslog.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__syslog)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_syslog
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__syslog)
+.hidden _C_LABEL(__syslog)
diff --git a/libc/arch-aarch64/syscalls/__timer_create.S b/libc/arch-aarch64/syscalls/__timer_create.S
new file mode 100644
index 0000000..cebae7a
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__timer_create.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__timer_create)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_timer_create
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__timer_create)
+.hidden _C_LABEL(__timer_create)
diff --git a/libc/arch-aarch64/syscalls/__timer_delete.S b/libc/arch-aarch64/syscalls/__timer_delete.S
new file mode 100644
index 0000000..06a2ca7
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__timer_delete.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__timer_delete)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_timer_delete
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__timer_delete)
+.hidden _C_LABEL(__timer_delete)
diff --git a/libc/arch-aarch64/syscalls/__timer_getoverrun.S b/libc/arch-aarch64/syscalls/__timer_getoverrun.S
new file mode 100644
index 0000000..3e6fbb7
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__timer_getoverrun.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__timer_getoverrun)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_timer_getoverrun
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__timer_getoverrun)
+.hidden _C_LABEL(__timer_getoverrun)
diff --git a/libc/arch-aarch64/syscalls/__timer_gettime.S b/libc/arch-aarch64/syscalls/__timer_gettime.S
new file mode 100644
index 0000000..41cfcfb
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__timer_gettime.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__timer_gettime)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_timer_gettime
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__timer_gettime)
+.hidden _C_LABEL(__timer_gettime)
diff --git a/libc/arch-aarch64/syscalls/__timer_settime.S b/libc/arch-aarch64/syscalls/__timer_settime.S
new file mode 100644
index 0000000..474c98e
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__timer_settime.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__timer_settime)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_timer_settime
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__timer_settime)
+.hidden _C_LABEL(__timer_settime)
diff --git a/libc/arch-aarch64/syscalls/__waitid.S b/libc/arch-aarch64/syscalls/__waitid.S
new file mode 100644
index 0000000..62445ae
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/__waitid.S
@@ -0,0 +1,24 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(__waitid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_waitid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(__waitid)
+.hidden _C_LABEL(__waitid)
diff --git a/libc/arch-aarch64/syscalls/_exit.S b/libc/arch-aarch64/syscalls/_exit.S
new file mode 100644
index 0000000..9f5644a
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/_exit.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(_exit)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_exit_group
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(_exit)
diff --git a/libc/arch-aarch64/syscalls/accept.S b/libc/arch-aarch64/syscalls/accept.S
new file mode 100644
index 0000000..add85c8
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/accept.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(accept)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_accept
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(accept)
diff --git a/libc/arch-aarch64/syscalls/acct.S b/libc/arch-aarch64/syscalls/acct.S
new file mode 100644
index 0000000..ab4b30d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/acct.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(acct)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_acct
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(acct)
diff --git a/libc/arch-aarch64/syscalls/bind.S b/libc/arch-aarch64/syscalls/bind.S
new file mode 100644
index 0000000..28f192b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/bind.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(bind)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_bind
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(bind)
diff --git a/libc/arch-aarch64/syscalls/capget.S b/libc/arch-aarch64/syscalls/capget.S
new file mode 100644
index 0000000..fbe2685
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/capget.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(capget)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_capget
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(capget)
diff --git a/libc/arch-aarch64/syscalls/capset.S b/libc/arch-aarch64/syscalls/capset.S
new file mode 100644
index 0000000..2677b1e
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/capset.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(capset)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_capset
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(capset)
diff --git a/libc/arch-aarch64/syscalls/chdir.S b/libc/arch-aarch64/syscalls/chdir.S
new file mode 100644
index 0000000..5480043
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/chdir.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(chdir)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_chdir
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(chdir)
diff --git a/libc/arch-aarch64/syscalls/chroot.S b/libc/arch-aarch64/syscalls/chroot.S
new file mode 100644
index 0000000..38ed61e
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/chroot.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(chroot)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_chroot
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(chroot)
diff --git a/libc/arch-aarch64/syscalls/clock_getres.S b/libc/arch-aarch64/syscalls/clock_getres.S
new file mode 100644
index 0000000..f142134
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/clock_getres.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(clock_getres)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_clock_getres
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(clock_getres)
diff --git a/libc/arch-aarch64/syscalls/clock_gettime.S b/libc/arch-aarch64/syscalls/clock_gettime.S
new file mode 100644
index 0000000..c7581cd
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/clock_gettime.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(clock_gettime)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_clock_gettime
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(clock_gettime)
diff --git a/libc/arch-aarch64/syscalls/clock_nanosleep.S b/libc/arch-aarch64/syscalls/clock_nanosleep.S
new file mode 100644
index 0000000..b942bcc
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/clock_nanosleep.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(clock_nanosleep)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_clock_nanosleep
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(clock_nanosleep)
diff --git a/libc/arch-aarch64/syscalls/clock_settime.S b/libc/arch-aarch64/syscalls/clock_settime.S
new file mode 100644
index 0000000..ad8b102
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/clock_settime.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(clock_settime)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_clock_settime
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(clock_settime)
diff --git a/libc/arch-aarch64/syscalls/close.S b/libc/arch-aarch64/syscalls/close.S
new file mode 100644
index 0000000..0943cfc
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/close.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(close)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_close
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(close)
diff --git a/libc/arch-aarch64/syscalls/connect.S b/libc/arch-aarch64/syscalls/connect.S
new file mode 100644
index 0000000..4b83c95
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/connect.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(connect)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_connect
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(connect)
diff --git a/libc/arch-aarch64/syscalls/delete_module.S b/libc/arch-aarch64/syscalls/delete_module.S
new file mode 100644
index 0000000..ab471ce
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/delete_module.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(delete_module)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_delete_module
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(delete_module)
diff --git a/libc/arch-aarch64/syscalls/dup.S b/libc/arch-aarch64/syscalls/dup.S
new file mode 100644
index 0000000..1aa9162
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/dup.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(dup)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_dup
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(dup)
diff --git a/libc/arch-aarch64/syscalls/dup3.S b/libc/arch-aarch64/syscalls/dup3.S
new file mode 100644
index 0000000..8bb5925
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/dup3.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(dup3)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_dup3
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(dup3)
diff --git a/libc/arch-aarch64/syscalls/epoll_create1.S b/libc/arch-aarch64/syscalls/epoll_create1.S
new file mode 100644
index 0000000..2f38b5d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/epoll_create1.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(epoll_create1)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_epoll_create1
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(epoll_create1)
diff --git a/libc/arch-aarch64/syscalls/epoll_ctl.S b/libc/arch-aarch64/syscalls/epoll_ctl.S
new file mode 100644
index 0000000..eacf78c
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/epoll_ctl.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(epoll_ctl)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_epoll_ctl
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(epoll_ctl)
diff --git a/libc/arch-aarch64/syscalls/eventfd.S b/libc/arch-aarch64/syscalls/eventfd.S
new file mode 100644
index 0000000..6890b01
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/eventfd.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(eventfd)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_eventfd2
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(eventfd)
diff --git a/libc/arch-aarch64/syscalls/execve.S b/libc/arch-aarch64/syscalls/execve.S
new file mode 100644
index 0000000..63aaece
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/execve.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(execve)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_execve
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(execve)
diff --git a/libc/arch-aarch64/syscalls/faccessat.S b/libc/arch-aarch64/syscalls/faccessat.S
new file mode 100644
index 0000000..20ac348
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/faccessat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(faccessat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_faccessat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(faccessat)
diff --git a/libc/arch-aarch64/syscalls/fchdir.S b/libc/arch-aarch64/syscalls/fchdir.S
new file mode 100644
index 0000000..514b139
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fchdir.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fchdir)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fchdir
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fchdir)
diff --git a/libc/arch-aarch64/syscalls/fchmod.S b/libc/arch-aarch64/syscalls/fchmod.S
new file mode 100644
index 0000000..c5345e3
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fchmod.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fchmod)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fchmod
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fchmod)
diff --git a/libc/arch-aarch64/syscalls/fchmodat.S b/libc/arch-aarch64/syscalls/fchmodat.S
new file mode 100644
index 0000000..02a7f59
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fchmodat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fchmodat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fchmodat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fchmodat)
diff --git a/libc/arch-aarch64/syscalls/fchown.S b/libc/arch-aarch64/syscalls/fchown.S
new file mode 100644
index 0000000..adaf5f4
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fchown.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fchown)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fchown
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fchown)
diff --git a/libc/arch-aarch64/syscalls/fchownat.S b/libc/arch-aarch64/syscalls/fchownat.S
new file mode 100644
index 0000000..2762c6c
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fchownat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fchownat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fchownat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fchownat)
diff --git a/libc/arch-aarch64/syscalls/fcntl.S b/libc/arch-aarch64/syscalls/fcntl.S
new file mode 100644
index 0000000..5c78747
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fcntl.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fcntl)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fcntl
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fcntl)
diff --git a/libc/arch-aarch64/syscalls/fdatasync.S b/libc/arch-aarch64/syscalls/fdatasync.S
new file mode 100644
index 0000000..55fe848
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fdatasync.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fdatasync)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fdatasync
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fdatasync)
diff --git a/libc/arch-aarch64/syscalls/fgetxattr.S b/libc/arch-aarch64/syscalls/fgetxattr.S
new file mode 100644
index 0000000..a73fce9
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fgetxattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fgetxattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fgetxattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fgetxattr)
diff --git a/libc/arch-aarch64/syscalls/flistxattr.S b/libc/arch-aarch64/syscalls/flistxattr.S
new file mode 100644
index 0000000..e52d1fd
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/flistxattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(flistxattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_flistxattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(flistxattr)
diff --git a/libc/arch-aarch64/syscalls/flock.S b/libc/arch-aarch64/syscalls/flock.S
new file mode 100644
index 0000000..091c34b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/flock.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(flock)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_flock
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(flock)
diff --git a/libc/arch-aarch64/syscalls/fremovexattr.S b/libc/arch-aarch64/syscalls/fremovexattr.S
new file mode 100644
index 0000000..3801f2e
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fremovexattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fremovexattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fremovexattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fremovexattr)
diff --git a/libc/arch-aarch64/syscalls/fsetxattr.S b/libc/arch-aarch64/syscalls/fsetxattr.S
new file mode 100644
index 0000000..61170e6
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fsetxattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fsetxattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fsetxattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fsetxattr)
diff --git a/libc/arch-aarch64/syscalls/fstat.S b/libc/arch-aarch64/syscalls/fstat.S
new file mode 100644
index 0000000..09de2e5
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fstat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fstat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fstat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fstat)
diff --git a/libc/arch-aarch64/syscalls/fstatat.S b/libc/arch-aarch64/syscalls/fstatat.S
new file mode 100644
index 0000000..b668a19
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fstatat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fstatat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_newfstatat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fstatat)
diff --git a/libc/arch-aarch64/syscalls/fstatfs.S b/libc/arch-aarch64/syscalls/fstatfs.S
new file mode 100644
index 0000000..4b179e8
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fstatfs.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fstatfs)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fstatfs
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fstatfs)
diff --git a/libc/arch-aarch64/syscalls/fsync.S b/libc/arch-aarch64/syscalls/fsync.S
new file mode 100644
index 0000000..a493f46
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/fsync.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(fsync)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_fsync
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(fsync)
diff --git a/libc/arch-aarch64/syscalls/ftruncate.S b/libc/arch-aarch64/syscalls/ftruncate.S
new file mode 100644
index 0000000..3e578a6
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/ftruncate.S
@@ -0,0 +1,26 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(ftruncate)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_ftruncate
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(ftruncate)
+
+ .globl _C_LABEL(ftruncate64)
+ .equ _C_LABEL(ftruncate64), _C_LABEL(ftruncate)
diff --git a/libc/arch-aarch64/syscalls/futex.S b/libc/arch-aarch64/syscalls/futex.S
new file mode 100644
index 0000000..d014414
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/futex.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(futex)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_futex
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(futex)
diff --git a/libc/arch-aarch64/syscalls/getdents.S b/libc/arch-aarch64/syscalls/getdents.S
new file mode 100644
index 0000000..3af99ce
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getdents.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getdents)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getdents64
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getdents)
diff --git a/libc/arch-aarch64/syscalls/getegid.S b/libc/arch-aarch64/syscalls/getegid.S
new file mode 100644
index 0000000..5c12eb8
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getegid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getegid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getegid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getegid)
diff --git a/libc/arch-aarch64/syscalls/geteuid.S b/libc/arch-aarch64/syscalls/geteuid.S
new file mode 100644
index 0000000..23ccc9a
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/geteuid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(geteuid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_geteuid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(geteuid)
diff --git a/libc/arch-aarch64/syscalls/getgid.S b/libc/arch-aarch64/syscalls/getgid.S
new file mode 100644
index 0000000..21ae633
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getgid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getgid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getgid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getgid)
diff --git a/libc/arch-aarch64/syscalls/getgroups.S b/libc/arch-aarch64/syscalls/getgroups.S
new file mode 100644
index 0000000..3c6987b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getgroups.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getgroups)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getgroups
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getgroups)
diff --git a/libc/arch-aarch64/syscalls/getitimer.S b/libc/arch-aarch64/syscalls/getitimer.S
new file mode 100644
index 0000000..b02ae75
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getitimer.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getitimer)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getitimer
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getitimer)
diff --git a/libc/arch-aarch64/syscalls/getpeername.S b/libc/arch-aarch64/syscalls/getpeername.S
new file mode 100644
index 0000000..2cb4841
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getpeername.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getpeername)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getpeername
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getpeername)
diff --git a/libc/arch-aarch64/syscalls/getpgid.S b/libc/arch-aarch64/syscalls/getpgid.S
new file mode 100644
index 0000000..a75ac5b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getpgid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getpgid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getpgid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getpgid)
diff --git a/libc/arch-aarch64/syscalls/getpid.S b/libc/arch-aarch64/syscalls/getpid.S
new file mode 100644
index 0000000..75835da
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getpid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getpid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getpid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getpid)
diff --git a/libc/arch-aarch64/syscalls/getppid.S b/libc/arch-aarch64/syscalls/getppid.S
new file mode 100644
index 0000000..63f7758
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getppid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getppid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getppid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getppid)
diff --git a/libc/arch-aarch64/syscalls/getresgid.S b/libc/arch-aarch64/syscalls/getresgid.S
new file mode 100644
index 0000000..ec1aefb
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getresgid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getresgid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getresgid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getresgid)
diff --git a/libc/arch-aarch64/syscalls/getresuid.S b/libc/arch-aarch64/syscalls/getresuid.S
new file mode 100644
index 0000000..d0093a4
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getresuid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getresuid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getresuid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getresuid)
diff --git a/libc/arch-aarch64/syscalls/getrlimit.S b/libc/arch-aarch64/syscalls/getrlimit.S
new file mode 100644
index 0000000..713d62c
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getrlimit.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getrlimit)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getrlimit
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getrlimit)
diff --git a/libc/arch-aarch64/syscalls/getrusage.S b/libc/arch-aarch64/syscalls/getrusage.S
new file mode 100644
index 0000000..10a3c1b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getrusage.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getrusage)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getrusage
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getrusage)
diff --git a/libc/arch-aarch64/syscalls/getsid.S b/libc/arch-aarch64/syscalls/getsid.S
new file mode 100644
index 0000000..8ec4dc6
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getsid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getsid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getsid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getsid)
diff --git a/libc/arch-aarch64/syscalls/getsockname.S b/libc/arch-aarch64/syscalls/getsockname.S
new file mode 100644
index 0000000..d14ca67
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getsockname.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getsockname)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getsockname
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getsockname)
diff --git a/libc/arch-aarch64/syscalls/getsockopt.S b/libc/arch-aarch64/syscalls/getsockopt.S
new file mode 100644
index 0000000..ec9257f
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getsockopt.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getsockopt)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getsockopt
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getsockopt)
diff --git a/libc/arch-aarch64/syscalls/gettid.S b/libc/arch-aarch64/syscalls/gettid.S
new file mode 100644
index 0000000..0fe02b6
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/gettid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(gettid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_gettid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(gettid)
diff --git a/libc/arch-aarch64/syscalls/gettimeofday.S b/libc/arch-aarch64/syscalls/gettimeofday.S
new file mode 100644
index 0000000..e131928
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/gettimeofday.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(gettimeofday)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_gettimeofday
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(gettimeofday)
diff --git a/libc/arch-aarch64/syscalls/getuid.S b/libc/arch-aarch64/syscalls/getuid.S
new file mode 100644
index 0000000..9fa6b52
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getuid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getuid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getuid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getuid)
diff --git a/libc/arch-aarch64/syscalls/getxattr.S b/libc/arch-aarch64/syscalls/getxattr.S
new file mode 100644
index 0000000..2e5a303
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/getxattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(getxattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_getxattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(getxattr)
diff --git a/libc/arch-aarch64/syscalls/init_module.S b/libc/arch-aarch64/syscalls/init_module.S
new file mode 100644
index 0000000..79ab90d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/init_module.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(init_module)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_init_module
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(init_module)
diff --git a/libc/arch-aarch64/syscalls/inotify_add_watch.S b/libc/arch-aarch64/syscalls/inotify_add_watch.S
new file mode 100644
index 0000000..0baac5d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/inotify_add_watch.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(inotify_add_watch)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_inotify_add_watch
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(inotify_add_watch)
diff --git a/libc/arch-aarch64/syscalls/inotify_init1.S b/libc/arch-aarch64/syscalls/inotify_init1.S
new file mode 100644
index 0000000..b943136
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/inotify_init1.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(inotify_init1)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_inotify_init1
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(inotify_init1)
diff --git a/libc/arch-aarch64/syscalls/inotify_rm_watch.S b/libc/arch-aarch64/syscalls/inotify_rm_watch.S
new file mode 100644
index 0000000..10c7f56
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/inotify_rm_watch.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(inotify_rm_watch)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_inotify_rm_watch
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(inotify_rm_watch)
diff --git a/libc/arch-aarch64/syscalls/ioprio_get.S b/libc/arch-aarch64/syscalls/ioprio_get.S
new file mode 100644
index 0000000..7bf536b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/ioprio_get.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(ioprio_get)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_ioprio_get
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(ioprio_get)
diff --git a/libc/arch-aarch64/syscalls/ioprio_set.S b/libc/arch-aarch64/syscalls/ioprio_set.S
new file mode 100644
index 0000000..be930b3
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/ioprio_set.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(ioprio_set)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_ioprio_set
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(ioprio_set)
diff --git a/libc/arch-aarch64/syscalls/kill.S b/libc/arch-aarch64/syscalls/kill.S
new file mode 100644
index 0000000..afab1e3
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/kill.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(kill)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_kill
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(kill)
diff --git a/libc/arch-aarch64/syscalls/klogctl.S b/libc/arch-aarch64/syscalls/klogctl.S
new file mode 100644
index 0000000..25fe415
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/klogctl.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(klogctl)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_syslog
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(klogctl)
diff --git a/libc/arch-aarch64/syscalls/lgetxattr.S b/libc/arch-aarch64/syscalls/lgetxattr.S
new file mode 100644
index 0000000..5a2d610
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/lgetxattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(lgetxattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_lgetxattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(lgetxattr)
diff --git a/libc/arch-aarch64/syscalls/linkat.S b/libc/arch-aarch64/syscalls/linkat.S
new file mode 100644
index 0000000..a8fb0fd
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/linkat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(linkat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_linkat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(linkat)
diff --git a/libc/arch-aarch64/syscalls/listen.S b/libc/arch-aarch64/syscalls/listen.S
new file mode 100644
index 0000000..a90faa4
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/listen.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(listen)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_listen
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(listen)
diff --git a/libc/arch-aarch64/syscalls/listxattr.S b/libc/arch-aarch64/syscalls/listxattr.S
new file mode 100644
index 0000000..972a9c4
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/listxattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(listxattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_listxattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(listxattr)
diff --git a/libc/arch-aarch64/syscalls/llistxattr.S b/libc/arch-aarch64/syscalls/llistxattr.S
new file mode 100644
index 0000000..28039d2
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/llistxattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(llistxattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_llistxattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(llistxattr)
diff --git a/libc/arch-aarch64/syscalls/lremovexattr.S b/libc/arch-aarch64/syscalls/lremovexattr.S
new file mode 100644
index 0000000..6ff1a16
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/lremovexattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(lremovexattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_lremovexattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(lremovexattr)
diff --git a/libc/arch-aarch64/syscalls/lseek.S b/libc/arch-aarch64/syscalls/lseek.S
new file mode 100644
index 0000000..f6ffba9
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/lseek.S
@@ -0,0 +1,26 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(lseek)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_lseek
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(lseek)
+
+ .globl _C_LABEL(lseek64)
+ .equ _C_LABEL(lseek64), _C_LABEL(lseek)
diff --git a/libc/arch-aarch64/syscalls/lsetxattr.S b/libc/arch-aarch64/syscalls/lsetxattr.S
new file mode 100644
index 0000000..3be465b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/lsetxattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(lsetxattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_lsetxattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(lsetxattr)
diff --git a/libc/arch-aarch64/syscalls/madvise.S b/libc/arch-aarch64/syscalls/madvise.S
new file mode 100644
index 0000000..7ec3596
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/madvise.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(madvise)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_madvise
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(madvise)
diff --git a/libc/arch-aarch64/syscalls/mincore.S b/libc/arch-aarch64/syscalls/mincore.S
new file mode 100644
index 0000000..9e9befe
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/mincore.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(mincore)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_mincore
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(mincore)
diff --git a/libc/arch-aarch64/syscalls/mkdirat.S b/libc/arch-aarch64/syscalls/mkdirat.S
new file mode 100644
index 0000000..bf1f2ae
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/mkdirat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(mkdirat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_mkdirat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(mkdirat)
diff --git a/libc/arch-aarch64/syscalls/mknodat.S b/libc/arch-aarch64/syscalls/mknodat.S
new file mode 100644
index 0000000..5aa907d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/mknodat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(mknodat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_mknodat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(mknodat)
diff --git a/libc/arch-aarch64/syscalls/mlock.S b/libc/arch-aarch64/syscalls/mlock.S
new file mode 100644
index 0000000..be463e6
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/mlock.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(mlock)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_mlock
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(mlock)
diff --git a/libc/arch-aarch64/syscalls/mlockall.S b/libc/arch-aarch64/syscalls/mlockall.S
new file mode 100644
index 0000000..75d1267
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/mlockall.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(mlockall)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_mlockall
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(mlockall)
diff --git a/libc/arch-aarch64/syscalls/mmap.S b/libc/arch-aarch64/syscalls/mmap.S
new file mode 100644
index 0000000..d5b597b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/mmap.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(mmap)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_mmap
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(mmap)
diff --git a/libc/arch-aarch64/syscalls/mount.S b/libc/arch-aarch64/syscalls/mount.S
new file mode 100644
index 0000000..0dd0b71
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/mount.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(mount)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_mount
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(mount)
diff --git a/libc/arch-aarch64/syscalls/mprotect.S b/libc/arch-aarch64/syscalls/mprotect.S
new file mode 100644
index 0000000..0648c82
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/mprotect.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(mprotect)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_mprotect
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(mprotect)
diff --git a/libc/arch-aarch64/syscalls/mremap.S b/libc/arch-aarch64/syscalls/mremap.S
new file mode 100644
index 0000000..8f94e97
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/mremap.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(mremap)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_mremap
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(mremap)
diff --git a/libc/arch-aarch64/syscalls/msync.S b/libc/arch-aarch64/syscalls/msync.S
new file mode 100644
index 0000000..c11fc55
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/msync.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(msync)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_msync
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(msync)
diff --git a/libc/arch-aarch64/syscalls/munlock.S b/libc/arch-aarch64/syscalls/munlock.S
new file mode 100644
index 0000000..ec21f0d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/munlock.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(munlock)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_munlock
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(munlock)
diff --git a/libc/arch-aarch64/syscalls/munlockall.S b/libc/arch-aarch64/syscalls/munlockall.S
new file mode 100644
index 0000000..a596573
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/munlockall.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(munlockall)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_munlockall
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(munlockall)
diff --git a/libc/arch-aarch64/syscalls/munmap.S b/libc/arch-aarch64/syscalls/munmap.S
new file mode 100644
index 0000000..6f29fa4
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/munmap.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(munmap)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_munmap
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(munmap)
diff --git a/libc/arch-aarch64/syscalls/nanosleep.S b/libc/arch-aarch64/syscalls/nanosleep.S
new file mode 100644
index 0000000..e42b11d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/nanosleep.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(nanosleep)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_nanosleep
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(nanosleep)
diff --git a/libc/arch-aarch64/syscalls/perf_event_open.S b/libc/arch-aarch64/syscalls/perf_event_open.S
new file mode 100644
index 0000000..165746f
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/perf_event_open.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(perf_event_open)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_perf_event_open
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(perf_event_open)
diff --git a/libc/arch-aarch64/syscalls/personality.S b/libc/arch-aarch64/syscalls/personality.S
new file mode 100644
index 0000000..b718852
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/personality.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(personality)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_personality
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(personality)
diff --git a/libc/arch-aarch64/syscalls/pipe2.S b/libc/arch-aarch64/syscalls/pipe2.S
new file mode 100644
index 0000000..8b643c7
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/pipe2.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(pipe2)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_pipe2
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(pipe2)
diff --git a/libc/arch-aarch64/syscalls/prctl.S b/libc/arch-aarch64/syscalls/prctl.S
new file mode 100644
index 0000000..faf2735
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/prctl.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(prctl)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_prctl
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(prctl)
diff --git a/libc/arch-aarch64/syscalls/pread64.S b/libc/arch-aarch64/syscalls/pread64.S
new file mode 100644
index 0000000..82a2fb2
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/pread64.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(pread64)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_pread64
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(pread64)
diff --git a/libc/arch-aarch64/syscalls/pwrite64.S b/libc/arch-aarch64/syscalls/pwrite64.S
new file mode 100644
index 0000000..ab4b502
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/pwrite64.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(pwrite64)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_pwrite64
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(pwrite64)
diff --git a/libc/arch-aarch64/syscalls/read.S b/libc/arch-aarch64/syscalls/read.S
new file mode 100644
index 0000000..475ab72
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/read.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(read)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_read
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(read)
diff --git a/libc/arch-aarch64/syscalls/readahead.S b/libc/arch-aarch64/syscalls/readahead.S
new file mode 100644
index 0000000..eb76fb5
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/readahead.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(readahead)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_readahead
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(readahead)
diff --git a/libc/arch-aarch64/syscalls/readlinkat.S b/libc/arch-aarch64/syscalls/readlinkat.S
new file mode 100644
index 0000000..1ed5495
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/readlinkat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(readlinkat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_readlinkat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(readlinkat)
diff --git a/libc/arch-aarch64/syscalls/readv.S b/libc/arch-aarch64/syscalls/readv.S
new file mode 100644
index 0000000..7279a4c
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/readv.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(readv)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_readv
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(readv)
diff --git a/libc/arch-aarch64/syscalls/recvfrom.S b/libc/arch-aarch64/syscalls/recvfrom.S
new file mode 100644
index 0000000..b0759a8
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/recvfrom.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(recvfrom)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_recvfrom
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(recvfrom)
diff --git a/libc/arch-aarch64/syscalls/recvmsg.S b/libc/arch-aarch64/syscalls/recvmsg.S
new file mode 100644
index 0000000..b40d927
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/recvmsg.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(recvmsg)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_recvmsg
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(recvmsg)
diff --git a/libc/arch-aarch64/syscalls/removexattr.S b/libc/arch-aarch64/syscalls/removexattr.S
new file mode 100644
index 0000000..3394cc6
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/removexattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(removexattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_removexattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(removexattr)
diff --git a/libc/arch-aarch64/syscalls/renameat.S b/libc/arch-aarch64/syscalls/renameat.S
new file mode 100644
index 0000000..567c75a
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/renameat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(renameat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_renameat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(renameat)
diff --git a/libc/arch-aarch64/syscalls/sched_get_priority_max.S b/libc/arch-aarch64/syscalls/sched_get_priority_max.S
new file mode 100644
index 0000000..2e34080
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sched_get_priority_max.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sched_get_priority_max)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_get_priority_max
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sched_get_priority_max)
diff --git a/libc/arch-aarch64/syscalls/sched_get_priority_min.S b/libc/arch-aarch64/syscalls/sched_get_priority_min.S
new file mode 100644
index 0000000..3347aa5
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sched_get_priority_min.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sched_get_priority_min)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_get_priority_min
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sched_get_priority_min)
diff --git a/libc/arch-aarch64/syscalls/sched_getparam.S b/libc/arch-aarch64/syscalls/sched_getparam.S
new file mode 100644
index 0000000..723a131
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sched_getparam.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sched_getparam)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_getparam
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sched_getparam)
diff --git a/libc/arch-aarch64/syscalls/sched_getscheduler.S b/libc/arch-aarch64/syscalls/sched_getscheduler.S
new file mode 100644
index 0000000..fbaddc7
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sched_getscheduler.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sched_getscheduler)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_getscheduler
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sched_getscheduler)
diff --git a/libc/arch-aarch64/syscalls/sched_rr_get_interval.S b/libc/arch-aarch64/syscalls/sched_rr_get_interval.S
new file mode 100644
index 0000000..e2a4952
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sched_rr_get_interval.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sched_rr_get_interval)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_rr_get_interval
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sched_rr_get_interval)
diff --git a/libc/arch-aarch64/syscalls/sched_setaffinity.S b/libc/arch-aarch64/syscalls/sched_setaffinity.S
new file mode 100644
index 0000000..7c1aec7
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sched_setaffinity.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sched_setaffinity)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_setaffinity
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sched_setaffinity)
diff --git a/libc/arch-aarch64/syscalls/sched_setparam.S b/libc/arch-aarch64/syscalls/sched_setparam.S
new file mode 100644
index 0000000..309a07d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sched_setparam.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sched_setparam)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_setparam
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sched_setparam)
diff --git a/libc/arch-aarch64/syscalls/sched_setscheduler.S b/libc/arch-aarch64/syscalls/sched_setscheduler.S
new file mode 100644
index 0000000..8a6d6fe
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sched_setscheduler.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sched_setscheduler)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_setscheduler
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sched_setscheduler)
diff --git a/libc/arch-aarch64/syscalls/sched_yield.S b/libc/arch-aarch64/syscalls/sched_yield.S
new file mode 100644
index 0000000..a61979a
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sched_yield.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sched_yield)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sched_yield
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sched_yield)
diff --git a/libc/arch-aarch64/syscalls/sendfile.S b/libc/arch-aarch64/syscalls/sendfile.S
new file mode 100644
index 0000000..9ae7a9a
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sendfile.S
@@ -0,0 +1,26 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sendfile)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sendfile
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sendfile)
+
+ .globl _C_LABEL(sendfile64)
+ .equ _C_LABEL(sendfile64), _C_LABEL(sendfile)
diff --git a/libc/arch-aarch64/syscalls/sendmsg.S b/libc/arch-aarch64/syscalls/sendmsg.S
new file mode 100644
index 0000000..bd33724
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sendmsg.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sendmsg)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sendmsg
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sendmsg)
diff --git a/libc/arch-aarch64/syscalls/sendto.S b/libc/arch-aarch64/syscalls/sendto.S
new file mode 100644
index 0000000..44887e0
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sendto.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sendto)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sendto
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sendto)
diff --git a/libc/arch-aarch64/syscalls/setgid.S b/libc/arch-aarch64/syscalls/setgid.S
new file mode 100644
index 0000000..fb78157
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setgid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setgid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setgid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setgid)
diff --git a/libc/arch-aarch64/syscalls/setgroups.S b/libc/arch-aarch64/syscalls/setgroups.S
new file mode 100644
index 0000000..81d2b19
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setgroups.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setgroups)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setgroups
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setgroups)
diff --git a/libc/arch-aarch64/syscalls/setitimer.S b/libc/arch-aarch64/syscalls/setitimer.S
new file mode 100644
index 0000000..aa0c0c2
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setitimer.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setitimer)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setitimer
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setitimer)
diff --git a/libc/arch-aarch64/syscalls/setpgid.S b/libc/arch-aarch64/syscalls/setpgid.S
new file mode 100644
index 0000000..6d14cd9
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setpgid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setpgid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setpgid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setpgid)
diff --git a/libc/arch-aarch64/syscalls/setpriority.S b/libc/arch-aarch64/syscalls/setpriority.S
new file mode 100644
index 0000000..47da6b4
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setpriority.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setpriority)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setpriority
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setpriority)
diff --git a/libc/arch-aarch64/syscalls/setregid.S b/libc/arch-aarch64/syscalls/setregid.S
new file mode 100644
index 0000000..d3e0f4b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setregid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setregid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setregid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setregid)
diff --git a/libc/arch-aarch64/syscalls/setresgid.S b/libc/arch-aarch64/syscalls/setresgid.S
new file mode 100644
index 0000000..720b721
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setresgid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setresgid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setresgid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setresgid)
diff --git a/libc/arch-aarch64/syscalls/setresuid.S b/libc/arch-aarch64/syscalls/setresuid.S
new file mode 100644
index 0000000..e2eb626
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setresuid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setresuid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setresuid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setresuid)
diff --git a/libc/arch-aarch64/syscalls/setreuid.S b/libc/arch-aarch64/syscalls/setreuid.S
new file mode 100644
index 0000000..dc66ce8
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setreuid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setreuid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setreuid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setreuid)
diff --git a/libc/arch-aarch64/syscalls/setrlimit.S b/libc/arch-aarch64/syscalls/setrlimit.S
new file mode 100644
index 0000000..57358ac
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setrlimit.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setrlimit)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setrlimit
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setrlimit)
diff --git a/libc/arch-aarch64/syscalls/setsid.S b/libc/arch-aarch64/syscalls/setsid.S
new file mode 100644
index 0000000..26d003a
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setsid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setsid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setsid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setsid)
diff --git a/libc/arch-aarch64/syscalls/setsockopt.S b/libc/arch-aarch64/syscalls/setsockopt.S
new file mode 100644
index 0000000..d11f96b
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setsockopt.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setsockopt)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setsockopt
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setsockopt)
diff --git a/libc/arch-aarch64/syscalls/settimeofday.S b/libc/arch-aarch64/syscalls/settimeofday.S
new file mode 100644
index 0000000..180436d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/settimeofday.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(settimeofday)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_settimeofday
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(settimeofday)
diff --git a/libc/arch-aarch64/syscalls/setuid.S b/libc/arch-aarch64/syscalls/setuid.S
new file mode 100644
index 0000000..7fafb4e
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setuid.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setuid)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setuid
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setuid)
diff --git a/libc/arch-aarch64/syscalls/setxattr.S b/libc/arch-aarch64/syscalls/setxattr.S
new file mode 100644
index 0000000..40ad28f
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/setxattr.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(setxattr)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_setxattr
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(setxattr)
diff --git a/libc/arch-aarch64/syscalls/shutdown.S b/libc/arch-aarch64/syscalls/shutdown.S
new file mode 100644
index 0000000..8136861
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/shutdown.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(shutdown)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_shutdown
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(shutdown)
diff --git a/libc/arch-aarch64/syscalls/sigaltstack.S b/libc/arch-aarch64/syscalls/sigaltstack.S
new file mode 100644
index 0000000..62a9fb9
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sigaltstack.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sigaltstack)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sigaltstack
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sigaltstack)
diff --git a/libc/arch-aarch64/syscalls/signalfd4.S b/libc/arch-aarch64/syscalls/signalfd4.S
new file mode 100644
index 0000000..83644b8
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/signalfd4.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(signalfd4)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_signalfd4
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(signalfd4)
diff --git a/libc/arch-aarch64/syscalls/socket.S b/libc/arch-aarch64/syscalls/socket.S
new file mode 100644
index 0000000..29e2299
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/socket.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(socket)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_socket
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(socket)
diff --git a/libc/arch-aarch64/syscalls/socketpair.S b/libc/arch-aarch64/syscalls/socketpair.S
new file mode 100644
index 0000000..6e985c0
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/socketpair.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(socketpair)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_socketpair
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(socketpair)
diff --git a/libc/arch-aarch64/syscalls/statfs.S b/libc/arch-aarch64/syscalls/statfs.S
new file mode 100644
index 0000000..1647e60
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/statfs.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(statfs)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_statfs
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(statfs)
diff --git a/libc/arch-aarch64/syscalls/swapoff.S b/libc/arch-aarch64/syscalls/swapoff.S
new file mode 100644
index 0000000..60f9927
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/swapoff.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(swapoff)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_swapoff
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(swapoff)
diff --git a/libc/arch-aarch64/syscalls/swapon.S b/libc/arch-aarch64/syscalls/swapon.S
new file mode 100644
index 0000000..176ff58
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/swapon.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(swapon)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_swapon
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(swapon)
diff --git a/libc/arch-aarch64/syscalls/symlinkat.S b/libc/arch-aarch64/syscalls/symlinkat.S
new file mode 100644
index 0000000..1e3c7f9
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/symlinkat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(symlinkat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_symlinkat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(symlinkat)
diff --git a/libc/arch-aarch64/syscalls/sync.S b/libc/arch-aarch64/syscalls/sync.S
new file mode 100644
index 0000000..24b5690
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sync.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sync)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sync
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sync)
diff --git a/libc/arch-aarch64/syscalls/sysinfo.S b/libc/arch-aarch64/syscalls/sysinfo.S
new file mode 100644
index 0000000..0bae446
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/sysinfo.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(sysinfo)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_sysinfo
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(sysinfo)
diff --git a/libc/arch-aarch64/syscalls/tgkill.S b/libc/arch-aarch64/syscalls/tgkill.S
new file mode 100644
index 0000000..1c382b2
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/tgkill.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(tgkill)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_tgkill
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(tgkill)
diff --git a/libc/arch-aarch64/syscalls/timerfd_create.S b/libc/arch-aarch64/syscalls/timerfd_create.S
new file mode 100644
index 0000000..a1cd44e
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/timerfd_create.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(timerfd_create)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_timerfd_create
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(timerfd_create)
diff --git a/libc/arch-aarch64/syscalls/timerfd_gettime.S b/libc/arch-aarch64/syscalls/timerfd_gettime.S
new file mode 100644
index 0000000..c8c213d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/timerfd_gettime.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(timerfd_gettime)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_timerfd_gettime
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(timerfd_gettime)
diff --git a/libc/arch-aarch64/syscalls/timerfd_settime.S b/libc/arch-aarch64/syscalls/timerfd_settime.S
new file mode 100644
index 0000000..6963a09
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/timerfd_settime.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(timerfd_settime)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_timerfd_settime
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(timerfd_settime)
diff --git a/libc/arch-aarch64/syscalls/times.S b/libc/arch-aarch64/syscalls/times.S
new file mode 100644
index 0000000..dfd7db1
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/times.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(times)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_times
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(times)
diff --git a/libc/arch-aarch64/syscalls/tkill.S b/libc/arch-aarch64/syscalls/tkill.S
new file mode 100644
index 0000000..7e5e5bb
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/tkill.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(tkill)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_tkill
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(tkill)
diff --git a/libc/arch-aarch64/syscalls/truncate.S b/libc/arch-aarch64/syscalls/truncate.S
new file mode 100644
index 0000000..db5a2f3
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/truncate.S
@@ -0,0 +1,26 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(truncate)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_truncate
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(truncate)
+
+ .globl _C_LABEL(truncate64)
+ .equ _C_LABEL(truncate64), _C_LABEL(truncate)
diff --git a/libc/arch-aarch64/syscalls/umask.S b/libc/arch-aarch64/syscalls/umask.S
new file mode 100644
index 0000000..16d48ac
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/umask.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(umask)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_umask
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(umask)
diff --git a/libc/arch-aarch64/syscalls/umount2.S b/libc/arch-aarch64/syscalls/umount2.S
new file mode 100644
index 0000000..0079e6d
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/umount2.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(umount2)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_umount2
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(umount2)
diff --git a/libc/arch-aarch64/syscalls/uname.S b/libc/arch-aarch64/syscalls/uname.S
new file mode 100644
index 0000000..36b5cc8
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/uname.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(uname)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_uname
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(uname)
diff --git a/libc/arch-aarch64/syscalls/unlinkat.S b/libc/arch-aarch64/syscalls/unlinkat.S
new file mode 100644
index 0000000..3a7c78f
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/unlinkat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(unlinkat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_unlinkat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(unlinkat)
diff --git a/libc/arch-aarch64/syscalls/unshare.S b/libc/arch-aarch64/syscalls/unshare.S
new file mode 100644
index 0000000..c69c7da
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/unshare.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(unshare)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_unshare
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(unshare)
diff --git a/libc/arch-aarch64/syscalls/utimensat.S b/libc/arch-aarch64/syscalls/utimensat.S
new file mode 100644
index 0000000..83f1141
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/utimensat.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(utimensat)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_utimensat
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(utimensat)
diff --git a/libc/arch-aarch64/syscalls/wait4.S b/libc/arch-aarch64/syscalls/wait4.S
new file mode 100644
index 0000000..cf723b3
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/wait4.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(wait4)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_wait4
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(wait4)
diff --git a/libc/arch-aarch64/syscalls/write.S b/libc/arch-aarch64/syscalls/write.S
new file mode 100644
index 0000000..15b17c8
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/write.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(write)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_write
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(write)
diff --git a/libc/arch-aarch64/syscalls/writev.S b/libc/arch-aarch64/syscalls/writev.S
new file mode 100644
index 0000000..fe802af
--- /dev/null
+++ b/libc/arch-aarch64/syscalls/writev.S
@@ -0,0 +1,23 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <asm/unistd.h>
+#include <linux/err.h>
+#include <machine/asm.h>
+
+ENTRY(writev)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, __NR_writev
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(writev)
diff --git a/libc/include/sys/exec_elf.h b/libc/include/sys/exec_elf.h
index e3aa52a..3c1467c 100644
--- a/libc/include/sys/exec_elf.h
+++ b/libc/include/sys/exec_elf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_elf.h,v 1.130 2013/10/28 21:36:43 matt Exp $ */
+/* $NetBSD: exec_elf.h,v 1.131 2013/10/29 00:22:59 christos Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -301,6 +301,7 @@
#define EM_SEP 108 /* Sharp embedded microprocessor */
#define EM_ARCA 109 /* Arca RISC microprocessor */
#define EM_UNICORE 110 /* UNICORE from PKU-Unity Ltd. and MPRC Peking University */
+#define EM_AARCH64 183 /* AArch64 64-bit ARM microprocessor */
/* Unofficial machine types follow */
#define EM_AVR32 6317 /* used by NetBSD/avr32 */
diff --git a/libc/include/sys/glibc-syscalls.h b/libc/include/sys/glibc-syscalls.h
index 20ae14b..3683533 100644
--- a/libc/include/sys/glibc-syscalls.h
+++ b/libc/include/sys/glibc-syscalls.h
@@ -1,7 +1,324 @@
/* Generated by gensyscalls.py. Do not edit. */
#ifndef _BIONIC_GLIBC_SYSCALLS_H_
#define _BIONIC_GLIBC_SYSCALLS_H_
-#if defined(__arm__)
+#if defined(__aarch64__)
+#define SYS_accept __NR_accept
+#define SYS_accept4 __NR_accept4
+#define SYS_access __NR_access
+#define SYS_acct __NR_acct
+#define SYS_add_key __NR_add_key
+#define SYS_adjtimex __NR_adjtimex
+#define SYS_alarm __NR_alarm
+#define SYS_arch_specific_syscall __NR_arch_specific_syscall
+#define SYS_bdflush __NR_bdflush
+#define SYS_bind __NR_bind
+#define SYS_brk __NR_brk
+#define SYS_capget __NR_capget
+#define SYS_capset __NR_capset
+#define SYS_chdir __NR_chdir
+#define SYS_chmod __NR_chmod
+#define SYS_chown __NR_chown
+#define SYS_chroot __NR_chroot
+#define SYS_clock_adjtime __NR_clock_adjtime
+#define SYS_clock_getres __NR_clock_getres
+#define SYS_clock_gettime __NR_clock_gettime
+#define SYS_clock_nanosleep __NR_clock_nanosleep
+#define SYS_clock_settime __NR_clock_settime
+#define SYS_clone __NR_clone
+#define SYS_close __NR_close
+#define SYS_connect __NR_connect
+#define SYS_creat __NR_creat
+#define SYS_delete_module __NR_delete_module
+#define SYS_dup __NR_dup
+#define SYS_dup2 __NR_dup2
+#define SYS_dup3 __NR_dup3
+#define SYS_epoll_create __NR_epoll_create
+#define SYS_epoll_create1 __NR_epoll_create1
+#define SYS_epoll_ctl __NR_epoll_ctl
+#define SYS_epoll_pwait __NR_epoll_pwait
+#define SYS_epoll_wait __NR_epoll_wait
+#define SYS_eventfd __NR_eventfd
+#define SYS_eventfd2 __NR_eventfd2
+#define SYS_execve __NR_execve
+#define SYS_exit __NR_exit
+#define SYS_exit_group __NR_exit_group
+#define SYS_faccessat __NR_faccessat
+#define SYS_fadvise64 __NR_fadvise64
+#define SYS_fadvise64_64 __NR_fadvise64_64
+#define SYS_fallocate __NR_fallocate
+#define SYS_fanotify_init __NR_fanotify_init
+#define SYS_fanotify_mark __NR_fanotify_mark
+#define SYS_fchdir __NR_fchdir
+#define SYS_fchmod __NR_fchmod
+#define SYS_fchmodat __NR_fchmodat
+#define SYS_fchown __NR_fchown
+#define SYS_fchownat __NR_fchownat
+#define SYS_fcntl __NR_fcntl
+#define SYS_fcntl64 __NR_fcntl64
+#define SYS_fdatasync __NR_fdatasync
+#define SYS_fgetxattr __NR_fgetxattr
+#define SYS_finit_module __NR_finit_module
+#define SYS_flistxattr __NR_flistxattr
+#define SYS_flock __NR_flock
+#define SYS_fork __NR_fork
+#define SYS_fremovexattr __NR_fremovexattr
+#define SYS_fsetxattr __NR_fsetxattr
+#define SYS_fstat __NR_fstat
+#define SYS_fstat64 __NR_fstat64
+#define SYS_fstatat64 __NR_fstatat64
+#define SYS_fstatfs __NR_fstatfs
+#define SYS_fstatfs64 __NR_fstatfs64
+#define SYS_fsync __NR_fsync
+#define SYS_ftruncate __NR_ftruncate
+#define SYS_ftruncate64 __NR_ftruncate64
+#define SYS_futex __NR_futex
+#define SYS_futimesat __NR_futimesat
+#define SYS_get_mempolicy __NR_get_mempolicy
+#define SYS_get_robust_list __NR_get_robust_list
+#define SYS_getcpu __NR_getcpu
+#define SYS_getcwd __NR_getcwd
+#define SYS_getdents __NR_getdents
+#define SYS_getdents64 __NR_getdents64
+#define SYS_getegid __NR_getegid
+#define SYS_geteuid __NR_geteuid
+#define SYS_getgid __NR_getgid
+#define SYS_getgroups __NR_getgroups
+#define SYS_getitimer __NR_getitimer
+#define SYS_getpeername __NR_getpeername
+#define SYS_getpgid __NR_getpgid
+#define SYS_getpgrp __NR_getpgrp
+#define SYS_getpid __NR_getpid
+#define SYS_getppid __NR_getppid
+#define SYS_getpriority __NR_getpriority
+#define SYS_getresgid __NR_getresgid
+#define SYS_getresuid __NR_getresuid
+#define SYS_getrlimit __NR_getrlimit
+#define SYS_getrusage __NR_getrusage
+#define SYS_getsid __NR_getsid
+#define SYS_getsockname __NR_getsockname
+#define SYS_getsockopt __NR_getsockopt
+#define SYS_gettid __NR_gettid
+#define SYS_gettimeofday __NR_gettimeofday
+#define SYS_getuid __NR_getuid
+#define SYS_getxattr __NR_getxattr
+#define SYS_init_module __NR_init_module
+#define SYS_inotify_add_watch __NR_inotify_add_watch
+#define SYS_inotify_init __NR_inotify_init
+#define SYS_inotify_init1 __NR_inotify_init1
+#define SYS_inotify_rm_watch __NR_inotify_rm_watch
+#define SYS_io_cancel __NR_io_cancel
+#define SYS_io_destroy __NR_io_destroy
+#define SYS_io_getevents __NR_io_getevents
+#define SYS_io_setup __NR_io_setup
+#define SYS_io_submit __NR_io_submit
+#define SYS_ioctl __NR_ioctl
+#define SYS_ioprio_get __NR_ioprio_get
+#define SYS_ioprio_set __NR_ioprio_set
+#define SYS_kcmp __NR_kcmp
+#define SYS_kexec_load __NR_kexec_load
+#define SYS_keyctl __NR_keyctl
+#define SYS_kill __NR_kill
+#define SYS_lchown __NR_lchown
+#define SYS_lgetxattr __NR_lgetxattr
+#define SYS_link __NR_link
+#define SYS_linkat __NR_linkat
+#define SYS_listen __NR_listen
+#define SYS_listxattr __NR_listxattr
+#define SYS_llistxattr __NR_llistxattr
+#define SYS_llseek __NR_llseek
+#define SYS_lookup_dcookie __NR_lookup_dcookie
+#define SYS_lremovexattr __NR_lremovexattr
+#define SYS_lseek __NR_lseek
+#define SYS_lsetxattr __NR_lsetxattr
+#define SYS_lstat __NR_lstat
+#define SYS_lstat64 __NR_lstat64
+#define SYS_madvise __NR_madvise
+#define SYS_mbind __NR_mbind
+#define SYS_migrate_pages __NR_migrate_pages
+#define SYS_mincore __NR_mincore
+#define SYS_mkdir __NR_mkdir
+#define SYS_mkdirat __NR_mkdirat
+#define SYS_mknod __NR_mknod
+#define SYS_mknodat __NR_mknodat
+#define SYS_mlock __NR_mlock
+#define SYS_mlockall __NR_mlockall
+#define SYS_mmap __NR_mmap
+#define SYS_mmap2 __NR_mmap2
+#define SYS_mount __NR_mount
+#define SYS_move_pages __NR_move_pages
+#define SYS_mprotect __NR_mprotect
+#define SYS_mq_getsetattr __NR_mq_getsetattr
+#define SYS_mq_notify __NR_mq_notify
+#define SYS_mq_open __NR_mq_open
+#define SYS_mq_timedreceive __NR_mq_timedreceive
+#define SYS_mq_timedsend __NR_mq_timedsend
+#define SYS_mq_unlink __NR_mq_unlink
+#define SYS_mremap __NR_mremap
+#define SYS_msgctl __NR_msgctl
+#define SYS_msgget __NR_msgget
+#define SYS_msgrcv __NR_msgrcv
+#define SYS_msgsnd __NR_msgsnd
+#define SYS_msync __NR_msync
+#define SYS_munlock __NR_munlock
+#define SYS_munlockall __NR_munlockall
+#define SYS_munmap __NR_munmap
+#define SYS_name_to_handle_at __NR_name_to_handle_at
+#define SYS_nanosleep __NR_nanosleep
+#define SYS_newfstatat __NR_newfstatat
+#define SYS_nfsservctl __NR_nfsservctl
+#define SYS_oldwait4 __NR_oldwait4
+#define SYS_open __NR_open
+#define SYS_open_by_handle_at __NR_open_by_handle_at
+#define SYS_openat __NR_openat
+#define SYS_pause __NR_pause
+#define SYS_perf_event_open __NR_perf_event_open
+#define SYS_personality __NR_personality
+#define SYS_pipe __NR_pipe
+#define SYS_pipe2 __NR_pipe2
+#define SYS_pivot_root __NR_pivot_root
+#define SYS_poll __NR_poll
+#define SYS_ppoll __NR_ppoll
+#define SYS_prctl __NR_prctl
+#define SYS_pread64 __NR_pread64
+#define SYS_preadv __NR_preadv
+#define SYS_prlimit64 __NR_prlimit64
+#define SYS_process_vm_readv __NR_process_vm_readv
+#define SYS_process_vm_writev __NR_process_vm_writev
+#define SYS_pselect6 __NR_pselect6
+#define SYS_ptrace __NR_ptrace
+#define SYS_pwrite64 __NR_pwrite64
+#define SYS_pwritev __NR_pwritev
+#define SYS_quotactl __NR_quotactl
+#define SYS_read __NR_read
+#define SYS_readahead __NR_readahead
+#define SYS_readlink __NR_readlink
+#define SYS_readlinkat __NR_readlinkat
+#define SYS_readv __NR_readv
+#define SYS_reboot __NR_reboot
+#define SYS_recv __NR_recv
+#define SYS_recvfrom __NR_recvfrom
+#define SYS_recvmmsg __NR_recvmmsg
+#define SYS_recvmsg __NR_recvmsg
+#define SYS_remap_file_pages __NR_remap_file_pages
+#define SYS_removexattr __NR_removexattr
+#define SYS_rename __NR_rename
+#define SYS_renameat __NR_renameat
+#define SYS_request_key __NR_request_key
+#define SYS_restart_syscall __NR_restart_syscall
+#define SYS_rmdir __NR_rmdir
+#define SYS_rt_sigaction __NR_rt_sigaction
+#define SYS_rt_sigpending __NR_rt_sigpending
+#define SYS_rt_sigprocmask __NR_rt_sigprocmask
+#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
+#define SYS_rt_sigreturn __NR_rt_sigreturn
+#define SYS_rt_sigsuspend __NR_rt_sigsuspend
+#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
+#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
+#define SYS_sched_get_priority_max __NR_sched_get_priority_max
+#define SYS_sched_get_priority_min __NR_sched_get_priority_min
+#define SYS_sched_getaffinity __NR_sched_getaffinity
+#define SYS_sched_getparam __NR_sched_getparam
+#define SYS_sched_getscheduler __NR_sched_getscheduler
+#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
+#define SYS_sched_setaffinity __NR_sched_setaffinity
+#define SYS_sched_setparam __NR_sched_setparam
+#define SYS_sched_setscheduler __NR_sched_setscheduler
+#define SYS_sched_yield __NR_sched_yield
+#define SYS_select __NR_select
+#define SYS_semctl __NR_semctl
+#define SYS_semget __NR_semget
+#define SYS_semop __NR_semop
+#define SYS_semtimedop __NR_semtimedop
+#define SYS_send __NR_send
+#define SYS_sendfile __NR_sendfile
+#define SYS_sendfile64 __NR_sendfile64
+#define SYS_sendmmsg __NR_sendmmsg
+#define SYS_sendmsg __NR_sendmsg
+#define SYS_sendto __NR_sendto
+#define SYS_set_mempolicy __NR_set_mempolicy
+#define SYS_set_robust_list __NR_set_robust_list
+#define SYS_set_tid_address __NR_set_tid_address
+#define SYS_setdomainname __NR_setdomainname
+#define SYS_setfsgid __NR_setfsgid
+#define SYS_setfsuid __NR_setfsuid
+#define SYS_setgid __NR_setgid
+#define SYS_setgroups __NR_setgroups
+#define SYS_sethostname __NR_sethostname
+#define SYS_setitimer __NR_setitimer
+#define SYS_setns __NR_setns
+#define SYS_setpgid __NR_setpgid
+#define SYS_setpriority __NR_setpriority
+#define SYS_setregid __NR_setregid
+#define SYS_setresgid __NR_setresgid
+#define SYS_setresuid __NR_setresuid
+#define SYS_setreuid __NR_setreuid
+#define SYS_setrlimit __NR_setrlimit
+#define SYS_setsid __NR_setsid
+#define SYS_setsockopt __NR_setsockopt
+#define SYS_settimeofday __NR_settimeofday
+#define SYS_setuid __NR_setuid
+#define SYS_setxattr __NR_setxattr
+#define SYS_shmat __NR_shmat
+#define SYS_shmctl __NR_shmctl
+#define SYS_shmdt __NR_shmdt
+#define SYS_shmget __NR_shmget
+#define SYS_shutdown __NR_shutdown
+#define SYS_sigaltstack __NR_sigaltstack
+#define SYS_signalfd __NR_signalfd
+#define SYS_signalfd4 __NR_signalfd4
+#define SYS_socket __NR_socket
+#define SYS_socketpair __NR_socketpair
+#define SYS_splice __NR_splice
+#define SYS_stat __NR_stat
+#define SYS_stat64 __NR_stat64
+#define SYS_statfs __NR_statfs
+#define SYS_statfs64 __NR_statfs64
+#define SYS_swapoff __NR_swapoff
+#define SYS_swapon __NR_swapon
+#define SYS_symlink __NR_symlink
+#define SYS_symlinkat __NR_symlinkat
+#define SYS_sync __NR_sync
+#define SYS_sync_file_range __NR_sync_file_range
+#define SYS_sync_file_range2 __NR_sync_file_range2
+#define SYS_syncfs __NR_syncfs
+#define SYS_syscalls __NR_syscalls
+#define SYS_sysinfo __NR_sysinfo
+#define SYS_syslog __NR_syslog
+#define SYS_tee __NR_tee
+#define SYS_tgkill __NR_tgkill
+#define SYS_time __NR_time
+#define SYS_timer_create __NR_timer_create
+#define SYS_timer_delete __NR_timer_delete
+#define SYS_timer_getoverrun __NR_timer_getoverrun
+#define SYS_timer_gettime __NR_timer_gettime
+#define SYS_timer_settime __NR_timer_settime
+#define SYS_timerfd_create __NR_timerfd_create
+#define SYS_timerfd_gettime __NR_timerfd_gettime
+#define SYS_timerfd_settime __NR_timerfd_settime
+#define SYS_times __NR_times
+#define SYS_tkill __NR_tkill
+#define SYS_truncate __NR_truncate
+#define SYS_truncate64 __NR_truncate64
+#define SYS_umask __NR_umask
+#define SYS_umount __NR_umount
+#define SYS_umount2 __NR_umount2
+#define SYS_uname __NR_uname
+#define SYS_unlink __NR_unlink
+#define SYS_unlinkat __NR_unlinkat
+#define SYS_unshare __NR_unshare
+#define SYS_uselib __NR_uselib
+#define SYS_ustat __NR_ustat
+#define SYS_utime __NR_utime
+#define SYS_utimensat __NR_utimensat
+#define SYS_utimes __NR_utimes
+#define SYS_vfork __NR_vfork
+#define SYS_vhangup __NR_vhangup
+#define SYS_vmsplice __NR_vmsplice
+#define SYS_wait4 __NR_wait4
+#define SYS_waitid __NR_waitid
+#define SYS_write __NR_write
+#define SYS_writev __NR_writev
+#elif defined(__arm__)
#define SYS_accept __NR_accept
#define SYS_accept4 __NR_accept4
#define SYS_access __NR_access
diff --git a/libc/stdlib/strtod.c b/libc/stdlib/strtod.c
index ab637a1..3934d9a 100644
--- a/libc/stdlib/strtod.c
+++ b/libc/stdlib/strtod.c
@@ -107,7 +107,7 @@
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
defined(__powerpc__) || defined(__sh__) || defined(__x86_64__) || \
defined(__hppa__) || \
- (defined(__arm__) && defined(__VFP_FP__))
+ (defined(__arm__) && defined(__VFP_FP__)) || defined(__aarch64__)
#include <endian.h>
#if BYTE_ORDER == BIG_ENDIAN
#define IEEE_BIG_ENDIAN
diff --git a/libc/tools/bionic_utils.py b/libc/tools/bionic_utils.py
index f8d8897..39dc76a 100644
--- a/libc/tools/bionic_utils.py
+++ b/libc/tools/bionic_utils.py
@@ -2,7 +2,7 @@
import sys, os, commands, string
-all_arches = [ "arm", "mips", "x86", "x86_64" ]
+all_arches = [ "aarch64", "arm", "mips", "x86", "x86_64" ]
# basic debugging trace support
# call D_setlevel to set the verbosity level
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index 5595cd7..bf44b70 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -56,6 +56,29 @@
#
+# AArch64 assembler templates for each syscall stub
+#
+
+aarch64_call = syscall_stub_header + """\
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ str x8, [sp, #-16]!
+
+ mov x8, %(__NR_name)s
+ svc #0
+
+ ldr x8, [sp], #16
+ ldp x29, x30, [sp], #16
+
+ cmn x0, #(MAX_ERRNO + 1)
+ cneg x0, x0, hi
+ b.hi __set_errno
+
+ ret
+END(%(func)s)
+"""
+
+#
# ARM assembler templates for each syscall stub
#
@@ -246,6 +269,10 @@
return stub
+def aarch64_genstub(syscall):
+ return aarch64_call % syscall
+
+
def arm_eabi_genstub(syscall):
num_regs = count_arm_param_registers(syscall["params"])
if num_regs > 4:
@@ -277,6 +304,7 @@
result += x86_return % syscall
return result
+
def x86_genstub_socketcall(syscall):
# %ebx <--- Argument 1 - The call id of the needed vectored
# syscall (socket, bind, recv, etc)
@@ -339,6 +367,9 @@
for syscall in self.syscalls:
syscall["__NR_name"] = make__NR_name(syscall["name"])
+ if syscall.has_key("aarch64"):
+ syscall["asm-aarch64"] = add_footer(64, aarch64_genstub(syscall), syscall)
+
if syscall.has_key("arm"):
syscall["asm-arm"] = add_footer(32, arm_eabi_genstub(syscall), syscall)
@@ -357,7 +388,6 @@
if syscall.has_key("x86_64"):
syscall["asm-x86_64"] = add_footer(64, x86_64_genstub(syscall), syscall)
-
# Scan a Linux kernel asm/unistd.h file containing __NR_* constants
# and write out equivalent SYS_* constants for glibc source compatibility.
def scan_linux_unistd_h(self, fp, path):
@@ -380,7 +410,9 @@
glibc_fp.write("#ifndef _BIONIC_GLIBC_SYSCALLS_H_\n")
glibc_fp.write("#define _BIONIC_GLIBC_SYSCALLS_H_\n")
- glibc_fp.write("#if defined(__arm__)\n")
+ glibc_fp.write("#if defined(__aarch64__)\n")
+ self.scan_linux_unistd_h(glibc_fp, bionic_libc_root + "/kernel/uapi/asm-generic/unistd.h")
+ glibc_fp.write("#elif defined(__arm__)\n")
self.scan_linux_unistd_h(glibc_fp, bionic_libc_root + "/kernel/arch-arm/asm/unistd.h")
glibc_fp.write("#elif defined(__mips__)\n")
self.scan_linux_unistd_h(glibc_fp, bionic_libc_root + "/kernel/arch-mips/asm/unistd.h")
diff --git a/libc/upstream-netbsd/libc/stdlib/jrand48.c b/libc/upstream-netbsd/libc/stdlib/jrand48.c
index 0ab594e..079dbd3 100644
--- a/libc/upstream-netbsd/libc/stdlib/jrand48.c
+++ b/libc/upstream-netbsd/libc/stdlib/jrand48.c
@@ -1,4 +1,4 @@
-/* $NetBSD: jrand48.c,v 1.8 2005/06/12 05:21:28 lukem Exp $ */
+/* $NetBSD: jrand48.c,v 1.9 2013/10/22 08:08:51 matt Exp $ */
/*
* Copyright (c) 1993 Martin Birgmeier
@@ -15,7 +15,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: jrand48.c,v 1.8 2005/06/12 05:21:28 lukem Exp $");
+__RCSID("$NetBSD: jrand48.c,v 1.9 2013/10/22 08:08:51 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -35,5 +35,5 @@
_DIAGASSERT(xseed != NULL);
__dorand48(xseed);
- return ((long) xseed[2] << 16) + (long) xseed[1];
+ return (int16_t)xseed[2] * 65536 + xseed[1];
}
diff --git a/libc/upstream-netbsd/libc/stdlib/lrand48.c b/libc/upstream-netbsd/libc/stdlib/lrand48.c
index 78f869e..11e6485 100644
--- a/libc/upstream-netbsd/libc/stdlib/lrand48.c
+++ b/libc/upstream-netbsd/libc/stdlib/lrand48.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lrand48.c,v 1.8 2005/06/12 05:21:28 lukem Exp $ */
+/* $NetBSD: lrand48.c,v 1.9 2013/10/22 08:08:51 matt Exp $ */
/*
* Copyright (c) 1993 Martin Birgmeier
@@ -15,7 +15,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: lrand48.c,v 1.8 2005/06/12 05:21:28 lukem Exp $");
+__RCSID("$NetBSD: lrand48.c,v 1.9 2013/10/22 08:08:51 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -29,6 +29,5 @@
lrand48(void)
{
__dorand48(__rand48_seed);
- return (long)((unsigned long) __rand48_seed[2] << 15) +
- ((unsigned long) __rand48_seed[1] >> 1);
+ return __rand48_seed[2] * 32768 + (__rand48_seed[1] >> 1);
}
diff --git a/libc/upstream-netbsd/libc/stdlib/mrand48.c b/libc/upstream-netbsd/libc/stdlib/mrand48.c
index c787ce6..e51352a 100644
--- a/libc/upstream-netbsd/libc/stdlib/mrand48.c
+++ b/libc/upstream-netbsd/libc/stdlib/mrand48.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mrand48.c,v 1.7 2005/06/12 05:21:28 lukem Exp $ */
+/* $NetBSD: mrand48.c,v 1.8 2013/10/22 08:08:51 matt Exp $ */
/*
* Copyright (c) 1993 Martin Birgmeier
@@ -15,7 +15,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: mrand48.c,v 1.7 2005/06/12 05:21:28 lukem Exp $");
+__RCSID("$NetBSD: mrand48.c,v 1.8 2013/10/22 08:08:51 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -29,5 +29,5 @@
mrand48(void)
{
__dorand48(__rand48_seed);
- return ((long) __rand48_seed[2] << 16) + (long) __rand48_seed[1];
+ return (int16_t)__rand48_seed[2] * 65536 + __rand48_seed[1];
}
diff --git a/libc/upstream-netbsd/libc/stdlib/nrand48.c b/libc/upstream-netbsd/libc/stdlib/nrand48.c
index fc73185..98becca 100644
--- a/libc/upstream-netbsd/libc/stdlib/nrand48.c
+++ b/libc/upstream-netbsd/libc/stdlib/nrand48.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nrand48.c,v 1.9 2005/06/12 05:21:28 lukem Exp $ */
+/* $NetBSD: nrand48.c,v 1.10 2013/10/22 08:08:51 matt Exp $ */
/*
* Copyright (c) 1993 Martin Birgmeier
@@ -15,7 +15,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: nrand48.c,v 1.9 2005/06/12 05:21:28 lukem Exp $");
+__RCSID("$NetBSD: nrand48.c,v 1.10 2013/10/22 08:08:51 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -34,6 +34,5 @@
_DIAGASSERT(xseed != NULL);
__dorand48(xseed);
- return (long)((unsigned long) xseed[2] << 15) +
- ((unsigned long) xseed[1] >> 1);
+ return xseed[2] * 32768 + (xseed[1] >> 1);
}