mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
generate_linux_syscalls: Add generation code for mips n32.
This commit is contained in:
parent
2598aa574b
commit
4028762a9a
@ -237,6 +237,31 @@ pub fn main() !void {
|
||||
|
||||
try writer.writeAll("};\n\n");
|
||||
}
|
||||
{
|
||||
try writer.writeAll(
|
||||
\\pub const MipsN32 = enum(usize) {
|
||||
\\ const linux_base = 6000;
|
||||
\\
|
||||
\\
|
||||
);
|
||||
|
||||
const table = try linux_dir.readFile("arch/mips/kernel/syscalls/syscall_n32.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 n32
|
||||
_ = 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} = linux_base + {s},\n", .{ zig.fmtId(fixed_name), number });
|
||||
}
|
||||
|
||||
try writer.writeAll("};\n\n");
|
||||
}
|
||||
{
|
||||
try writer.writeAll("pub const PowerPC = enum(usize) {\n");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user