aboutsummaryrefslogtreecommitdiff
path: root/sys/tools/makesyscalls.lua
Commit message (Collapse)AuthorAgeFilesLines
* makesyscalls.lua: improve generated file style(9) complianceEd Maste2021-05-131-4/+4
| | | | | | | | | | | | We generally like to avoid style changes when other changes are not planned. In this case there are some makesyscalls.lua changes in the pipeline, and this cleans up style nits in generated files that were highlighted by experiments with clang-format. Reviewed by: brooks, kevans MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30235
* syscalls.master: Add a new syscall type: RESERVEDBrooks Davis2021-01-261-8/+15
| | | | | | | | | RESERVED syscall number are reserved for local/vendor use. RESERVED is identical to UNIMPL except that comments are ignored. Reviewed by: kevans Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27988
* Make makesyscalls.lua initialize 'struct sysent' entries using c99Edward Tomasz Napierala2020-09-251-10/+17
| | | | | | | | | | | | designated initializers. This makes it easier to modify 'struct sysent' layout. Reviewed by: kevans Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26530 Notes: svn path=/head/; revision=366145
* makesyscalls.lua: improve syscall ordering validationKyle Evans2020-08-041-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two separate issues here: 1.) #if/#else wasn't taken into account at all for maxsyscall figures, but 2.) We didn't validate contiguous syscall numbers anyways... This kind of inconsistency is bad as we don't currently ensure explicit indexing of, e.g., the sysent array if one syscall is unimplemented/missing. This could be fixed and might be more robust, but it's also good to have the "documentation" that comes from being explicit as to what the missing syscalls are. The new version looks much like the awk version; stash off the current 'last highest syscall seen' if we hit an #if, restore to that if we hit an #else, and make sure that we're explicitly always defining the next syscall. The logic at the tail end of process_syscall_def that moves maxsyscall has been 'cleaned up' a little since we're now ensuring that it's monotonically increasing earlier in the function. At the moment I think it's unlikely we'd see range-definitions that are not UNIMPL, but there's no reason to specifically handle that case for bumping maxsyscall there. This change was provoked by reading the commit message for r363832 and realizing that this validation hadn't been included in the initial rewrite to lua. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D25945 Notes: svn path=/head/; revision=363869
* makesyscalls.lua: generate all files in /tmp, write into place at the endKyle Evans2020-01-101-13/+23
| | | | | | | | | | | | | | | | This makes makesyscalls.lua more parallel-friendly, or at least not as hostile to the idea. We get into situations where we're running parallel if we end up with MAKE_JOBS>1 entering any of the sysent targets, since each output file is recognized a distinct build step that needs to be executed. Another commit will add some .ORDER to further improve the situation. Reported by: jhb Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D23098 Notes: svn path=/head/; revision=356603
* makesyscalls.lua: trim trailing spaces/commas from argsKyle Evans2019-12-111-0/+1
| | | | | | | | | | | | | These are insignificant as far as declarations go, and we've historically allowed it. fhlinkat in ^/sys/kern/syscalls.master, for example, currently has a trailing comma after its final argument that this version of makesyscalls is ignoring (not by conscious decision). Fix it for now by actively stripping off trailing whitespace/commas until we decide to actively prohibit it. Notes: svn path=/head/; revision=355628
* makesyscalls.lua: improve config processingKyle Evans2019-12-061-8/+45
| | | | | | | | | | | | | | | | | | | The current version will strip out #include directives appearing inside strings, which is clearly wrong. Improve the processing entirely in the following ways: - Strip only whole-line comments on every single iteration - Abort if we see a malformed line that doesn't match the key=value format - For quoted (backtick or double quote) strings, we'll advance to the end of the key=value pair and make sure there's not extra stuff left over - For unquoted key=value pairs, we'll strip any trailing comments and verify there's no internal whitespace This has revealed the caveat that key/value pairs can't even include escaped quotes (and haven't been able to). I don't know if this is actually problematic, as we're usually looking at cases like "#include <foo>" or raw identifiers.The current version will strip out #include directives appearing inside strings, which is clearly wrong. Improve the processing entirely in the following ways: Reviewed and noticed by: brooks Differential Revision: https://reviews.freebsd.org/D22698 Notes: svn path=/head/; revision=355468
* Add makesyscalls.lua, a rewrite of makesyscalls.shKyle Evans2019-11-171-0/+1322
This currently requires a suitable lua + luafilesystem + luaposix from the ports tree to build. Discussion is underway in D21893 to add a suitable lua to the base system, cleverly disguised and out of the way of normal consumers. makesyscalls.sh is a good target for rewrite into lua as it's currently a sh+sed+awk script that can be difficult to add on to, at times. For instance, adding a new COMPAT* option (that mimicks the behaivor of most other COMPAT* options) requires a fairly substantial amount of copy/paste; see r352693 for instance. Attempts to generate part of the awk script for COMPAT* handling was (very kindly) rejected with a desire to just rewrite the script in a single language that can handle all of it. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D21775 Notes: svn path=/head/; revision=354786