syscall_amd64.odin 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. //+build amd64
  2. package linux
  3. // AMD64 uses the new way to define syscalls, i.e. one that
  4. // is different from the other architectures. Instead of using
  5. // a .tbl file, they define constants to tell which syscalls they
  6. // want and then include a generic unistd.h file.
  7. SYS_read :: uintptr(0)
  8. SYS_write :: uintptr(1)
  9. SYS_open :: uintptr(2)
  10. SYS_close :: uintptr(3)
  11. SYS_stat :: uintptr(4)
  12. SYS_fstat :: uintptr(5)
  13. SYS_lstat :: uintptr(6)
  14. SYS_poll :: uintptr(7)
  15. SYS_lseek :: uintptr(8)
  16. SYS_mmap :: uintptr(9)
  17. SYS_mprotect :: uintptr(10)
  18. SYS_munmap :: uintptr(11)
  19. SYS_brk :: uintptr(12)
  20. SYS_rt_sigaction :: uintptr(13)
  21. SYS_rt_sigprocmask :: uintptr(14)
  22. SYS_rt_sigreturn :: uintptr(15)
  23. SYS_ioctl :: uintptr(16)
  24. SYS_pread64 :: uintptr(17)
  25. SYS_pwrite64 :: uintptr(18)
  26. SYS_readv :: uintptr(19)
  27. SYS_writev :: uintptr(20)
  28. SYS_access :: uintptr(21)
  29. SYS_pipe :: uintptr(22)
  30. SYS_select :: uintptr(23)
  31. SYS_sched_yield :: uintptr(24)
  32. SYS_mremap :: uintptr(25)
  33. SYS_msync :: uintptr(26)
  34. SYS_mincore :: uintptr(27)
  35. SYS_madvise :: uintptr(28)
  36. SYS_shmget :: uintptr(29)
  37. SYS_shmat :: uintptr(30)
  38. SYS_shmctl :: uintptr(31)
  39. SYS_dup :: uintptr(32)
  40. SYS_dup2 :: uintptr(33)
  41. SYS_pause :: uintptr(34)
  42. SYS_nanosleep :: uintptr(35)
  43. SYS_getitimer :: uintptr(36)
  44. SYS_alarm :: uintptr(37)
  45. SYS_setitimer :: uintptr(38)
  46. SYS_getpid :: uintptr(39)
  47. SYS_sendfile :: uintptr(40)
  48. SYS_socket :: uintptr(41)
  49. SYS_connect :: uintptr(42)
  50. SYS_accept :: uintptr(43)
  51. SYS_sendto :: uintptr(44)
  52. SYS_recvfrom :: uintptr(45)
  53. SYS_sendmsg :: uintptr(46)
  54. SYS_recvmsg :: uintptr(47)
  55. SYS_shutdown :: uintptr(48)
  56. SYS_bind :: uintptr(49)
  57. SYS_listen :: uintptr(50)
  58. SYS_getsockname :: uintptr(51)
  59. SYS_getpeername :: uintptr(52)
  60. SYS_socketpair :: uintptr(53)
  61. SYS_setsockopt :: uintptr(54)
  62. SYS_getsockopt :: uintptr(55)
  63. SYS_clone :: uintptr(56)
  64. SYS_fork :: uintptr(57)
  65. SYS_vfork :: uintptr(58)
  66. SYS_execve :: uintptr(59)
  67. SYS_exit :: uintptr(60)
  68. SYS_wait4 :: uintptr(61)
  69. SYS_kill :: uintptr(62)
  70. SYS_uname :: uintptr(63)
  71. SYS_semget :: uintptr(64)
  72. SYS_semop :: uintptr(65)
  73. SYS_semctl :: uintptr(66)
  74. SYS_shmdt :: uintptr(67)
  75. SYS_msgget :: uintptr(68)
  76. SYS_msgsnd :: uintptr(69)
  77. SYS_msgrcv :: uintptr(70)
  78. SYS_msgctl :: uintptr(71)
  79. SYS_fcntl :: uintptr(72)
  80. SYS_flock :: uintptr(73)
  81. SYS_fsync :: uintptr(74)
  82. SYS_fdatasync :: uintptr(75)
  83. SYS_truncate :: uintptr(76)
  84. SYS_ftruncate :: uintptr(77)
  85. SYS_getdents :: uintptr(78)
  86. SYS_getcwd :: uintptr(79)
  87. SYS_chdir :: uintptr(80)
  88. SYS_fchdir :: uintptr(81)
  89. SYS_rename :: uintptr(82)
  90. SYS_mkdir :: uintptr(83)
  91. SYS_rmdir :: uintptr(84)
  92. SYS_creat :: uintptr(85)
  93. SYS_link :: uintptr(86)
  94. SYS_unlink :: uintptr(87)
  95. SYS_symlink :: uintptr(88)
  96. SYS_readlink :: uintptr(89)
  97. SYS_chmod :: uintptr(90)
  98. SYS_fchmod :: uintptr(91)
  99. SYS_chown :: uintptr(92)
  100. SYS_fchown :: uintptr(93)
  101. SYS_lchown :: uintptr(94)
  102. SYS_umask :: uintptr(95)
  103. SYS_gettimeofday :: uintptr(96)
  104. SYS_getrlimit :: uintptr(97)
  105. SYS_getrusage :: uintptr(98)
  106. SYS_sysinfo :: uintptr(99)
  107. SYS_times :: uintptr(100)
  108. SYS_ptrace :: uintptr(101)
  109. SYS_getuid :: uintptr(102)
  110. SYS_syslog :: uintptr(103)
  111. SYS_getgid :: uintptr(104)
  112. SYS_setuid :: uintptr(105)
  113. SYS_setgid :: uintptr(106)
  114. SYS_geteuid :: uintptr(107)
  115. SYS_getegid :: uintptr(108)
  116. SYS_setpgid :: uintptr(109)
  117. SYS_getppid :: uintptr(110)
  118. SYS_getpgrp :: uintptr(111)
  119. SYS_setsid :: uintptr(112)
  120. SYS_setreuid :: uintptr(113)
  121. SYS_setregid :: uintptr(114)
  122. SYS_getgroups :: uintptr(115)
  123. SYS_setgroups :: uintptr(116)
  124. SYS_setresuid :: uintptr(117)
  125. SYS_getresuid :: uintptr(118)
  126. SYS_setresgid :: uintptr(119)
  127. SYS_getresgid :: uintptr(120)
  128. SYS_getpgid :: uintptr(121)
  129. SYS_setfsuid :: uintptr(122)
  130. SYS_setfsgid :: uintptr(123)
  131. SYS_getsid :: uintptr(124)
  132. SYS_capget :: uintptr(125)
  133. SYS_capset :: uintptr(126)
  134. SYS_rt_sigpending :: uintptr(127)
  135. SYS_rt_sigtimedwait :: uintptr(128)
  136. SYS_rt_sigqueueinfo :: uintptr(129)
  137. SYS_rt_sigsuspend :: uintptr(130)
  138. SYS_sigaltstack :: uintptr(131)
  139. SYS_utime :: uintptr(132)
  140. SYS_mknod :: uintptr(133)
  141. SYS_uselib :: uintptr(134)
  142. SYS_personality :: uintptr(135)
  143. SYS_ustat :: uintptr(136)
  144. SYS_statfs :: uintptr(137)
  145. SYS_fstatfs :: uintptr(138)
  146. SYS_sysfs :: uintptr(139)
  147. SYS_getpriority :: uintptr(140)
  148. SYS_setpriority :: uintptr(141)
  149. SYS_sched_setparam :: uintptr(142)
  150. SYS_sched_getparam :: uintptr(143)
  151. SYS_sched_setscheduler :: uintptr(144)
  152. SYS_sched_getscheduler :: uintptr(145)
  153. SYS_sched_get_priority_max :: uintptr(146)
  154. SYS_sched_get_priority_min :: uintptr(147)
  155. SYS_sched_rr_get_interval :: uintptr(148)
  156. SYS_mlock :: uintptr(149)
  157. SYS_munlock :: uintptr(150)
  158. SYS_mlockall :: uintptr(151)
  159. SYS_munlockall :: uintptr(152)
  160. SYS_vhangup :: uintptr(153)
  161. SYS_modify_ldt :: uintptr(154)
  162. SYS_pivot_root :: uintptr(155)
  163. SYS__sysctl :: uintptr(156)
  164. SYS_prctl :: uintptr(157)
  165. SYS_arch_prctl :: uintptr(158)
  166. SYS_adjtimex :: uintptr(159)
  167. SYS_setrlimit :: uintptr(160)
  168. SYS_chroot :: uintptr(161)
  169. SYS_sync :: uintptr(162)
  170. SYS_acct :: uintptr(163)
  171. SYS_settimeofday :: uintptr(164)
  172. SYS_mount :: uintptr(165)
  173. SYS_umount2 :: uintptr(166)
  174. SYS_swapon :: uintptr(167)
  175. SYS_swapoff :: uintptr(168)
  176. SYS_reboot :: uintptr(169)
  177. SYS_sethostname :: uintptr(170)
  178. SYS_setdomainname :: uintptr(171)
  179. SYS_iopl :: uintptr(172)
  180. SYS_ioperm :: uintptr(173)
  181. SYS_create_module :: uintptr(174)
  182. SYS_init_module :: uintptr(175)
  183. SYS_delete_module :: uintptr(176)
  184. SYS_get_kernel_syms :: uintptr(177)
  185. SYS_query_module :: uintptr(178)
  186. SYS_quotactl :: uintptr(179)
  187. SYS_nfsservctl :: uintptr(180)
  188. SYS_getpmsg :: uintptr(181)
  189. SYS_putpmsg :: uintptr(182)
  190. SYS_afs_syscall :: uintptr(183)
  191. SYS_tuxcall :: uintptr(184)
  192. SYS_security :: uintptr(185)
  193. SYS_gettid :: uintptr(186)
  194. SYS_readahead :: uintptr(187)
  195. SYS_setxattr :: uintptr(188)
  196. SYS_lsetxattr :: uintptr(189)
  197. SYS_fsetxattr :: uintptr(190)
  198. SYS_getxattr :: uintptr(191)
  199. SYS_lgetxattr :: uintptr(192)
  200. SYS_fgetxattr :: uintptr(193)
  201. SYS_listxattr :: uintptr(194)
  202. SYS_llistxattr :: uintptr(195)
  203. SYS_flistxattr :: uintptr(196)
  204. SYS_removexattr :: uintptr(197)
  205. SYS_lremovexattr :: uintptr(198)
  206. SYS_fremovexattr :: uintptr(199)
  207. SYS_tkill :: uintptr(200)
  208. SYS_time :: uintptr(201)
  209. SYS_futex :: uintptr(202)
  210. SYS_sched_setaffinity :: uintptr(203)
  211. SYS_sched_getaffinity :: uintptr(204)
  212. SYS_set_thread_area :: uintptr(205)
  213. SYS_io_setup :: uintptr(206)
  214. SYS_io_destroy :: uintptr(207)
  215. SYS_io_getevents :: uintptr(208)
  216. SYS_io_submit :: uintptr(209)
  217. SYS_io_cancel :: uintptr(210)
  218. SYS_get_thread_area :: uintptr(211)
  219. SYS_lookup_dcookie :: uintptr(212)
  220. SYS_epoll_create :: uintptr(213)
  221. SYS_epoll_ctl_old :: uintptr(214)
  222. SYS_epoll_wait_old :: uintptr(215)
  223. SYS_remap_file_pages :: uintptr(216)
  224. SYS_getdents64 :: uintptr(217)
  225. SYS_set_tid_address :: uintptr(218)
  226. SYS_restart_syscall :: uintptr(219)
  227. SYS_semtimedop :: uintptr(220)
  228. SYS_fadvise64 :: uintptr(221)
  229. SYS_timer_create :: uintptr(222)
  230. SYS_timer_settime :: uintptr(223)
  231. SYS_timer_gettime :: uintptr(224)
  232. SYS_timer_getoverrun :: uintptr(225)
  233. SYS_timer_delete :: uintptr(226)
  234. SYS_clock_settime :: uintptr(227)
  235. SYS_clock_gettime :: uintptr(228)
  236. SYS_clock_getres :: uintptr(229)
  237. SYS_clock_nanosleep :: uintptr(230)
  238. SYS_exit_group :: uintptr(231)
  239. SYS_epoll_wait :: uintptr(232)
  240. SYS_epoll_ctl :: uintptr(233)
  241. SYS_tgkill :: uintptr(234)
  242. SYS_utimes :: uintptr(235)
  243. SYS_vserver :: uintptr(236)
  244. SYS_mbind :: uintptr(237)
  245. SYS_set_mempolicy :: uintptr(238)
  246. SYS_get_mempolicy :: uintptr(239)
  247. SYS_mq_open :: uintptr(240)
  248. SYS_mq_unlink :: uintptr(241)
  249. SYS_mq_timedsend :: uintptr(242)
  250. SYS_mq_timedreceive :: uintptr(243)
  251. SYS_mq_notify :: uintptr(244)
  252. SYS_mq_getsetattr :: uintptr(245)
  253. SYS_kexec_load :: uintptr(246)
  254. SYS_waitid :: uintptr(247)
  255. SYS_add_key :: uintptr(248)
  256. SYS_request_key :: uintptr(249)
  257. SYS_keyctl :: uintptr(250)
  258. SYS_ioprio_set :: uintptr(251)
  259. SYS_ioprio_get :: uintptr(252)
  260. SYS_inotify_init :: uintptr(253)
  261. SYS_inotify_add_watch :: uintptr(254)
  262. SYS_inotify_rm_watch :: uintptr(255)
  263. SYS_migrate_pages :: uintptr(256)
  264. SYS_openat :: uintptr(257)
  265. SYS_mkdirat :: uintptr(258)
  266. SYS_mknodat :: uintptr(259)
  267. SYS_fchownat :: uintptr(260)
  268. SYS_futimesat :: uintptr(261)
  269. SYS_newfstatat :: uintptr(262)
  270. SYS_unlinkat :: uintptr(263)
  271. SYS_renameat :: uintptr(264)
  272. SYS_linkat :: uintptr(265)
  273. SYS_symlinkat :: uintptr(266)
  274. SYS_readlinkat :: uintptr(267)
  275. SYS_fchmodat :: uintptr(268)
  276. SYS_faccessat :: uintptr(269)
  277. SYS_pselect6 :: uintptr(270)
  278. SYS_ppoll :: uintptr(271)
  279. SYS_unshare :: uintptr(272)
  280. SYS_set_robust_list :: uintptr(273)
  281. SYS_get_robust_list :: uintptr(274)
  282. SYS_splice :: uintptr(275)
  283. SYS_tee :: uintptr(276)
  284. SYS_sync_file_range :: uintptr(277)
  285. SYS_vmsplice :: uintptr(278)
  286. SYS_move_pages :: uintptr(279)
  287. SYS_utimensat :: uintptr(280)
  288. SYS_epoll_pwait :: uintptr(281)
  289. SYS_signalfd :: uintptr(282)
  290. SYS_timerfd_create :: uintptr(283)
  291. SYS_eventfd :: uintptr(284)
  292. SYS_fallocate :: uintptr(285)
  293. SYS_timerfd_settime :: uintptr(286)
  294. SYS_timerfd_gettime :: uintptr(287)
  295. SYS_accept4 :: uintptr(288)
  296. SYS_signalfd4 :: uintptr(289)
  297. SYS_eventfd2 :: uintptr(290)
  298. SYS_epoll_create1 :: uintptr(291)
  299. SYS_dup3 :: uintptr(292)
  300. SYS_pipe2 :: uintptr(293)
  301. SYS_inotify_init1 :: uintptr(294)
  302. SYS_preadv :: uintptr(295)
  303. SYS_pwritev :: uintptr(296)
  304. SYS_rt_tgsigqueueinfo :: uintptr(297)
  305. SYS_perf_event_open :: uintptr(298)
  306. SYS_recvmmsg :: uintptr(299)
  307. SYS_fanotify_init :: uintptr(300)
  308. SYS_fanotify_mark :: uintptr(301)
  309. SYS_prlimit64 :: uintptr(302)
  310. SYS_name_to_handle_at :: uintptr(303)
  311. SYS_open_by_handle_at :: uintptr(304)
  312. SYS_clock_adjtime :: uintptr(305)
  313. SYS_syncfs :: uintptr(306)
  314. SYS_sendmmsg :: uintptr(307)
  315. SYS_setns :: uintptr(308)
  316. SYS_getcpu :: uintptr(309)
  317. SYS_process_vm_readv :: uintptr(310)
  318. SYS_process_vm_writev :: uintptr(311)
  319. SYS_kcmp :: uintptr(312)
  320. SYS_finit_module :: uintptr(313)
  321. SYS_sched_setattr :: uintptr(314)
  322. SYS_sched_getattr :: uintptr(315)
  323. SYS_renameat2 :: uintptr(316)
  324. SYS_seccomp :: uintptr(317)
  325. SYS_getrandom :: uintptr(318)
  326. SYS_memfd_create :: uintptr(319)
  327. SYS_kexec_file_load :: uintptr(320)
  328. SYS_bpf :: uintptr(321)
  329. SYS_execveat :: uintptr(322)
  330. SYS_userfaultfd :: uintptr(323)
  331. SYS_membarrier :: uintptr(324)
  332. SYS_mlock2 :: uintptr(325)
  333. SYS_copy_file_range :: uintptr(326)
  334. SYS_preadv2 :: uintptr(327)
  335. SYS_pwritev2 :: uintptr(328)
  336. SYS_pkey_mprotect :: uintptr(329)
  337. SYS_pkey_alloc :: uintptr(330)
  338. SYS_pkey_free :: uintptr(331)
  339. SYS_statx :: uintptr(332)
  340. SYS_io_pgetevents :: uintptr(333)
  341. SYS_rseq :: uintptr(334)
  342. SYS_pidfd_send_signal :: uintptr(424)
  343. SYS_io_uring_setup :: uintptr(425)
  344. SYS_io_uring_enter :: uintptr(426)
  345. SYS_io_uring_register :: uintptr(427)
  346. SYS_open_tree :: uintptr(428)
  347. SYS_move_mount :: uintptr(429)
  348. SYS_fsopen :: uintptr(430)
  349. SYS_fsconfig :: uintptr(431)
  350. SYS_fsmount :: uintptr(432)
  351. SYS_fspick :: uintptr(433)
  352. SYS_pidfd_open :: uintptr(434)
  353. SYS_clone3 :: uintptr(435)
  354. SYS_close_range :: uintptr(436)
  355. SYS_openat2 :: uintptr(437)
  356. SYS_pidfd_getfd :: uintptr(438)
  357. SYS_faccessat2 :: uintptr(439)
  358. SYS_process_madvise :: uintptr(440)
  359. SYS_epoll_pwait2 :: uintptr(441)
  360. SYS_mount_setattr :: uintptr(442)
  361. SYS_quotactl_fd :: uintptr(443)
  362. SYS_landlock_create_ruleset :: uintptr(444)
  363. SYS_landlock_add_rule :: uintptr(445)
  364. SYS_landlock_restrict_self :: uintptr(446)
  365. SYS_memfd_secret :: uintptr(447)
  366. SYS_process_mrelease :: uintptr(448)
  367. SYS_futex_waitv :: uintptr(449)
  368. SYS_set_mempolicy_home_node :: uintptr(450)
  369. SYS_cachestat :: uintptr(451)
  370. SYS_fchmodat2 :: uintptr(452)
  371. SYS_map_shadow_stack :: uintptr(453)