| author | |
| committer | |
| log | d61e4ef8b00f8c66389c5bf614d701cafc23b1ae |
| tree | 933e86b151cf6a895d77e8474d270ba96d0f9951 |
| parent | 43878f51d94a6c6297053fff37426fa556b1ef9c |
| signature |
Also update the syscalls file based on Linux 6.10. No diffs other than x32.3 files changed, 393 insertions(+), 8 deletions(-)
lib/std/os/linux.zig+11-8| ... | @@ -122,17 +122,11 @@ pub const SECCOMP = @import("linux/seccomp.zig"); | ... | @@ -122,17 +122,11 @@ pub const SECCOMP = @import("linux/seccomp.zig"); |
| 122 | 122 | ||
| 123 | pub const syscalls = @import("linux/syscalls.zig"); | 123 | pub const syscalls = @import("linux/syscalls.zig"); |
| 124 | pub const SYS = switch (@import("builtin").cpu.arch) { | 124 | pub const SYS = switch (@import("builtin").cpu.arch) { |
| 125 | .x86 => syscalls.X86, | ||
| 126 | .x86_64 => syscalls.X64, | ||
| 127 | .aarch64, .aarch64_be => syscalls.Arm64, | ||
| 128 | .arc => syscalls.Arc, | 125 | .arc => syscalls.Arc, |
| 129 | .arm, .armeb, .thumb, .thumbeb => syscalls.Arm, | 126 | .arm, .armeb, .thumb, .thumbeb => syscalls.Arm, |
| 127 | .aarch64, .aarch64_be => syscalls.Arm64, | ||
| 130 | .csky => syscalls.CSky, | 128 | .csky => syscalls.CSky, |
| 131 | .hexagon => syscalls.Hexagon, | 129 | .hexagon => syscalls.Hexagon, |
| 132 | .riscv32 => syscalls.RiscV32, | ||
| 133 | .riscv64 => syscalls.RiscV64, | ||
| 134 | .sparc => syscalls.Sparc, | ||
| 135 | .sparc64 => syscalls.Sparc64, | ||
| 136 | .loongarch64 => syscalls.LoongArch64, | 130 | .loongarch64 => syscalls.LoongArch64, |
| 137 | .m68k => syscalls.M68k, | 131 | .m68k => syscalls.M68k, |
| 138 | .mips, .mipsel => syscalls.MipsO32, | 132 | .mips, .mipsel => syscalls.MipsO32, |
| ... | @@ -140,9 +134,18 @@ pub const SYS = switch (@import("builtin").cpu.arch) { | ... | @@ -140,9 +134,18 @@ pub const SYS = switch (@import("builtin").cpu.arch) { |
| 140 | .gnuabin32, .muslabin32 => syscalls.MipsN32, | 134 | .gnuabin32, .muslabin32 => syscalls.MipsN32, |
| 141 | else => syscalls.MipsN64, | 135 | else => syscalls.MipsN64, |
| 142 | }, | 136 | }, |
| 137 | .riscv32 => syscalls.RiscV32, | ||
| 138 | .riscv64 => syscalls.RiscV64, | ||
| 139 | .s390x => syscalls.S390x, | ||
| 140 | .sparc => syscalls.Sparc, | ||
| 141 | .sparc64 => syscalls.Sparc64, | ||
| 143 | .powerpc, .powerpcle => syscalls.PowerPC, | 142 | .powerpc, .powerpcle => syscalls.PowerPC, |
| 144 | .powerpc64, .powerpc64le => syscalls.PowerPC64, | 143 | .powerpc64, .powerpc64le => syscalls.PowerPC64, |
| 145 | .s390x => syscalls.S390x, | 144 | .x86 => syscalls.X86, |
| 145 | .x86_64 => switch (builtin.abi) { | ||
| 146 | .gnux32, .muslx32 => syscalls.X32, | ||
| 147 | else => syscalls.X64, | ||
| 148 | }, | ||
| 146 | .xtensa => syscalls.Xtensa, | 149 | .xtensa => syscalls.Xtensa, |
| 147 | else => @compileError("The Zig Standard Library is missing syscall definitions for the target CPU architecture"), | 150 | else => @compileError("The Zig Standard Library is missing syscall definitions for the target CPU architecture"), |
| 148 | }; | 151 | }; |
lib/std/os/linux/syscalls.zig+366| ... | @@ -833,6 +833,372 @@ pub const X64 = enum(usize) { | ... | @@ -833,6 +833,372 @@ pub const X64 = enum(usize) { |
| 833 | mseal = 462, | 833 | mseal = 462, |
| 834 | }; | 834 | }; |
| 835 | 835 | ||
| 836 | pub const X32 = enum(usize) { | ||
| 837 | read = 0, | ||
| 838 | write = 1, | ||
| 839 | open = 2, | ||
| 840 | close = 3, | ||
| 841 | stat = 4, | ||
| 842 | fstat = 5, | ||
| 843 | lstat = 6, | ||
| 844 | poll = 7, | ||
| 845 | lseek = 8, | ||
| 846 | mmap = 9, | ||
| 847 | mprotect = 10, | ||
| 848 | munmap = 11, | ||
| 849 | brk = 12, | ||
| 850 | rt_sigprocmask = 14, | ||
| 851 | pread64 = 17, | ||
| 852 | pwrite64 = 18, | ||
| 853 | access = 21, | ||
| 854 | pipe = 22, | ||
| 855 | select = 23, | ||
| 856 | sched_yield = 24, | ||
| 857 | mremap = 25, | ||
| 858 | msync = 26, | ||
| 859 | mincore = 27, | ||
| 860 | madvise = 28, | ||
| 861 | shmget = 29, | ||
| 862 | shmat = 30, | ||
| 863 | shmctl = 31, | ||
| 864 | dup = 32, | ||
| 865 | dup2 = 33, | ||
| 866 | pause = 34, | ||
| 867 | nanosleep = 35, | ||
| 868 | getitimer = 36, | ||
| 869 | alarm = 37, | ||
| 870 | setitimer = 38, | ||
| 871 | getpid = 39, | ||
| 872 | sendfile = 40, | ||
| 873 | socket = 41, | ||
| 874 | connect = 42, | ||
| 875 | accept = 43, | ||
| 876 | sendto = 44, | ||
| 877 | shutdown = 48, | ||
| 878 | bind = 49, | ||
| 879 | listen = 50, | ||
| 880 | getsockname = 51, | ||
| 881 | getpeername = 52, | ||
| 882 | socketpair = 53, | ||
| 883 | clone = 56, | ||
| 884 | fork = 57, | ||
| 885 | vfork = 58, | ||
| 886 | exit = 60, | ||
| 887 | wait4 = 61, | ||
| 888 | kill = 62, | ||
| 889 | uname = 63, | ||
| 890 | semget = 64, | ||
| 891 | semop = 65, | ||
| 892 | semctl = 66, | ||
| 893 | shmdt = 67, | ||
| 894 | msgget = 68, | ||
| 895 | msgsnd = 69, | ||
| 896 | msgrcv = 70, | ||
| 897 | msgctl = 71, | ||
| 898 | fcntl = 72, | ||
| 899 | flock = 73, | ||
| 900 | fsync = 74, | ||
| 901 | fdatasync = 75, | ||
| 902 | truncate = 76, | ||
| 903 | ftruncate = 77, | ||
| 904 | getdents = 78, | ||
| 905 | getcwd = 79, | ||
| 906 | chdir = 80, | ||
| 907 | fchdir = 81, | ||
| 908 | rename = 82, | ||
| 909 | mkdir = 83, | ||
| 910 | rmdir = 84, | ||
| 911 | creat = 85, | ||
| 912 | link = 86, | ||
| 913 | unlink = 87, | ||
| 914 | symlink = 88, | ||
| 915 | readlink = 89, | ||
| 916 | chmod = 90, | ||
| 917 | fchmod = 91, | ||
| 918 | chown = 92, | ||
| 919 | fchown = 93, | ||
| 920 | lchown = 94, | ||
| 921 | umask = 95, | ||
| 922 | gettimeofday = 96, | ||
| 923 | getrlimit = 97, | ||
| 924 | getrusage = 98, | ||
| 925 | sysinfo = 99, | ||
| 926 | times = 100, | ||
| 927 | getuid = 102, | ||
| 928 | syslog = 103, | ||
| 929 | getgid = 104, | ||
| 930 | setuid = 105, | ||
| 931 | setgid = 106, | ||
| 932 | geteuid = 107, | ||
| 933 | getegid = 108, | ||
| 934 | setpgid = 109, | ||
| 935 | getppid = 110, | ||
| 936 | getpgrp = 111, | ||
| 937 | setsid = 112, | ||
| 938 | setreuid = 113, | ||
| 939 | setregid = 114, | ||
| 940 | getgroups = 115, | ||
| 941 | setgroups = 116, | ||
| 942 | setresuid = 117, | ||
| 943 | getresuid = 118, | ||
| 944 | setresgid = 119, | ||
| 945 | getresgid = 120, | ||
| 946 | getpgid = 121, | ||
| 947 | setfsuid = 122, | ||
| 948 | setfsgid = 123, | ||
| 949 | getsid = 124, | ||
| 950 | capget = 125, | ||
| 951 | capset = 126, | ||
| 952 | rt_sigsuspend = 130, | ||
| 953 | utime = 132, | ||
| 954 | mknod = 133, | ||
| 955 | personality = 135, | ||
| 956 | ustat = 136, | ||
| 957 | statfs = 137, | ||
| 958 | fstatfs = 138, | ||
| 959 | sysfs = 139, | ||
| 960 | getpriority = 140, | ||
| 961 | setpriority = 141, | ||
| 962 | sched_setparam = 142, | ||
| 963 | sched_getparam = 143, | ||
| 964 | sched_setscheduler = 144, | ||
| 965 | sched_getscheduler = 145, | ||
| 966 | sched_get_priority_max = 146, | ||
| 967 | sched_get_priority_min = 147, | ||
| 968 | sched_rr_get_interval = 148, | ||
| 969 | mlock = 149, | ||
| 970 | munlock = 150, | ||
| 971 | mlockall = 151, | ||
| 972 | munlockall = 152, | ||
| 973 | vhangup = 153, | ||
| 974 | modify_ldt = 154, | ||
| 975 | pivot_root = 155, | ||
| 976 | prctl = 157, | ||
| 977 | arch_prctl = 158, | ||
| 978 | adjtimex = 159, | ||
| 979 | setrlimit = 160, | ||
| 980 | chroot = 161, | ||
| 981 | sync = 162, | ||
| 982 | acct = 163, | ||
| 983 | settimeofday = 164, | ||
| 984 | mount = 165, | ||
| 985 | umount2 = 166, | ||
| 986 | swapon = 167, | ||
| 987 | swapoff = 168, | ||
| 988 | reboot = 169, | ||
| 989 | sethostname = 170, | ||
| 990 | setdomainname = 171, | ||
| 991 | iopl = 172, | ||
| 992 | ioperm = 173, | ||
| 993 | init_module = 175, | ||
| 994 | delete_module = 176, | ||
| 995 | quotactl = 179, | ||
| 996 | getpmsg = 181, | ||
| 997 | putpmsg = 182, | ||
| 998 | afs_syscall = 183, | ||
| 999 | tuxcall = 184, | ||
| 1000 | security = 185, | ||
| 1001 | gettid = 186, | ||
| 1002 | readahead = 187, | ||
| 1003 | setxattr = 188, | ||
| 1004 | lsetxattr = 189, | ||
| 1005 | fsetxattr = 190, | ||
| 1006 | getxattr = 191, | ||
| 1007 | lgetxattr = 192, | ||
| 1008 | fgetxattr = 193, | ||
| 1009 | listxattr = 194, | ||
| 1010 | llistxattr = 195, | ||
| 1011 | flistxattr = 196, | ||
| 1012 | removexattr = 197, | ||
| 1013 | lremovexattr = 198, | ||
| 1014 | fremovexattr = 199, | ||
| 1015 | tkill = 200, | ||
| 1016 | time = 201, | ||
| 1017 | futex = 202, | ||
| 1018 | sched_setaffinity = 203, | ||
| 1019 | sched_getaffinity = 204, | ||
| 1020 | io_destroy = 207, | ||
| 1021 | io_getevents = 208, | ||
| 1022 | io_cancel = 210, | ||
| 1023 | lookup_dcookie = 212, | ||
| 1024 | epoll_create = 213, | ||
| 1025 | remap_file_pages = 216, | ||
| 1026 | getdents64 = 217, | ||
| 1027 | set_tid_address = 218, | ||
| 1028 | restart_syscall = 219, | ||
| 1029 | semtimedop = 220, | ||
| 1030 | fadvise64 = 221, | ||
| 1031 | timer_settime = 223, | ||
| 1032 | timer_gettime = 224, | ||
| 1033 | timer_getoverrun = 225, | ||
| 1034 | timer_delete = 226, | ||
| 1035 | clock_settime = 227, | ||
| 1036 | clock_gettime = 228, | ||
| 1037 | clock_getres = 229, | ||
| 1038 | clock_nanosleep = 230, | ||
| 1039 | exit_group = 231, | ||
| 1040 | epoll_wait = 232, | ||
| 1041 | epoll_ctl = 233, | ||
| 1042 | tgkill = 234, | ||
| 1043 | utimes = 235, | ||
| 1044 | mbind = 237, | ||
| 1045 | set_mempolicy = 238, | ||
| 1046 | get_mempolicy = 239, | ||
| 1047 | mq_open = 240, | ||
| 1048 | mq_unlink = 241, | ||
| 1049 | mq_timedsend = 242, | ||
| 1050 | mq_timedreceive = 243, | ||
| 1051 | mq_getsetattr = 245, | ||
| 1052 | add_key = 248, | ||
| 1053 | request_key = 249, | ||
| 1054 | keyctl = 250, | ||
| 1055 | ioprio_set = 251, | ||
| 1056 | ioprio_get = 252, | ||
| 1057 | inotify_init = 253, | ||
| 1058 | inotify_add_watch = 254, | ||
| 1059 | inotify_rm_watch = 255, | ||
| 1060 | migrate_pages = 256, | ||
| 1061 | openat = 257, | ||
| 1062 | mkdirat = 258, | ||
| 1063 | mknodat = 259, | ||
| 1064 | fchownat = 260, | ||
| 1065 | futimesat = 261, | ||
| 1066 | fstatat64 = 262, | ||
| 1067 | unlinkat = 263, | ||
| 1068 | renameat = 264, | ||
| 1069 | linkat = 265, | ||
| 1070 | symlinkat = 266, | ||
| 1071 | readlinkat = 267, | ||
| 1072 | fchmodat = 268, | ||
| 1073 | faccessat = 269, | ||
| 1074 | pselect6 = 270, | ||
| 1075 | ppoll = 271, | ||
| 1076 | unshare = 272, | ||
| 1077 | splice = 275, | ||
| 1078 | tee = 276, | ||
| 1079 | sync_file_range = 277, | ||
| 1080 | utimensat = 280, | ||
| 1081 | epoll_pwait = 281, | ||
| 1082 | signalfd = 282, | ||
| 1083 | timerfd_create = 283, | ||
| 1084 | eventfd = 284, | ||
| 1085 | fallocate = 285, | ||
| 1086 | timerfd_settime = 286, | ||
| 1087 | timerfd_gettime = 287, | ||
| 1088 | accept4 = 288, | ||
| 1089 | signalfd4 = 289, | ||
| 1090 | eventfd2 = 290, | ||
| 1091 | epoll_create1 = 291, | ||
| 1092 | dup3 = 292, | ||
| 1093 | pipe2 = 293, | ||
| 1094 | inotify_init1 = 294, | ||
| 1095 | perf_event_open = 298, | ||
| 1096 | fanotify_init = 300, | ||
| 1097 | fanotify_mark = 301, | ||
| 1098 | prlimit64 = 302, | ||
| 1099 | name_to_handle_at = 303, | ||
| 1100 | open_by_handle_at = 304, | ||
| 1101 | clock_adjtime = 305, | ||
| 1102 | syncfs = 306, | ||
| 1103 | setns = 308, | ||
| 1104 | getcpu = 309, | ||
| 1105 | kcmp = 312, | ||
| 1106 | finit_module = 313, | ||
| 1107 | sched_setattr = 314, | ||
| 1108 | sched_getattr = 315, | ||
| 1109 | renameat2 = 316, | ||
| 1110 | seccomp = 317, | ||
| 1111 | getrandom = 318, | ||
| 1112 | memfd_create = 319, | ||
| 1113 | kexec_file_load = 320, | ||
| 1114 | bpf = 321, | ||
| 1115 | userfaultfd = 323, | ||
| 1116 | membarrier = 324, | ||
| 1117 | mlock2 = 325, | ||
| 1118 | copy_file_range = 326, | ||
| 1119 | pkey_mprotect = 329, | ||
| 1120 | pkey_alloc = 330, | ||
| 1121 | pkey_free = 331, | ||
| 1122 | statx = 332, | ||
| 1123 | io_pgetevents = 333, | ||
| 1124 | rseq = 334, | ||
| 1125 | pidfd_send_signal = 424, | ||
| 1126 | io_uring_setup = 425, | ||
| 1127 | io_uring_enter = 426, | ||
| 1128 | io_uring_register = 427, | ||
| 1129 | open_tree = 428, | ||
| 1130 | move_mount = 429, | ||
| 1131 | fsopen = 430, | ||
| 1132 | fsconfig = 431, | ||
| 1133 | fsmount = 432, | ||
| 1134 | fspick = 433, | ||
| 1135 | pidfd_open = 434, | ||
| 1136 | clone3 = 435, | ||
| 1137 | close_range = 436, | ||
| 1138 | openat2 = 437, | ||
| 1139 | pidfd_getfd = 438, | ||
| 1140 | faccessat2 = 439, | ||
| 1141 | process_madvise = 440, | ||
| 1142 | epoll_pwait2 = 441, | ||
| 1143 | mount_setattr = 442, | ||
| 1144 | quotactl_fd = 443, | ||
| 1145 | landlock_create_ruleset = 444, | ||
| 1146 | landlock_add_rule = 445, | ||
| 1147 | landlock_restrict_self = 446, | ||
| 1148 | memfd_secret = 447, | ||
| 1149 | process_mrelease = 448, | ||
| 1150 | futex_waitv = 449, | ||
| 1151 | set_mempolicy_home_node = 450, | ||
| 1152 | cachestat = 451, | ||
| 1153 | fchmodat2 = 452, | ||
| 1154 | map_shadow_stack = 453, | ||
| 1155 | futex_wake = 454, | ||
| 1156 | futex_wait = 455, | ||
| 1157 | futex_requeue = 456, | ||
| 1158 | statmount = 457, | ||
| 1159 | listmount = 458, | ||
| 1160 | lsm_get_self_attr = 459, | ||
| 1161 | lsm_set_self_attr = 460, | ||
| 1162 | lsm_list_modules = 461, | ||
| 1163 | mseal = 462, | ||
| 1164 | rt_sigaction = 512, | ||
| 1165 | rt_sigreturn = 513, | ||
| 1166 | ioctl = 514, | ||
| 1167 | readv = 515, | ||
| 1168 | writev = 516, | ||
| 1169 | recvfrom = 517, | ||
| 1170 | sendmsg = 518, | ||
| 1171 | recvmsg = 519, | ||
| 1172 | execve = 520, | ||
| 1173 | ptrace = 521, | ||
| 1174 | rt_sigpending = 522, | ||
| 1175 | rt_sigtimedwait = 523, | ||
| 1176 | rt_sigqueueinfo = 524, | ||
| 1177 | sigaltstack = 525, | ||
| 1178 | timer_create = 526, | ||
| 1179 | mq_notify = 527, | ||
| 1180 | kexec_load = 528, | ||
| 1181 | waitid = 529, | ||
| 1182 | set_robust_list = 530, | ||
| 1183 | get_robust_list = 531, | ||
| 1184 | vmsplice = 532, | ||
| 1185 | move_pages = 533, | ||
| 1186 | preadv = 534, | ||
| 1187 | pwritev = 535, | ||
| 1188 | rt_tgsigqueueinfo = 536, | ||
| 1189 | recvmmsg = 537, | ||
| 1190 | sendmmsg = 538, | ||
| 1191 | process_vm_readv = 539, | ||
| 1192 | process_vm_writev = 540, | ||
| 1193 | setsockopt = 541, | ||
| 1194 | getsockopt = 542, | ||
| 1195 | io_setup = 543, | ||
| 1196 | io_submit = 544, | ||
| 1197 | execveat = 545, | ||
| 1198 | preadv2 = 546, | ||
| 1199 | pwritev2 = 547, | ||
| 1200 | }; | ||
| 1201 | |||
| 836 | pub const Arm = enum(usize) { | 1202 | pub const Arm = enum(usize) { |
| 837 | const arm_base = 0x0f0000; | 1203 | const arm_base = 0x0f0000; |
| 838 | 1204 |
tools/generate_linux_syscalls.zig+16| ... | @@ -162,6 +162,22 @@ const arch_infos = [_]ArchInfo{ | ... | @@ -162,6 +162,22 @@ const arch_infos = [_]ArchInfo{ |
| 162 | .additional_enum = null, | 162 | .additional_enum = null, |
| 163 | }, | 163 | }, |
| 164 | }, | 164 | }, |
| 165 | .{ | ||
| 166 | .table = .{ | ||
| 167 | .name = "x32", | ||
| 168 | .enum_name = "X32", | ||
| 169 | .file_path = "arch/x86/entry/syscalls/syscall_64.tbl", | ||
| 170 | .process_file = &processTableBasedArch, | ||
| 171 | .filters = .{ | ||
| 172 | .abiCheckParams = .{ .abi = "64", .flow = .@"continue" }, | ||
| 173 | .fixedName = &fixedName, | ||
| 174 | .isReservedNameOld = null, | ||
| 175 | }, | ||
| 176 | .header = null, | ||
| 177 | .extra_values = null, | ||
| 178 | .additional_enum = null, | ||
| 179 | }, | ||
| 180 | }, | ||
| 165 | .{ | 181 | .{ |
| 166 | .table = .{ | 182 | .table = .{ |
| 167 | .name = "arm", | 183 | .name = "arm", |