Lines Matching +full:gen +full:- +full:3
2 --
3 -- SPDX-License-Identifier: BSD-2-Clause
4 --
5 -- Copyright (c) 2024 Tyler Baxter <agge@FreeBSD.org>
6 -- Copyright (c) 2023 Warner Losh <imp@bsdimp.com>
7 -- Copyright (c) 2019 Kyle Evans <kevans@FreeBSD.org>
8 --
10 -- Setup to be a module, or ran as its own script.
12 local script = not pcall(debug.getlocal, 4, 1) -- TRUE if script.
14 -- Add library root to the package path.
19 local FreeBSDSyscall = require("core.freebsd-syscall")
22 -- File has not been decided yet; config will decide file. Default defined as
23 -- /dev/null.
27 -- Grab the master system calls table.
30 -- Bind the generator to the parameter file.
31 local gen = generator:new({}, fh)
33 -- Write the generated preamble.
34 gen:preamble("System call switch table.")
36 gen:write(tbl.includes)
38 -- Newline before and after this line.
39 gen:write(
42 -- Write out all the compat directives from compat_options.
44 gen:write(string.format([[
53 -- Add a newline only if there were compat_options.
55 gen:write("\n")
58 gen:write(string.format([[
65 -- Comment is the function name by default, but may change
66 -- based on the type of system call.
69 gen:write(v.prolog);
71 -- Handle non-compat:
73 gen:write(string.format(
76 -- Handle SYSMUX flag:
78 gen:write(string.format("nosys, " ..
83 -- Handle NOSTD flag:
85 gen:write(string.format("lkmressys, " ..
90 -- Handle rest of non-compat:
97 gen:write(string.format("%s, " ..
103 gen:write(string.format("sys_%s, " ..
111 -- Handle compat (everything >= FREEBSD3):
112 elseif c >= 3 then
113 -- Lookup the info for this specific compat option.
125 gen:write(string.format("\t{ " ..
133 gen:write(string.format("\t{ %s(%s,%s), " ..
141 -- Handle obsolete:
143 gen:write("\t{ " ..
149 -- Handle unimplemented:
151 gen:write("\t{ " ..
155 -- UNIMPL comment is not different in sysent.
157 -- Handle reserved:
159 gen:write("\t{ " ..
166 gen:write(string.format("\t/* %d = %s */\n", v.num, comment))
168 gen:write(tbl.epilog)
170 -- End
171 gen:write("};\n")
174 -- Entry of script:
187 -- The parsed syscall table.
190 init_sysent.file = config.syssw -- change file here
194 -- Return the module.