authorgravatar for dev@sgregoratto.meStephen Gregoratto <dev@sgregoratto.me> 2023-02-05 10:40:24+11:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-02-05 03:25:21-05:00
logd4ce0fe7fea14bae889e03464980e5eca7a2ed1f
treefb2de9ffca1fc869123b28d2521e89ffd846e7ea
parent289e8fab7949bebfc39209b86a69317a53e747f8

Update Linux syscall list for 6.1, support Mips64

Follow up for #14541.

2 files changed, 35 insertions(+), 6 deletions(-)

lib/std/os/linux/syscalls.zig+10-6
......@@ -2057,7 +2057,7 @@ pub const Mips64 = enum(usize) {
20572057 writev = Linux + 19,
20582058 access = Linux + 20,
20592059 pipe = Linux + 21,
2060 select = Linux + 22,
2060 _newselect = Linux + 22,
20612061 sched_yield = Linux + 23,
20622062 mremap = Linux + 24,
20632063 msync = Linux + 25,
......@@ -2071,8 +2071,8 @@ pub const Mips64 = enum(usize) {
20712071 pause = Linux + 33,
20722072 nanosleep = Linux + 34,
20732073 getitimer = Linux + 35,
2074 alarm = Linux + 36,
2075 setitimer = Linux + 37,
2074 setitimer = Linux + 36,
2075 alarm = Linux + 37,
20762076 getpid = Linux + 38,
20772077 sendfile = Linux + 39,
20782078 socket = Linux + 40,
......@@ -2286,7 +2286,7 @@ pub const Mips64 = enum(usize) {
22862286 mknodat = Linux + 249,
22872287 fchownat = Linux + 250,
22882288 futimesat = Linux + 251,
2289 newfstatat = Linux + 252,
2289 fstatat64 = Linux + 252,
22902290 unlinkat = Linux + 253,
22912291 renameat = Linux + 254,
22922292 linkat = Linux + 255,
......@@ -2315,8 +2315,8 @@ pub const Mips64 = enum(usize) {
23152315 eventfd = Linux + 278,
23162316 fallocate = Linux + 279,
23172317 timerfd_create = Linux + 280,
2318 timerfd_settime = Linux + 281,
2319 timerfd_gettime = Linux + 282,
2318 timerfd_gettime = Linux + 281,
2319 timerfd_settime = Linux + 282,
23202320 signalfd4 = Linux + 283,
23212321 eventfd2 = Linux + 284,
23222322 epoll_create1 = Linux + 285,
......@@ -2382,9 +2382,13 @@ pub const Mips64 = enum(usize) {
23822382 process_madvise = Linux + 440,
23832383 epoll_pwait2 = Linux + 441,
23842384 mount_setattr = Linux + 442,
2385 quotactl_fd = Linux + 443,
23852386 landlock_create_ruleset = Linux + 444,
23862387 landlock_add_rule = Linux + 445,
23872388 landlock_restrict_self = Linux + 446,
2389 process_mrelease = Linux + 448,
2390 futex_waitv = Linux + 449,
2391 set_mempolicy_home_node = Linux + 450,
23882392};
23892393
23902394pub const PowerPC = enum(usize) {
tools/generate_linux_syscalls.zig+25
......@@ -167,6 +167,31 @@ pub fn main() !void {
167167
168168 try writer.writeAll("};\n\n");
169169 }
170 {
171 try writer.writeAll(
172 \\pub const Mips64 = enum(usize) {
173 \\ pub const Linux = 5000;
174 \\
175 \\
176 );
177
178 const table = try linux_dir.readFile("arch/mips/kernel/syscalls/syscall_n64.tbl", buf);
179 var lines = mem.tokenize(u8, table, "\n");
180 while (lines.next()) |line| {
181 if (line[0] == '#') continue;
182
183 var fields = mem.tokenize(u8, line, " \t");
184 const number = fields.next() orelse return error.Incomplete;
185 // abi is always n64
186 _ = fields.next() orelse return error.Incomplete;
187 const name = fields.next() orelse return error.Incomplete;
188 const fixed_name = if (stdlib_renames.get(name)) |fixed| fixed else name;
189
190 try writer.print(" {s} = Linux + {s},\n", .{ zig.fmtId(fixed_name), number });
191 }
192
193 try writer.writeAll("};\n\n");
194 }
170195 {
171196 try writer.writeAll("pub const PowerPC = enum(usize) {\n");
172197