aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2021-11-22 22:36:57 +0000
committerBrooks Davis <brooks@FreeBSD.org>2021-11-22 22:36:57 +0000
commitb85fb39047123185707ade51bd6294bd404ff413 (patch)
tree0d7e030d7983ce936429b83234b124b204764de9
parentf0cfbffc3631aa1e7cab10aae7a25818dfe101c1 (diff)
makesyscalls.lua: Allow translation of intptr_t arguments
Translate instances of intptr_t to the config value abi_intptr_t (defaults to "intptr_t"). Used in CheriABI to translate intptr_t to intcap_t for hybrid kernels. Reviewed by: kevans
-rw-r--r--sys/tools/makesyscalls.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua
index f967bd84fa87..1023e2faa0e6 100644
--- a/sys/tools/makesyscalls.lua
+++ b/sys/tools/makesyscalls.lua
@@ -61,6 +61,7 @@ local config = {
abi_flags = "",
abi_flags_mask = 0,
abi_headers = "",
+ abi_intptr_t = "intptr_t",
ptr_intptr_t_cast = "intptr_t",
}
@@ -398,9 +399,11 @@ local function write_line_pfile(tmppat, line)
end
end
+-- Check both literal intptr_t and the abi version because this needs
+-- to work both before and after the substitution
local function isptrtype(type)
return type:find("*") or type:find("caddr_t") or
- type:find("intptr_t")
+ type:find("intptr_t") or type:find(config['abi_intptr_t'])
end
local process_syscall_def
@@ -599,6 +602,8 @@ local function process_args(args)
goto out
end
+ argtype = argtype:gsub("intptr_t", config["abi_intptr_t"])
+
-- XX TODO: Forward declarations? See: sysstubfwd in CheriBSD
if abi_change then
local abi_type_suffix = config["abi_type_suffix"]