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 |
||
|---|---|---|
| .. | ||
| core | ||
| scripts | ||
| tools | ||
| config.lua | ||
| main.lua | ||
| README.md | ||
System call creation library
Parses syscalls.master and packages information into objects with methods.
Modules reproduce the previously monolithic file auto-generation.
We generally assume that this script will be run by flua, however we've carefully crafted modules for it that mimic interfaces provided by modules available in ports. Currently, this script is compatible with lua from ports along with the compatible luafilesystem and lua-posix modules.
Usage
main.lua generates all files.
Files are associated with their respective modules, and modules can be run as
standalone scripts to generate specific files.
Examples
All files:
# /usr/libexec/flua /usr/src/sys/tools/syscalls/main.lua /usr/src/sys/kern/syscalls.master
syscalls.h:
# /usr/libexec/flua /usr/src/sys/tools/syscalls/scripts/syscalls.h /usr/src/sys/kern/syscalls.master
Organization
root-
main.lua- Main entry point that calls all scripts. -
config.lua- Contains the global configuration table and associated configuration functions. -
core(Core Classes)syscall.lua- Packages each system call entry fromsyscalls.masterinto a system call object.scarg.lua- Packages each argument for the system call into an argument object.scret.lua- An object for the return value of the system call.freebsd-syscall.lua- Contains the master system call table after processing.
-
scriptsinit_sysent.lua- Generatesinit_sysent.c.libsys_h.lua- Generateslib/libsys/_libsys.h.syscall_h.lua- Generatessyscall.h.syscall_mk.lua- Generatessyscall.mk.syscalls.lua- Generatessyscalls.c.syscalls_map.lua- Generateslib/libsys/syscalls.map.sysproto_h.lua- Generatessysproto.h.systrace_args.lua- Generatessystrace_args.c.
-
toolsutil.lua- Contains utility functions.generator.lua- Handles file generation for the library.
-