Lines Matching +full:trim +full:- +full:config

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")
23 -- File has not been decided yet; config will decide file. Default defined as
24 -- /dev/null.
27 function systrace_args.generate(tbl, config, fh)
28 -- Grab the master system calls table.
31 -- Bind the generator to the parameter file.
33 gen.storage_levels = {} -- make sure storage is clear
35 -- 64-bit padding preprocessor directive.
36 gen:pad64(config.abiChanges("pair_64bit"))
38 -- Write the generated preamble.
75 -- Handle non compat:
111 local argtype = util.trim(
116 config.abiChanges("pair_64bit") then
122 -- Pointer arg?
135 idx - 1, padding, desc), 1)
139 config.abiChanges("pair_64bit") then
140 padding = " - _P_"
151 config.abi_intptr_t) then
153 uarg[a++] = (%s)p->%s; /* %s */
155 config.ptr_intptr_t_cast,
159 uarg[a++] = p->%s.buf; /* %s */
165 uarg[a++] = p->%s; /* %s */
171 config.abiChanges(
179 iarg[a++] = p->%s; /* %s */
185 config.abiChanges(
214 -- Handle compat (everything >= FREEBSD3):
215 -- Do nothing, only for native.
248 -- Write all stored lines.
255 -- Entry of script:
257 local config = require("config")
265 config.merge(configfile)
266 config.mergeCompat()
268 -- The parsed system call table.
269 local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}
271 systrace_args.file = config.systrace -- change file here
272 systrace_args.generate(tbl, config, systrace_args.file)
275 -- Return the module.