Lines Matching +full:freebsd14 +full:- +full:1 +full:s
1 --
2 -- SPDX-License-Identifier: BSD-2-Clause
3 --
4 -- Copyright (c) 2021-2024 SRI International
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 --
11 -- Code to read in the config file that drives this. Since we inherit from the
12 -- FreeBSD makesyscall.sh legacy, all config is done through a config file that
13 -- sets a number of variables (as noted below); it used to be a .sh file that
14 -- was sourced in. This dodges the need to write a command line parser.
15 --
19 --
20 -- Global config map.
21 -- Default configuration is native. Any of these may get replaced by an
22 -- optionally specified configuration file.
23 --
53 -- System calls that require ABI-specific handling.
55 -- System calls that appear to require handling, but don't.
57 -- Keep track of modifications if there are.
59 -- Stores compat_sets from syscalls.conf; config.mergeCompat()
60 -- instantiates.
64 --
65 -- For each entry, the ABI flag is the key. One may also optionally provide an
66 -- expr, which are contained in an array associated with each key; expr gets
67 -- applied to each argument type to indicate whether this argument is subject to
68 -- ABI change given the configured flags.
69 --
72 "_Contains[a-z_]*_long_",
73 "^long [a-z0-9_]+$",
76 -- semid_t is not included because it is only used
77 -- as an argument or written out individually and
78 -- said writes are handled by the ksem framework.
79 -- Technically a sign-extension issue exists for
80 -- arguments, but because semid_t is actually a file
81 -- descriptor negative 32-bit values are invalid
82 -- regardless of sign-extension.
85 "_Contains[a-z_]*_timet_",
88 -- no expr
91 "_Contains[a-z_]*_ptr_",
101 -- All compat option entries should have five entries:
102 -- definition: The preprocessor macro that will be set for this.
103 -- compatlevel: The level this compatibility should be included at. This
104 -- generally represents the version of FreeBSD that it is compatible
105 -- with, but ultimately it's just the level of mincompat in which it's
106 -- included.
107 -- flag: The name of the flag in syscalls.master.
108 -- prefix: The prefix to use for _args and syscall prototype. This will be
109 -- used as-is, without "_" or any other character appended.
110 -- descr: The description of this compat option in init_sysent.c comments.
111 -- The special "stdcompat" entry will cause the other five to be autogenerated.
128 { stdcompat = "FREEBSD14" },
132 --
133 -- config looks like a shell script; in fact, the previous makesyscalls.sh
134 -- script actually sourced it in. It had a pretty common format, so we should
135 -- be fine to make various assumptions.
136 --
137 -- This function processes config to be merged into our global config map with
138 -- config.merge(). It aborts if there's malformed lines and returns NIL and a
139 -- message if no file was provided.
140 --
143 local comment_line_expr = "^%s*#.*"
144 -- We capture any whitespace padding here so we can easily advance to
145 -- the end of the line as needed to check for any trailing bogus bits.
146 -- Alternatively, we could drop the whitespace and instead try to
147 -- use a pattern to strip out the meaty part of the line, but then we
148 -- would need to sanitize the line for potentially special characters.
149 local line_expr = "^([%w%p]+%s*)=(%s*[`\"]?[^\"`]*[`\"]?)"
158 -- Strip any whole-line comments.
160 -- Parse it into key, value pairs.
166 local delim = value:sub(1,1)
170 -- Strip off the key/value part.
171 trailing_context = nextline:sub(kvp:len() + 1)
172 -- Strip off any trailing comment.
175 -- Strip off leading/trailing whitespace.
179 util.abort(1,
185 -- Strip off potential comments.
187 -- Strip off any padding whitespace.
189 if value:match("%s") then
190 util.abort(1,
196 elseif not nextline:match("^%s*$") then
197 -- Make sure format violations don't get overlooked
198 -- here, but ignore blank lines. Comments are already
199 -- stripped above.
200 util.abort(1, "Malformed config line: " .. nextline)
208 -- Merges processed configuration file into the global config map (see above),
209 -- or returns NIL and a message if no file was provided.
219 -- Handling of string lists:
221 -- Match for pipe, that's how abi_flags
222 -- is formatted.
228 -- Match for space, that's how these
229 -- are formatted.
234 -- Construct config modified table as config
235 -- is processed.
238 -- config wasn't modified.
244 -- Returns TRUE if there are ABI changes from native for the provided ABI flag.
247 util.abort(1, "abi_changes: unknown flag: " .. name)
252 -- Instantiates config.compat_options.
256 util.abort(1, "Undefined compat set: " ..