code wiki / (root) / nx_syscalls_mapping_candidate_t181.nx

nx_syscalls_mapping_candidate_t181.nx

buildroot/runtime/nx_syscalls_mapping_candidate_t181.nx

105305 B1946 linesdepth 1pulls 1 transitivereach 0 importersview sourcekind orphan librarytopic syscalls
docsdependenciesstructsconstsfunctions

about

syscalls.nx -- thin __syscall wrappers used across modules. Sovereign path: no libc. Every memory allocation, file op, and clock read in the rest of the runtime routes through one of these helpers. Numbers match Linux RV64; NishiOS uses the same set. Extracted from runtime.nx and ir.nx's copy-pasted helpers so the module-import build doesn't produce duplicate symbols.

dependencies 1 imports · 0 importers

nx_tier.nx nx_syscalls_mapping_candidate_

imports: nx_tier.nx

imported by: nobody (leaf or entry point)

structs

none

consts

18const SYS_MAGIC_1024: i64 = 1024
19const SYS_MAGIC_1000000: i64 = 1000000
20const SYS_MAGIC_4294967296: i64 = 4294967296
22const SYS_READ_GROW_INIT: i64 = 65536
23const SYS_MAGIC_100000: i64 = 100000
41const SYS_READ: i64 = 0
42const SYS_WRITE: i64 = 1
43const SYS_CLOSE: i64 = 3
44const SYS_LSEEK: i64 = 8
45const SYS_OPENAT: i64 = 257
46const SYS_EXIT: i64 = 60
47const SYS_MMAP: i64 = 9
48const SYS_CLOCK_GETTIME: i64 = 228
49const SYS_IOCTL: i64 = 16
50const SYS_CLOCK_NANOSLEEP: i64 = 230
54const SYS_CHROOT: i64 = 161
55const SYS_MOUNT: i64 = 165
56const SYS_UNSHARE: i64 = 272
57const SYS_GETUID: i64 = 102
58const SYS_GETGID: i64 = 104
59const SYS_POLL: i64 = 7
63const SYS_READ: i64 = 63
64const SYS_WRITE: i64 = 64
65const SYS_CLOSE: i64 = 57
66const SYS_LSEEK: i64 = 62
67const SYS_OPENAT: i64 = 56
68const SYS_EXIT: i64 = 93
69const SYS_MMAP: i64 = 222
70const SYS_CLOCK_GETTIME: i64 = 113
71const SYS_IOCTL: i64 = 29
72const SYS_CLOCK_NANOSLEEP: i64 = 115
79const SYS_CHROOT: i64 = 51
80const SYS_MOUNT: i64 = 40
81const SYS_UNSHARE: i64 = 97
82const SYS_GETUID: i64 = 174
83const SYS_GETGID: i64 = 176
84const SYS_POLL: i64 = 73
142const SYS_PATH_MAX: i64 = 4096 // Linux PATH_MAX; getcwd returns -ERANGE below it
146const MODE_0755: i64 = 0x1ed // rwxr-xr-x : default mode for a created directory
161const AT_FDCWD: i64 = -100
266const NX_MO_RELAXED: i64 = 0
267const NX_MO_CONSUME: i64 = 1
268const NX_MO_ACQUIRE: i64 = 2
269const NX_MO_RELEASE: i64 = 3
270const NX_MO_ACQ_REL: i64 = 4
271const NX_MO_SEQ_CST: i64 = 5
273const NXA_SMALL_MAX: i64 = 256
274const NXA_CHUNK: i64 = 262144
275const NXA_ALIGN: i64 = 16
276const NXA_GAP: i64 = 16
277const NXA_STATE: i64 = 4096
283const NXA_RING: i64 = 128
284const NXA_RBASE: i64 = 64
319const NXA_LOCK: i64 = 4
327const NXA_LOCK_WARN: i64 = NXA_RING * 8
331const NXA_LOCK_WARNED: i64 = 5
333const NXA_CHUNKBASE: i64 = 320
334const NXA_CHUNKMAX: i64 = 192
355const NXA_MAP_INVALID:i64=0-22 // Linux EINVAL, a protocol value rather than a resource budget.
407const SYS_STATFS_X86_MEASURED: i64 = 137
408const STATFS_BUF_BYTES: i64 = 144
409const STATFS_I_BSIZE: i64 = 1
410const STATFS_I_BLOCKS: i64 = 2
411const STATFS_I_BAVAIL: i64 = 4
412const STATFS_PERMIL: i64 = 1000
413const STATFS_ERR: i64 = 0 - 1
758const O_RDONLY: i64 = 0
759const O_WRONLY_CT: i64 = 0x241 // O_CREAT | O_WRONLY | O_TRUNC
760const O_WRONLY_CA: i64 = 0x441 // O_CREAT | O_WRONLY | O_APPEND
768const O_RDWR_CREATE: i64 = 0x42
789const MODE_0644: i64 = 0x1a4 // rw-r--r-- : default mode for a generated artifact
794const MODE_0755: i64 = 0x1ed
807const ACCEPT_TMO_S: i64 = 30
814const O_WRONLY_CREATE_EXCLUSIVE: i64 = 0x1 | 0x40 | 0x80
820const O_DIRECTORY: i64 = 0x10000
834const O_CLOEXEC: i64 = 0x80000
835const O_NOFOLLOW: i64 = 0x20000
836const O_NONBLOCK: i64 = 0x800
837const MODE_0600: i64 = 0x180
902const SYS_LOCK_SH: i64 = 1
903const SYS_LOCK_EX: i64 = 2
904const SYS_LOCK_NB: i64 = 4
905const SYS_LOCK_UN: i64 = 8
950const SYS_SETPGID: i64 = 109
953const SYS_SETPGID: i64 = 154
976const RLIMIT_CPU: i64 = 0
977const RLIMIT_AS: i64 = 9
978const WNOHANG: i64 = 1
1072const SYS_CLONE: i64 = 56
1073const SYS_EXECVE: i64 = 59
1074const SYS_WAIT4: i64 = 61
1075const SYS_PIPE2: i64 = 293
1076const SYS_DUP3: i64 = 292
1080const SYS_CLONE: i64 = 220
1081const SYS_EXECVE: i64 = 221
1082const SYS_WAIT4: i64 = 260
1083const SYS_PIPE2: i64 = 59
1084const SYS_DUP3: i64 = 24
1090const CLONE_VM: i64 = 0x00000100
1091const CLONE_VFORK: i64 = 0x00004000
1092const SIGCHLD: i64 = 17
1142const NX_SYS_PRCTL: i64 = 167
1143const NX_PR_SET_PDEATHSIG: i64 = 1
1144const NX_PR_SET_CHILD_SUBREAPER: i64 = 36
1159const SYS_WAITID_PORTABLE: i64 = 95
1160const NX_WAIT_P_PID: i64 = 1
1161const NX_WAIT_EXITED: i64 = 4
1162const NX_WAIT_NOWAIT: i64 = 0x01000000
1163const NX_WAIT_SIGINFO_BYTES: i64 = 128
1170const NX_FD_DENT_BUFFER: i64 = 4096
1171const NX_SYS_CLOSE_RANGE: i64 = 436 // Linux x86_64 and asm-generic ABI
1172const NX_FD_UINT_MAX: i64 = 4294967295
1344const SYS_GETDENTS64: i64 = 217
1347const SYS_GETDENTS64: i64 = 61
1350const DT_UNKNOWN: i64 = 0
1351const DT_FIFO: i64 = 1
1352const DT_CHR: i64 = 2
1353const DT_DIR: i64 = 4
1354const DT_BLK: i64 = 6
1355const DT_REG: i64 = 8
1356const DT_LNK: i64 = 10
1357const DT_SOCK: i64 = 12
1545const SYS_SOCKET: i64 = 41
1546const SYS_BIND: i64 = 49
1547const SYS_LISTEN: i64 = 50
1548const SYS_ACCEPT: i64 = 43
1549const SYS_CONNECT: i64 = 42
1550const SYS_SETSOCKOPT: i64 = 54
1551const SYS_SENDTO: i64 = 44
1552const SYS_RECVFROM: i64 = 45
1553const SYS_SHUTDOWN: i64 = 48
1557const SYS_SOCKET: i64 = 198
1558const SYS_BIND: i64 = 200
1559const SYS_LISTEN: i64 = 201
1560const SYS_ACCEPT: i64 = 202
1561const SYS_CONNECT: i64 = 203
1562const SYS_SETSOCKOPT: i64 = 208
1563const SYS_SENDTO: i64 = 206
1564const SYS_RECVFROM: i64 = 207
1565const SYS_SHUTDOWN: i64 = 210
1569const SOL_SOCKET: i64 = 1
1570const SO_REUSEADDR: i64 = 2
1575const SO_SNDTIMEO: i64 = 21
1576const SO_RCVTIMEO: i64 = 20
1604const SYS_ALARM: i64 = 37
1607const AF_INET: i64 = 2
1608const SOCK_STREAM: i64 = 1
1609const SOCK_DGRAM: i64 = 2
1715const SYS_SENDMSG: i64 = 46
1716const SYS_RECVMSG: i64 = 47
1717const SYS_SOCKETPAIR: i64 = 53
1718const SCM_AF_UNIX: i64 = 1
1719const SCM_SOL_SOCKET: i64 = 1
1720const SCM_RIGHTS_TYPE: i64 = 1
1721const SCM_MSG_CMSG_CLOEXEC: i64 = 1073741824
1722const SCM_MSGHDR_BYTES: i64 = 56
1723const SCM_MSGHDR_OFF_IOV: i64 = 16
1724const SCM_MSGHDR_OFF_IOVLEN: i64 = 24
1725const SCM_MSGHDR_OFF_CTRL: i64 = 32
1726const SCM_MSGHDR_OFF_CTRLLEN: i64 = 40
1727const SCM_IOVEC_BYTES: i64 = 16
1728const SCM_IOVEC_OFF_BASE: i64 = 0
1729const SCM_IOVEC_OFF_LEN: i64 = 8
1730const SCM_CMSG_OFF_LEN: i64 = 0
1731const SCM_CMSG_OFF_LEVEL: i64 = 8
1732const SCM_CMSG_OFF_TYPE: i64 = 12
1733const SCM_CMSG_OFF_DATA: i64 = 16
1734const SCM_CMSG_LEN_1FD: i64 = 20
1735const SCM_CMSG_SPACE_1FD: i64 = 24
1736const SCM_IOV_COUNT_ONE: i64 = 1
1737const SCM_U32_BYTES: i64 = 4
1738const SCM_BYTE_RADIX: i64 = 256
1739const SCM_FDPAIR_BYTES: i64 = 8
1742const SCM_PAYLOAD_BYTES: i64 = 1
1743const SCM_PAYLOAD_BYTE: i64 = 70
1747const SCM_ERR_NO_CMSG: i64 = 0 - 901
1748const SCM_ERR_CMSG_LEN: i64 = 0 - 902
1749const SCM_ERR_CMSG_LEVEL: i64 = 0 - 903
1750const SCM_ERR_CMSG_TYPE: i64 = 0 - 904
1822const SCM_SUN_PATH_OFF: i64 = 2 // sockaddr_un = [sa_family: u16][sun_path: 108]
1823const SCM_SUN_BYTES: i64 = 110
1824const SCM_SUN_PATH_MAX: i64 = 107

functions

87func sys_ioctl(fd: i64, request: i64, arg: i64) -> i64
98func sys_poll(fds: *u8, nfds: i64, timeout_ms: i64) -> i64
104func sys_write(fd: i64, buf: *u8, count: i64) -> i64
108func sys_read(fd: i64, buf: *u8, count: i64) -> i64
called by 1: sys_read_file
112func sys_close(fd: i64) -> i64
122func sys_chdir(path: *u8) -> i64
calls 1: sys_mmap
147func sys_getcwd(buf: *u8, cap: i64) -> i64
calls 1: sys_mmap
166func sys_unlinkat(path: *u8) -> i64
173func sys_fchmodat(path: *u8, mode: i64) -> i64
calls 1: sys_mmap
189func sys_exit_group(code: i64) -> i64
206func sys_setpriority(prio: i64) -> i64
214func sys_setpriority_of(pid: i64, prio: i64) -> i64
356func sys_munmap_direct(addr:*u8,len:i64)->i64
361func sys_munmap(addr: *u8, len: i64) -> i64
368func sys_lseek(fd: i64, offset: i64, whence: i64) -> i64
416func sys_statfs(path: *u8, buf: *i64) -> i64
421func sys_fs_avail_bytes(path: *u8) -> i64
430func sys_fs_used_permil(path: *u8) -> i64
439func sys_exit(code: i64) -> i64
called by 1: nxa_die
473func nxa_dump_printable(src: i64, n: i64) -> i64
called by 1: nxa_report_overrun calls 1: sys_write
494func nxa_dump_sizes() -> i64
called by 1: nxa_report_overrun calls 1: sys_write
519func nxa_report_overrun(sz: i64, gs: i64) -> i64
549func nxa_die(msg: *u8) -> i64
called by 1: sys_mmap calls 2: sys_writesys_exit
559func nxa_lock_addr() -> *i64
567func nxa_lock_take() -> i64
called by 1: sys_mmap calls 2: nxa_lock_addrsys_write
596func nxa_lock_give() -> i64
called by 1: sys_mmap calls 1: nxa_lock_addr
610func sys_mmap_try(size:i64)->*u8
617func sys_mmap(size: i64) -> *u8
699func sys_arena_mark() -> i64
calls 1: sys_mmap
713func sys_arena_reset() -> i64
737func sys_mmap_shared(size: i64) -> *u8
751func sys_madvise(addr: *u8, len: i64, advice: i64) -> i64
762func sys_openat_rd(path: *u8) -> i64
769func sys_openat_rdwr(path: *u8, mode: i64) -> i64
808func sys_openat_wr(path: *u8, mode: i64) -> i64
815func sys_openat_exclusive(path: *u8, mode: i64) -> i64
821func sys_openat_directory(path: *u8) -> i64
828func sys_openat_append(path: *u8, mode: i64) -> i64
838func sys_openat_lock(path: *u8) -> i64
846func sys_symlinkat(target: *u8, linkpath: *u8) -> i64
858func sys_readlinkat(path: *u8, buf: *u8, cap: i64) -> i64
875func sys_renameat(oldpath: *u8, newpath: *u8) -> i64
888func sys_fsync(fd: i64) -> i64
906func sys_flock(fd: i64, op: i64) -> i64
914func sys_fstatat(path: *u8, statbuf: *u8) -> i64
921func sys_utimensat(path: *u8, times: *i64) -> i64
940func nx_kill(pid: i64, sig: i64) -> i64 { return __syscall(129, pid, sig, 0, 0, 0, 0) }
955func sys_setpgid(pid: i64, pgid: i64) -> i64 { return __syscall(SYS_SETPGID, pid, pgid, 0, 0, 0, 0) }
969func nx_prlimit(pid: i64, resource: i64, new_limit: *u8, old_limit: *u8) -> i64
981func sys_mkdir(path: *u8, mode: i64) -> i64 { return __syscall(34, AT_FDCWD, path, mode, 0, 0, 0) }
984func nx_chmod(path: *u8, mode: i64) -> i64 { return __syscall(53, AT_FDCWD, path, mode, 0, 0, 0) }
988func nx_setsid() -> i64 { return __syscall(112, 0, 0, 0, 0, 0, 0) }
992func sys_clock_gettime_mono(ts: *i64) -> i64
1000func sys_clock_gettime_real(ts: *i64) -> i64
1005func sys_now_realtime_sec() -> i64
1012func sys_now_realtime_ms() -> i64
1024func sys_now_realtime_us() -> i64
1033func sys_now_ms() -> i64
1044func sys_now_us() -> i64
1055func sys_clock_now_us() -> i64
calls 1: sys_now_us
1105func sys_unshare(flags: i64) -> i64
1108func sys_mount(source: *u8, target: *u8, fs_type: *u8, mountflags: i64, data: *u8) -> i64
1111func sys_chroot(path: *u8) -> i64
1114func sys_getuid() -> i64
1117func sys_getgid() -> i64
1121func sys_fork() -> i64
1145func sys_prctl(option: i64, arg: i64) -> i64
1148func sys_bind_parent_lifetime(expected_parent: i64, signal: i64) -> i64
calls 1: sys_prctl
1164func sys_waitid(idtype: i64, id: i64, info: *u8, options: i64) -> i64
1173func sys_close_inherited_proc(first: i64) -> i64
1214func sys_close_inherited(first: i64) -> i64
1220func sys_execve_clean(path: *u8, argv: *i64, envp: *i64) -> i64
1226func sys_execve(path: *u8, argv: *i64, envp: *i64) -> i64
called by 1: sys_execve_clean
1235func sys_wait4(pid: i64, status: *i64, options: i64) -> i64
1241func wait_exit_code(status: i64) -> i64
called by 1: wait_status_rc
1249func wait_term_signal(status: i64) -> i64
called by 1: wait_status_rc
1274func wait_status_rc(status: i64) -> i64
1297func sys_default_signal(sig: i64) -> i64
calls 1: sys_mmap
1306func sys_ignore_sigpipe() -> i64
calls 1: sys_mmap
1321func sys_pipe2(fds: *i64, flags: i64) -> i64
1327func sys_dup3(oldfd: i64, newfd: i64, flags: i64) -> i64
1361func sys_getdents64(fd: i64, buf: *u8, buf_len: i64) -> i64
1367func dirent_reclen(rec: *u8) -> i64
1374func dirent_type(rec: *u8) -> i64
1379func dirent_name(rec: *u8) -> *u8
1386func sys_read_file(path: *u8, out_len: *i64) -> *u8
1468func sys_free_file(buf: *u8, len: i64) -> i64
calls 1: sys_munmap
1479func sys_map_file(path: *u8, out_len: *i64) -> *u8
1497func sys_sleep_ms(ms: i64) -> i64
1581func sys_setsockopt(fd: i64, level: i64, optname: i64,
1591func sys_set_socket_timeout(fd: i64, secs: i64) -> i64
1605func sys_alarm(secs: i64) -> i64 { return __syscall(SYS_ALARM, secs, 0, 0, 0, 0, 0) }
1611func sys_socket(domain: i64, sock_type: i64, protocol: i64) -> i64
1623func sockaddr_in_init(addr: *u8, port: i64) -> i64
1646func sys_bind(fd: i64, addr: *u8, addr_len: i64) -> i64
called by 1: sys_unix_listen
1649func sys_listen(fd: i64, backlog: i64) -> i64
called by 1: sys_unix_listen
1656func sys_accept(fd: i64) -> i64
1659func sys_accept_with_addr(fd: i64, addr: *u8, addr_len: *i64) -> i64
1663func sys_shutdown(fd: i64, how: i64) -> i64
1666func sys_connect(fd: i64, addr: *u8, addr_len: i64) -> i64
called by 1: sys_unix_connect_fd
1669func sys_sendto(fd: i64, buf: *u8, n: i64, flags: i64,
1673func sys_recvfrom(fd: i64, buf: *u8, n: i64, flags: i64,
1752func scm_zero(base: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { base[i] = 0; i = i + 1 } return 0 }
1753func scm_put_i64(base: *u8, off: i64, v: i64) -> i64
1758func scm_get_i64(base: *u8, off: i64) -> i64
called by 1: sys_recv_fd
1765func scm_put_u32(base: *u8, off: i64, v: i64) -> i64
called by 1: sys_send_fd
1775func scm_get_u32(base: *u8, off: i64) -> i64
called by 1: sys_recv_fd
1787func sys_sendmsg(fd: i64, msg: *u8, flags: i64) -> i64
called by 1: sys_send_fd
1790func sys_recvmsg(fd: i64, msg: *u8, flags: i64) -> i64
called by 1: sys_recv_fd
1814func sys_socketpair(domain: i64, sock_type: i64, protocol: i64, sv: *u8) -> i64
1825func sys_unix_listen(path: *u8, backlog: i64) -> i64
1853func sys_unix_connect_fd(path: *u8) -> i64
1877func sys_send_fd(sock: i64, fd: i64) -> i64
1911func sys_recv_fd(sock: i64, flags: i64) -> i64