Update Linux syscall list for 6.1, support Mips64

Follow up for #14541.
This commit is contained in:
Stephen Gregoratto
2023-02-05 10:40:24 +11:00
committed by Andrew Kelley
parent 289e8fab79
commit d4ce0fe7fe
2 changed files with 35 additions and 6 deletions

View File

@@ -167,6 +167,31 @@ pub fn main() !void {
try writer.writeAll("};\n\n");
}
{
try writer.writeAll(
\\pub const Mips64 = enum(usize) {
\\ pub const Linux = 5000;
\\
\\
);
const table = try linux_dir.readFile("arch/mips/kernel/syscalls/syscall_n64.tbl", buf);
var lines = mem.tokenize(u8, table, "\n");
while (lines.next()) |line| {
if (line[0] == '#') continue;
var fields = mem.tokenize(u8, line, " \t");
const number = fields.next() orelse return error.Incomplete;
// abi is always n64
_ = fields.next() orelse return error.Incomplete;
const name = fields.next() orelse return error.Incomplete;
const fixed_name = if (stdlib_renames.get(name)) |fixed| fixed else name;
try writer.print(" {s} = Linux + {s},\n", .{ zig.fmtId(fixed_name), number });
}
try writer.writeAll("};\n\n");
}
{
try writer.writeAll("pub const PowerPC = enum(usize) {\n");