mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
generate_linux_syscalls: Add generation code for s390x.
This commit is contained in:
parent
4028762a9a
commit
6e7d619dc3
1 changed files with 20 additions and 0 deletions
|
|
@ -298,6 +298,26 @@ pub fn main() !void {
|
|||
try writer.writeAll(list_64.items);
|
||||
try writer.writeAll("};\n\n");
|
||||
}
|
||||
{
|
||||
try writer.writeAll("pub const S390x = enum(usize) {\n");
|
||||
|
||||
const table = try linux_dir.readFile("arch/s390/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;
|
||||
const abi = fields.next() orelse return error.Incomplete;
|
||||
if (mem.eql(u8, abi, "32")) continue; // 32-bit s390 support in linux is deprecated
|
||||
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");
|
||||
}
|
||||
|
||||
// Newer architectures (starting with aarch64 c. 2012) now use the same C
|
||||
// header file for their syscall numbers. Arch-specific headers are used to
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue