generate_linux_syscalls: Add generation code for m68k.

This commit is contained in:
Alex Rønne Petersen 2024-07-26 05:47:13 +02:00
parent 6e7d619dc3
commit 09914868ea
No known key found for this signature in database

View file

@ -186,6 +186,26 @@ pub fn main() !void {
try writer.writeAll("};\n\n");
}
{
try writer.writeAll("pub const M68k = enum(usize) {\n");
const table = try linux_dir.readFile("arch/m68k/kernel/syscalls/syscall.tbl", buf);
var lines = mem.tokenizeScalar(u8, table, '\n');
while (lines.next()) |line| {
if (line[0] == '#') continue;
var fields = mem.tokenizeAny(u8, line, " \t");
const number = fields.next() orelse return error.Incomplete;
// abi is always common
_ = 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(" {p} = {s},\n", .{ zig.fmtId(fixed_name), number });
}
try writer.writeAll("};\n\n");
}
{
try writer.writeAll(
\\pub const MipsO32 = enum(usize) {