Commit graph

36 commits

Author SHA1 Message Date
Andrew Kelley
9adcc31ca3 update tools and other miscellaneous things to new APIs 2025-08-30 00:48:50 -07:00
Stephen Gregoratto
c5f10a3f7d Rewrite generate_linux_syscalls to be completely table based
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.
2025-08-14 10:19:31 +10:00
Andrew Kelley
749f10af49 std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
Alex Rønne Petersen
2ffa63acef
tools: fix some bitrot 2025-07-16 06:37:48 +02:00
Andrew Kelley
d8e26275f2 update standalone and incremental tests to new API 2025-07-07 22:43:53 -07:00
Alex Rønne Petersen
d61e4ef8b0
generate_linux_syscalls: Generate syscalls for x32.
Also update the syscalls file based on Linux 6.10. No diffs other than x32.
2024-11-02 10:42:53 +01:00
Alex Rønne Petersen
8060fad425
generate_linux_syscalls: Rename mmap_pgoff to mmap2. 2024-10-03 09:12:35 +02:00
ippsav
291fb43f27 fix(fmt): remove additional trailing newline 2024-08-09 13:07:54 -07:00
ippsav
724804a4e0
Rewrite generate_linux_syscalls.zig (#20895)
refactors the syscall generation tool aiming to reduce code duplication for both the table based arches and the ones generated using a preprocessor.
2024-08-05 10:43:47 -07:00
Alex Rønne Petersen
f29967f46c
generate_linux_syscalls: Skip some reserved syscalls on mips and xtensa. 2024-07-30 01:32:48 +02:00
Alex Rønne Petersen
264b830964
generate_linux_syscalls: Add generation code for xtensa. 2024-07-30 01:32:48 +02:00
Alex Rønne Petersen
09914868ea
generate_linux_syscalls: Add generation code for m68k. 2024-07-30 01:32:48 +02:00
Alex Rønne Petersen
6e7d619dc3
generate_linux_syscalls: Add generation code for s390x. 2024-07-30 01:32:48 +02:00
Alex Rønne Petersen
4028762a9a
generate_linux_syscalls: Add generation code for mips n32. 2024-07-30 01:32:47 +02:00
Alex Rønne Petersen
2598aa574b
generate_linux_syscalls: Add generation code for sparc32. 2024-07-30 01:32:47 +02:00
Alex Rønne Petersen
fb249cf3e1
generate_linux_syscalls: Add generation code for hexagon. 2024-07-30 01:32:47 +02:00
Alex Rønne Petersen
dd78ee43e4
generate_linux_syscalls: Add generation code for csky. 2024-07-30 01:32:47 +02:00
Alex Rønne Petersen
2e910f23f9
generate_linux_syscalls: Add generation code for arc. 2024-07-30 01:32:47 +02:00
Alex Rønne Petersen
94a1fd6e8e
generate_linux_syscalls: Name mips types according to ABI. 2024-07-30 01:32:47 +02:00
Alex Rønne Petersen
1f9dcff747
generate_linux_syscalls: Don't expose the helper constants on mips/mips64. 2024-07-30 01:32:47 +02:00
Alex Rønne Petersen
2747fca226
generate_linux_syscalls: Simplify include paths.
Using the tooling includes means we won't run into the asm/bitsperlong.h issue.
2024-07-30 01:32:47 +02:00
Alex Rønne Petersen
c9664cb657
generate_linux_syscalls: Bring loongarch64 generation code in line with other newer ports. 2024-07-30 01:32:47 +02:00
Alex Rønne Petersen
7e74276661
generate_linux_syscalls: Rework generation strategy for newer kernel ports.
If we're going to abuse the preprocessor, we may as well go all the way and have
it generate a convenient format for us. This achieves two things:

1. We no longer need hacks for the arch-specific syscalls.
2. We now generate the correct syscall names for 32-bit platforms.

The latter is because we now resolve __SC_3264, etc.
2024-07-29 09:50:41 +02:00
Alex Rønne Petersen
f494a47ca5
generate_linux_syscalls: Add some missing include paths for riscv. 2024-07-29 09:50:41 +02:00
Alex Rønne Petersen
290609eff5
generate_linux_syscalls: Add riscv32 support. 2024-07-29 09:50:41 +02:00
Alex Rønne Petersen
0460248900
generate_linux_syscalls: Handle riscv_hwprobe. 2024-07-29 09:50:41 +02:00
YANG Xudong
87150468fc generate loongarch64 Linux syscalls 2024-06-05 18:54:14 -04:00
Andrew Kelley
f47824f24d std: restructure child process namespace 2024-05-26 09:31:55 -07:00
Travis Staloch
8af59d1f98 ComptimeStringMap: return a regular struct and optimize
this patch renames ComptimeStringMap to StaticStringMap, makes it
accept only a single type parameter, and return a known struct type
instead of an anonymous struct.  initial motivation for these changes
was to reduce the 'very long type names' issue described here
https://github.com/ziglang/zig/pull/19682.

this breaks the previous API.  users will now need to write:
`const map = std.StaticStringMap(T).initComptime(kvs_list);`

* move `kvs_list` param from type param to an `initComptime()` param
* new public methods
  * `keys()`, `values()` helpers
  * `init(allocator)`, `deinit(allocator)` for runtime data
  * `getLongestPrefix(str)`, `getLongestPrefixIndex(str)` - i'm not sure
     these belong but have left in for now incase they are deemed useful
* performance notes:
  * i posted some benchmarking results here:
    https://github.com/travisstaloch/comptime-string-map-revised/issues/1
  * i noticed a speedup reducing the size of the struct from 48 to 32
    bytes and thus use u32s instead of usize for all length fields
  * i noticed speedup storing KVs as a struct of arrays
  * latest benchmark shows these wall_time improvements for
    debug/safe/small/fast builds: -6.6% / -10.2% / -19.1% / -8.9%. full
    output in link above.
2024-04-22 15:31:41 -07:00
Carl Åstholm
4c393c7468 Update usages of fmtId/isValidId
`{}` for decls
`{p}` for enum fields
`{p_}` for struct fields and in contexts following a `.`

Elsewhere, `{p}` was used since it's equivalent to the old behavior.
2024-04-07 14:47:11 +02:00
mlugg
026a8278f8
tools: correct unnecessary uses of 'var' 2023-11-19 09:57:04 +00:00
Jan Philipp Hafer
fd2239bde9 child_process + Build: rename exec to run + all related code
Justification: exec, execv etc are unix concepts and portable version
should be called differently.

Do no touch non-Zig code. Adjust error names as well, if associated.
Closes #5853.
2023-10-22 14:47:20 -04:00
Stephen Gregoratto
11fcbe5a46 gen_linux_syscalls: use default max output bytes
Apparently, 20KiB is not enough anymore.
2023-09-28 18:58:05 +10:00
Ryan Liptak
815e53b147 Update all std.mem.tokenize calls to their appropriate function
Everywhere that can now use `tokenizeScalar` should get a nice little performance boost.
2023-05-13 13:45:04 -07:00
Stephen Gregoratto
d4ce0fe7fe Update Linux syscall list for 6.1, support Mips64
Follow up for #14541.
2023-02-05 03:25:21 -05:00
Stephen Gregoratto
a4369918b1 Generate linux syscalls via. the linux source tree
Previously, updating the `SYS` enum for each architecture required
manually looking at the syscall tables and inserting any new additions.

This commit adds a tool, `generate_linux_syscalls.zig`, that automates
this process using the syscall tables in the Linux source tree. On
architectures without a table, it runs `zig cc` as a pre-processor to
extract the system-call numbers from the Linux headers.
2022-05-16 23:55:11 -04:00