| ... | @@ -148,6 +148,25 @@ pub fn main() !void { | ... | @@ -148,6 +148,25 @@ pub fn main() !void { |
| 148 | \\ | 148 | \\ |
| 149 | ); | 149 | ); |
| 150 | } | 150 | } |
| | 151 | { |
| | 152 | try writer.writeAll("pub const Sparc = enum(usize) {\n"); |
| | 153 | const table = try linux_dir.readFile("arch/sparc/kernel/syscalls/syscall.tbl", buf); |
| | 154 | var lines = mem.tokenizeScalar(u8, table, '\n'); |
| | 155 | while (lines.next()) |line| { |
| | 156 | if (line[0] == '#') continue; |
| | 157 | |
| | 158 | var fields = mem.tokenizeAny(u8, line, " \t"); |
| | 159 | const number = fields.next() orelse return error.Incomplete; |
| | 160 | const abi = fields.next() orelse return error.Incomplete; |
| | 161 | if (mem.eql(u8, abi, "64")) continue; |
| | 162 | const name = fields.next() orelse return error.Incomplete; |
| | 163 | const fixed_name = if (stdlib_renames.get(name)) |fixed| fixed else name; |
| | 164 | |
| | 165 | try writer.print(" {p} = {s},\n", .{ zig.fmtId(fixed_name), number }); |
| | 166 | } |
| | 167 | |
| | 168 | try writer.writeAll("};\n\n"); |
| | 169 | } |
| 151 | { | 170 | { |
| 152 | try writer.writeAll("pub const Sparc64 = enum(usize) {\n"); | 171 | try writer.writeAll("pub const Sparc64 = enum(usize) {\n"); |
| 153 | const table = try linux_dir.readFile("arch/sparc/kernel/syscalls/syscall.tbl", buf); | 172 | const table = try linux_dir.readFile("arch/sparc/kernel/syscalls/syscall.tbl", buf); |