-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Rewrite Linux syscalls generation #24702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2edf0e8 to
3157f22
Compare
|
I've modified the tool again to consolidate all the logic into one table and restored the order of the emitted variables for easier diffing. This should fix the |
29ee317 to
89a1d94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code all looks great, one more suggestion for the x32 ABI though! Again, not a regression but its soooo close now ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple minor comments after looking this over again. The core of the change looks great, and the code seems much simpler now.
f707ada to
7f49b6c
Compare
|
Failures look to be #24754. |
d2bfd3d to
66af692
Compare
|
Fixing the merge conflict, but FYI the CI is all green. |
66af692 to
1d68ccd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something I just noticed while looking at this again. Not something to hold up any merges for.
Changes by Arnd Bergmann have migrated all supported architectures to use a table for their syscall lists. This removes the need to use the C pre-processor and simplifies the logic considerably. All currently supported architectures have been added, with the ones Zig doesn't support being commented out. Speaking of; OpenRisc has been enabled for generation.
The generic syscall table has different names for syscalls that take a timespec64 on 32-bit targets, in that it adds the `_time64` suffix. Similarly, the `_time32` suffix has been removed. I'm not sure if the existing logic for determining the proper timespec struct to use was subtly broken, but it should be a good chance to finish ziglang#4726 - we only have 12 years after all... As for the changes since 6.11..6.16: 6.11: - x86_64 gets `uretprobe`, a syscall to speed up returning BPF probes. - Hexagon gets `clone3`, but don't be fooled: it just returns ENOSYS. 6.13: - The `*xattr` family of syscalls have been enhanced with new `*xattrat` versions, similar to the other file-based `at` calls. 6.15: - Atomically create a detached mount tree and set mount options on it. Finally, this commit also adds the syscall numbers for OpenRISC and maps it to the `or1k` cpu.
Newer 32-bit Linux targets like 32-bit RISC-V only use the 64-bit time ABI, with these syscalls having `time64` as their suffix. This is a stopgap solution in favor of a full audit of `std.os.linux` to prepare for ziglang#4726. See also ziglang#21440 for prior art.
1d68ccd to
6080f2d
Compare
|
Any more changes needed or does it lgtm? |
|
Looks good, thanks! |
Reloaded version of #21440 post writergate. Original description below:
Changes by Arnd Bergmann have migrated all supported architectures to use a table for their syscall lists. This removes the need of calling a C pre-processor and simplifies the logic dramatically.
The side effect is the number of names changed on targets that use the "generic" table. That list (located under scripts/syscall.tbl) adds the _time64 suffix to syscalls taking a timespec64 on 32-bit targets. Similarly, the _time32 suffix has been removed.
The result is a lot of breakage in our Linux wrappers, which makes me worried that the logic for determining the proper timespec to use was subtly broken all this time. Should be a good chance to finish #4726 - we only have
1412 years after all...CC @alexrp if things break.