; ------------------------------------------------------------------------
; HeavyThing x86_64 assembly language library and showcase programs
; Copyright © 2015-2018 2 Ton Digital
; Homepage: https://2ton.com.au/
; Author: Jeff Marrison <jeff@2ton.com.au>
;
; This file is part of the HeavyThing library.
;
; HeavyThing is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License, or
; (at your option) any later version.
;
; HeavyThing is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with the HeavyThing library. If not, see <http://www.gnu.org/licenses/>.
; ------------------------------------------------------------------------
;
; syscall.inc: convenience symbolic mapping for syscall numbers cuz looking them up sucks.
;
; built by a quick perl -pi -e of /usr/include/asm-x86/unistd_64.h
;
; syscall # into rax, args: rdi, rsi, rdx, r10, r8, r9
; return always in rax
;
syscall_read = 0
syscall_write = 1
syscall_open = 2
syscall_close = 3
syscall_stat = 4
syscall_fstat = 5
syscall_lstat = 6
syscall_poll = 7
syscall_lseek = 8
syscall_mmap = 9
syscall_mprotect = 10
syscall_munmap = 11
syscall_brk = 12
syscall_rt_sigaction = 13
syscall_rt_sigprocmask = 14
syscall_rt_sigreturn = 15
syscall_ioctl = 16
syscall_pread64 = 17
syscall_pwrite64 = 18
syscall_readv = 19
syscall_writev = 20
syscall_access = 21
syscall_pipe = 22
syscall_select = 23
syscall_sched_yield = 24
syscall_mremap = 25
syscall_msync = 26
syscall_mincore = 27
syscall_madvise = 28
syscall_shmget = 29
syscall_shmat = 30
syscall_shmctl = 31
syscall_dup = 32
syscall_dup2 = 33
syscall_pause = 34
syscall_nanosleep = 35
syscall_getitimer = 36
syscall_alarm = 37
syscall_setitimer = 38
syscall_getpid = 39
syscall_sendfile = 40
syscall_socket = 41
syscall_connect = 42
syscall_accept = 43
syscall_sendto = 44
syscall_recvfrom = 45
syscall_sendmsg = 46
syscall_recvmsg = 47
syscall_shutdown = 48
syscall_bind = 49
syscall_listen = 50
syscall_getsockname = 51
syscall_getpeername = 52
syscall_socketpair = 53
syscall_setsockopt = 54
syscall_getsockopt = 55
syscall_clone = 56
syscall_fork = 57
syscall_vfork = 58
syscall_execve = 59
syscall_exit = 60
syscall_wait4 = 61
syscall_kill = 62
syscall_uname = 63
syscall_semget = 64
syscall_semop = 65
syscall_semctl = 66
syscall_shmdt = 67
syscall_msgget = 68
syscall_msgsnd = 69
syscall_msgrcv = 70
syscall_msgctl = 71
syscall_fcntl = 72
syscall_flock = 73
syscall_fsync = 74
syscall_fdatasync = 75
syscall_truncate = 76
syscall_ftruncate = 77
syscall_getdents = 78
syscall_getcwd = 79
syscall_chdir = 80
syscall_fchdir = 81
syscall_rename = 82
syscall_mkdir = 83
syscall_rmdir = 84
syscall_creat = 85
syscall_link = 86
syscall_unlink = 87
syscall_symlink = 88
syscall_readlink = 89
syscall_chmod = 90
syscall_fchmod = 91
syscall_chown = 92
syscall_fchown = 93
syscall_lchown = 94
syscall_umask = 95
syscall_gettimeofday = 96
syscall_getrlimit = 97
syscall_getrusage = 98
syscall_sysinfo = 99
syscall_times = 100
syscall_ptrace = 101
syscall_getuid = 102
syscall_syslog = 103
syscall_getgid = 104
syscall_setuid = 105
syscall_setgid = 106
syscall_geteuid = 107
syscall_getegid = 108
syscall_setpgid = 109
syscall_getppid = 110
syscall_getpgrp = 111
syscall_setsid = 112
syscall_setreuid = 113
syscall_setregid = 114
syscall_getgroups = 115
syscall_setgroups = 116
syscall_setresuid = 117
syscall_getresuid = 118
syscall_setresgid = 119
syscall_getresgid = 120
syscall_getpgid = 121
syscall_setfsuid = 122
syscall_setfsgid = 123
syscall_getsid = 124
syscall_capget = 125
syscall_capset = 126
syscall_rt_sigpending = 127
syscall_rt_sigtimedwait = 128
syscall_rt_sigqueueinfo = 129
syscall_rt_sigsuspend = 130
syscall_sigaltstack = 131
syscall_utime = 132
syscall_mknod = 133
syscall_uselib = 134
syscall_personality = 135
syscall_ustat = 136
syscall_statfs = 137
syscall_fstatfs = 138
syscall_sysfs = 139
syscall_getpriority = 140
syscall_setpriority = 141
syscall_sched_setparam = 142
syscall_sched_getparam = 143
syscall_sched_setscheduler = 144
syscall_sched_getscheduler = 145
syscall_sched_get_priority_max = 146
syscall_sched_get_priority_min = 147
syscall_sched_rr_get_interval = 148
syscall_mlock = 149
syscall_munlock = 150
syscall_mlockall = 151
syscall_munlockall = 152
syscall_vhangup = 153
syscall_modify_ldt = 154
syscall_pivot_root = 155
syscall__sysctl = 156
syscall_prctl = 157
syscall_arch_prctl = 158
syscall_adjtimex = 159
syscall_setrlimit = 160
syscall_chroot = 161
syscall_sync = 162
syscall_acct = 163
syscall_settimeofday = 164
syscall_mount = 165
syscall_umount2 = 166
syscall_swapon = 167
syscall_swapoff = 168
syscall_reboot = 169
syscall_sethostname = 170
syscall_setdomainname = 171
syscall_iopl = 172
syscall_ioperm = 173
syscall_create_module = 174
syscall_init_module = 175
syscall_delete_module = 176
syscall_get_kernel_syms = 177
syscall_query_module = 178
syscall_quotactl = 179
syscall_nfsservctl = 180
syscall_getpmsg = 181
syscall_putpmsg = 182
syscall_afs_syscall = 183
syscall_tuxcall = 184
syscall_security = 185
syscall_gettid = 186
syscall_readahead = 187
syscall_setxattr = 188
syscall_lsetxattr = 189
syscall_fsetxattr = 190
syscall_getxattr = 191
syscall_lgetxattr = 192
syscall_fgetxattr = 193
syscall_listxattr = 194
syscall_llistxattr = 195
syscall_flistxattr = 196
syscall_removexattr = 197
syscall_lremovexattr = 198
syscall_fremovexattr = 199
syscall_tkill = 200
syscall_time = 201
syscall_futex = 202
syscall_sched_setaffinity = 203
syscall_sched_getaffinity = 204
syscall_set_thread_area = 205
syscall_io_setup = 206
syscall_io_destroy = 207
syscall_io_getevents = 208
syscall_io_submit = 209
syscall_io_cancel = 210
syscall_get_thread_area = 211
syscall_lookup_dcookie = 212
syscall_epoll_create = 213
syscall_epoll_ctl_old = 214
syscall_epoll_wait_old = 215
syscall_remap_file_pages = 216
syscall_getdents64 = 217
syscall_set_tid_address = 218
syscall_restart_syscall = 219
syscall_semtimedop = 220
syscall_fadvise64 = 221
syscall_timer_create = 222
syscall_timer_settime = 223
syscall_timer_gettime = 224
syscall_timer_getoverrun = 225
syscall_timer_delete = 226
syscall_clock_settime = 227
syscall_clock_gettime = 228
syscall_clock_getres = 229
syscall_clock_nanosleep = 230
syscall_exit_group = 231
syscall_epoll_wait = 232
syscall_epoll_ctl = 233
syscall_tgkill = 234
syscall_utimes = 235
syscall_vserver = 236
syscall_mbind = 237
syscall_set_mempolicy = 238
syscall_get_mempolicy = 239
syscall_mq_open = 240
syscall_mq_unlink = 241
syscall_mq_timedsend = 242
syscall_mq_timedreceive = 243
syscall_mq_notify = 244
syscall_mq_getsetattr = 245
syscall_kexec_load = 246
syscall_waitid = 247
syscall_add_key = 248
syscall_request_key = 249
syscall_keyctl = 250
syscall_ioprio_set = 251
syscall_ioprio_get = 252
syscall_inotify_init = 253
syscall_inotify_add_watch = 254
syscall_inotify_rm_watch = 255
syscall_migrate_pages = 256
syscall_openat = 257
syscall_mkdirat = 258
syscall_mknodat = 259
syscall_fchownat = 260
syscall_futimesat = 261
syscall_newfstatat = 262
syscall_unlinkat = 263
syscall_renameat = 264
syscall_linkat = 265
syscall_symlinkat = 266
syscall_readlinkat = 267
syscall_fchmodat = 268
syscall_faccessat = 269
syscall_pselect6 = 270
syscall_ppoll = 271
syscall_unshare = 272
syscall_set_robust_list = 273
syscall_get_robust_list = 274
syscall_splice = 275
syscall_tee = 276
syscall_sync_file_range = 277
syscall_vmsplice = 278
syscall_move_pages = 279
syscall_utimensat = 280
syscall_epoll_pwait = 281
syscall_signalfd = 282
syscall_timerfd_create = 283
syscall_eventfd = 284
syscall_fallocate = 285
syscall_timerfd_settime = 286
syscall_timerfd_gettime = 287
syscall_accept4 = 288
syscall_signalfd4 = 289
syscall_eventfd2 = 290
syscall_epoll_create1 = 291
syscall_dup3 = 292
syscall_pipe2 = 293
syscall_inotify_init1 = 294
syscall_preadv = 295
syscall_pwritev = 296
syscall_rt_tgsigqueueinfo = 297
syscall_perf_event_open = 298
syscall_recvmmsg = 299
syscall_fanotify_init = 300
syscall_fanotify_mark = 301
syscall_prlimit64 = 302
syscall_name_to_handle_at = 303
syscall_open_by_handle_at = 304
syscall_clock_adjtime = 305
syscall_syncfs = 306
syscall_sendmmsg = 307
syscall_setns = 308
syscall_getcpu = 309
syscall_process_vm_readv = 310
syscall_process_vm_writev = 311
syscall_kcmp = 312