Lines Matching +full:gen +full:- +full:2
2 --
3 -- SPDX-License-Identifier: BSD-2-Clause
4 --
5 -- Copyright (c) 2024 SRI International
6 -- Copyright (c) 2024 Tyler Baxter <agge@FreeBSD.org>
7 -- Copyright (c) 2023 Warner Losh <imp@bsdimp.com>
8 -- Copyright (c) 2019 Kyle Evans <kevans@FreeBSD.org>
9 --
11 -- Setup to be a module, or ran as its own script.
13 local script = not pcall(debug.getlocal, 4, 1) -- TRUE if script.
15 -- Add library root to the package path.
20 local FreeBSDSyscall = require("core.freebsd-syscall")
23 -- File has not been decided yet; config will decide file. Default defined as
24 -- /dev/null.
28 -- Grab the master system calls table.
31 -- Bind the generator to the parameter file.
32 local gen = generator:new({}, fh)
34 -- Write the generated preamble.
35 gen:preamble("FreeBSD system call symbols.")
37 gen:write(string.format("FBSDprivate_1.0 {\n"))
40 gen:write(v.prolog)
43 gen:write(string.format("\t_%s;\n", v.name))
45 gen:write(string.format("\t__sys_%s;\n", v.name))
48 gen:write(tbl.epilog)
50 -- End
51 gen:write("};\n")
54 -- Entry of script:
58 if #arg < 1 or #arg > 2 then
62 local sysfile, configfile = arg[1], arg[2]
67 -- The parsed syscall table.
70 syscalls_map.file = config.libsysmap -- change file here
74 -- Return the module.