aboutsummaryrefslogtreecommitdiff
path: root/sys/tools/syscalls/core
Commit message (Collapse)AuthorAgeFilesLines
* syscalls: Preserve the attributes of the argsWarner Losh2026-04-171-0/+19
| | | | | | | | Lightly parse and preserve the attributes of the args as attributes. Sponsored by: Netflix Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D56407
* sysent: add a new NORETURN type flagBrooks Davis2025-08-081-0/+1
| | | | | | | | System calls of type NORETURN don't return and their stubs are declare not to. Reviewed by: kevans, kib Differential Revision: https://reviews.freebsd.org/D51673
* makesyscalls: deprecate cpp other than includesBrooks Davis2025-02-181-0/+6
| | | | | | | | | | | Warn that C preprocessor directives in the config file are deprecated. They are unsound and support has a number of potential pitfalls. They should be replaced by compile-time generation of files plus an overlay framework to allow things like per-arch variation. Reviewed by: kevans Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/1575
* makesyscalls: Restore support for cpp in inputBrooks Davis2025-02-181-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow patterns like this in syscalls.master: #if 0 91 AUE_NULL RESERVED #else 91 AUE_NULL STD|CAPENABLED { int newsyscall(void); } #endif makesyscalls.lua and it's predecessor makesyscalls.sh (really an awk script with a tiny shell prolog) used a single pass parsing model where lines beginning with `#` were emitted into most generated files as they were read. I belive this was initially there to allow includes to be listed in syscalls.master, but Hyrum's Law[0] applies and people are using it for things like architecture-specific syscall definitions. This use of CPP macro is unsound and there are a number of sharp edges in both the new and old implementations. The macros are unsound because not all the files were generate are run through CPP (or if they are not in the same context) and this will increasingly be true as we generate more things. Sharp edges include the fact that anything before the first syscall would be printed at a different scope (e.g., before an array is declared). In this patch I collect each non-#include CPP directive and attach them to the syscall table or individual entries. All entries before the first syscall and after the last are attached to the prolog and epilog members. Within the syscall table all entries are attached to the next system calls's prolog member. In generators, each prolog entry is printed regardless of the system call's visibiilty which replicates the naive single pass model's behavior (including lots of empty blocks of #if/#else/#endif in the output). Unlike makesyscalls.lua, I discard none #define entries at the top of the file and print a warning as their usefulness appears limited. [0] https://www.hyrumslaw.com Reported by: kevans Reviewed by: kevans Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/1575
* sysent: add a NOLIB modifer to prevent stub generationBrooks Davis2024-11-011-0/+1
| | | | | | | | | | | | | The yield system call has long existed, but never had a stub. Replace the hardcoded checks for it in libsys_h.lua and syscalls_map.lua and stop inserting it into MIASM (requiring libsys/Makefile.sys to disable the stub). (This seems like overkill, but I've got another case in CheriBSD so this reduces my diff appreciably.) Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1503
* sysent: sort modifier flagsBrooks Davis2024-11-011-1/+3
| | | | | | | | These flags are a mix of excusive types and modifer flags. Comment the modifer flags and sort them. Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1503
* sys/tools/syscalls: desupport capabilities.confBrooks Davis2024-10-301-8/+3
| | | | | | | | | We haven't used this since commit be67ea40c5a0 in 2021 so stop carrying it forward. Also remove support for setting the list in syscalls.conf via the capenabled variable. This was last used by cloudabi (removed in 2021 by commit cf0ee8738e31).
* Refactor makesyscalls.lua into a libraryagge32024-10-304-0/+852
* main.lua replicates the functionality of makesyscalls.lua * Individual files are generated by their associated module * Modules can be called as standalone scripts to generate a specific file * Data and procedures are performed by objects instead of procedual code * Bitmasks are replaced by declarative types * Temporary files are no longer produced, writing is stored in memory * Comments provide explanation to functions and semantics Google Summer of Code 2024 Final Work Product Co-authored-by: Warner Losh <imp@freebsd.org> Co-authored-by: Kyle Evans <kevans@freebsd.org> Co-authored-by: Brooks Davis <brooks@freebsd.org> Sponsored by: Google (GSoC 24) Pull Request: https://github.com/freebsd/freebsd-src/pull/1362 Signed-off-by: agge3 <sterspark@gmail.com>