#[repr(i64)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SysCall {
IoSetup = 0,
IoDestroy = 1,
IoSubmit = 2,
IoCancel = 3,
IoGetevents = 4,
Setxattr = 5,
Lsetxattr = 6,
Fsetxattr = 7,
Getxattr = 8,
Lgetxattr = 9,
Fgetxattr = 10,
Listxattr = 11,
Llistxattr = 12,
Flistxattr = 13,
Removexattr = 14,
Lremovexattr = 15,
Fremovexattr = 16,
Getcwd = 17,
Lookup_dcookie = 18,
Eventfd2 = 19,
Epoll_create1 = 20,
Epoll_ctl = 21,
Epoll_pwait = 22,
Dup = 23,
Dup3 = 24,
Fcntl = 25,
Inotify_init1 = 26,
Inotify_add_watch = 27,
Inotify_rm_watch = 28,
Ioctl = 29,
Ioprio_set = 30,
Ioprio_get = 31,
Flock = 32,
Mknodat = 33,
Mkdirat = 34,
Unlinkat = 35,
Symlinkat = 36,
Linkat = 37,
Renameat = 38,
Umount2 = 39,
Mount = 40,
Pivot_root = 41,
Nfsservctl = 42,
Statfs = 43,
Fstatfs = 44,
Truncate = 45,
Ftruncate = 46,
Fallocate = 47,
Faccessat = 48,
Chdir = 49,
Fchdir = 50,
Chroot = 51,
Fchmod = 52,
Fchmodat = 53,
Fchownat = 54,
Fchown = 55,
Openat = 56,
Close = 57,
Vhangup = 58,
Pipe2 = 59,
Quotactl = 60,
Getdents64 = 61,
Lseek = 62,
Read = 63,
Write = 64,
Readv = 65,
Writev = 66,
Pread64 = 67,
Pwrite64 = 68,
Preadv = 69,
Pwritev = 70,
Sendfile = 71,
Pselect6 = 72,
Ppoll = 73,
Signalfd4 = 74,
Vmsplice = 75,
Splice = 76,
Tee = 77,
Readlinkat = 78,
Newfstatat = 79,
Fstat = 80,
Sync = 81,
Fsync = 82,
Fdatasync = 83,
Sync_file_range = 84,
Timerfd_create = 85,
Timerfd_settime = 86,
Timerfd_gettime = 87,
Utimensat = 88,
Acct = 89,
Capget = 90,
Capset = 91,
Personality = 92,
Exit = 93,
Exit_group = 94,
Waitid = 95,
Set_tid_address = 96,
Unshare = 97,
Futex = 98,
Set_robust_list = 99,
Get_robust_list = 100,
Nanosleep = 101,
Getitimer = 102,
Setitimer = 103,
Kexec_load = 104,
Init_module = 105,
Delete_module = 106,
Timer_create = 107,
Timer_gettime = 108,
Timer_getoverrun = 109,
Timer_settime = 110,
Timer_delete = 111,
Clock_settime = 112,
Clock_gettime = 113,
Clock_getres = 114,
Clock_nanosleep = 115,
Syslog = 116,
Ptrace = 117,
Sched_setparam = 118,
Sched_setscheduler = 119,
Sched_getscheduler = 120,
Sched_getparam = 121,
Sched_setaffinity = 122,
Sched_getaffinity = 123,
Sched_yield = 124,
Sched_get_priority_max = 125,
Sched_get_priority_min = 126,
Sched_rr_get_interval = 127,
Restart_syscall = 128,
Kill = 129,
Tkill = 130,
Tgkill = 131,
Sigaltstack = 132,
Rt_sigsuspend = 133,
Rt_sigaction = 134,
Rt_sigprocmask = 135,
Rt_sigpending = 136,
Rt_sigtimedwait = 137,
Rt_sigqueueinfo = 138,
Rt_sigreturn = 139,
Setpriority = 140,
Getpriority = 141,
Reboot = 142,
Setregid = 143,
Setgid = 144,
Setreuid = 145,
Setuid = 146,
Setresuid = 147,
Getresuid = 148,
Setresgid = 149,
Getresgid = 150,
Setfsuid = 151,
Setfsgid = 152,
Times = 153,
Setpgid = 154,
Getpgid = 155,
Getsid = 156,
Setsid = 157,
Getgroups = 158,
Setgroups = 159,
Uname = 160,
Sethostname = 161,
Setdomainname = 162,
Getrlimit = 163,
Setrlimit = 164,
Getrusage = 165,
Umask = 166,
Prctl = 167,
Getcpu = 168,
Gettimeofday = 169,
Settimeofday = 170,
Adjtimex = 171,
Getpid = 172,
Getppid = 173,
Getuid = 174,
Geteuid = 175,
Getgid = 176,
Getegid = 177,
Gettid = 178,
Sysinfo = 179,
Mq_open = 180,
Mq_unlink = 181,
Mq_timedsend = 182,
Mq_timedreceive = 183,
Mq_notify = 184,
Mq_getsetattr = 185,
Msgget = 186,
Msgctl = 187,
Msgrcv = 188,
Msgsnd = 189,
Semget = 190,
Semctl = 191,
Semtimedop = 192,
Semop = 193,
Shmget = 194,
Shmctl = 195,
Shmat = 196,
Shmdt = 197,
Socket = 198,
Socketpair = 199,
Bind = 200,
Listen = 201,
Accept = 202,
Connect = 203,
Getsockname = 204,
Getpeername = 205,
Sendto = 206,
Recvfrom = 207,
Setsockopt = 208,
Getsockopt = 209,
Shutdown = 210,
Sendmsg = 211,
Recvmsg = 212,
Readahead = 213,
Brk = 214,
Munmap = 215,
Mremap = 216,
Add_key = 217,
Request_key = 218,
Keyctl = 219,
Clone = 220,
Execve = 221,
Mmap = 222,
Fadvise64 = 223,
Swapon = 224,
Swapoff = 225,
Mprotect = 226,
Msync = 227,
Mlock = 228,
Munlock = 229,
Mlockall = 230,
Munlockall = 231,
Mincore = 232,
Madvise = 233,
Remap_file_pages = 234,
Mbind = 235,
Get_mempolicy = 236,
Set_mempolicy = 237,
Migrate_pages = 238,
Move_pages = 239,
Rt_tgsigqueueinfo = 240,
Perf_event_open = 241,
Accept4 = 242,
Recvmmsg = 243,
Arch_specific_syscall = 244,
Wait4 = 260,
Prlimit64 = 261,
Fanotify_init = 262,
Fanotify_mark = 263,
Name_to_handle_at = 264,
Open_by_handle_at = 265,
Clock_adjtime = 266,
Syncfs = 267,
Setns = 268,
Sendmmsg = 269,
Process_vm_readv = 270,
Process_vm_writev = 271,
Kcmp = 272,
Finit_module = 273,
Sched_setattr = 274,
Sched_getattr = 275,
Renameat2 = 276,
Seccomp = 277,
Getrandom = 278,
Memfd_create = 279,
Bpf = 280,
Execveat = 281,
Userfaultfd = 282,
Membarrier = 283,
Mlock2 = 284,
Copy_file_range = 285,
Preadv2 = 286,
Pwritev2 = 287,
Pkey_mprotect = 288,
Pkey_alloc = 289,
Pkey_free = 290,
Statx = 291,
Io_pgetevents = 292,
Rseq = 293,
Kexec_file_load = 294,
Pidfd_send_signal = 424,
IoUringSetup = 425,
IoUringEnter = 426,
IoUringRegister = 427,
Open_tree = 428,
Move_mount = 429,
Fsopen = 430,
Fsconfig = 431,
Fsmount = 432,
Fspick = 433,
Pidfd_open = 434,
Clone3 = 435,
Close_range = 436,
Openat2 = 437,
Pidfd_getfd = 438,
Faccessat2 = 439,
Process_madvise = 440,
Epoll_pwait2 = 441,
Mount_setattr = 442,
Quotactl_fd = 443,
Landlock_create_ruleset = 444,
Landlock_add_rule = 445,
Landlock_restrict_self = 446,
Memfd_secret = 447,
Process_mrelease = 448,
Futex_waitv = 449,
Set_mempolicy_home_node = 450,
}
macro_rules! syscall {
($nr:expr) => {
{
let ret: i64;
unsafe {
core::arch::asm!(
"svc #0",
in("x8") $nr as i64,
lateout("x0") ret,
);
}
ret
}
};
($nr:expr, $a1:expr) => {
{
let ret: i64;
unsafe {
core::arch::asm!(
"svc #0",
in("x8") $nr as i64,
inlateout("x0") $a1 as i64 => ret,
);
}
ret
}
};
($nr:expr, $a1:expr, $a2:expr) => {
{
let ret: i64;
unsafe {
core::arch::asm!(
"svc #0",
in("x8") $nr as i64,
inlateout("x0") $a1 as i64 => ret,
in("x1") $a2 as i64,
);
}
ret
}
};
($nr:expr, $a1:expr, $a2:expr, $a3:expr) => {
{
let ret: i64;
unsafe {
core::arch::asm!(
"svc #0",
in("x8") $nr as i64,
inlateout("x0") $a1 as i64 => ret,
in("x1") $a2 as i64,
in("x2") $a3 as i64,
);
}
ret
}
};
($nr:expr, $a1:expr, $a2:expr, $a3:expr, $a4:expr) => {
{
let ret: i64;
unsafe {
core::arch::asm!(
"svc #0",
in("x8") $nr as i64,
inlateout("x0") $a1 as i64 => ret,
in("x1") $a2 as i64,
in("x2") $a3 as i64,
in("x3") $a4 as i64,
);
}
ret
}
};
($nr:expr, $a1:expr, $a2:expr, $a3:expr, $a4:expr, $a5:expr) => {
{
let ret: i64;
unsafe {
core::arch::asm!(
"svc #0",
in("x8") $nr as i64,
inlateout("x0") $a1 as i64 => ret,
in("x1") $a2 as i64,
in("x2") $a3 as i64,
in("x3") $a4 as i64,
in("x4") $a5 as i64,
);
}
ret
}
};
($nr:expr, $a1:expr, $a2:expr, $a3:expr, $a4:expr, $a5:expr, $a6:expr) => {
{
let ret: i64;
unsafe {
core::arch::asm!(
"svc #0",
in("x8") $nr as i64,
inlateout("x0") $a1 as i64 => ret,
in("x1") $a2 as i64,
in("x2") $a3 as i64,
in("x3") $a4 as i64,
in("x4") $a5 as i64,
in("x5") $a6 as i64,
);
}
ret
}
};
}