Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Nov 2021 22:38:01 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 64cc9803ab6f - main - makesyscalls: add override of ABI change detection
Message-ID:  <202111222238.1AMMc1aA047543@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=64cc9803ab6fe661cf56c708e26b23d87f4b4ce6

commit 64cc9803ab6fe661cf56c708e26b23d87f4b4ce6
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2021-11-22 22:36:58 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2021-11-22 22:36:58 +0000

    makesyscalls: add override of ABI change detection
    
    While we can detect most ABI changes through analysis of
    syscalls.master with suitable annotations, to cases are handled
    in the core implementation and others have changes that can not be
    infered.  Add two new config variables syscall_abi_change and
    syscall_no_abi_change which override the detected value.  Both are
    space-seperated lists of syscall names.
    
    Reviewed by:    kevans
---
 sys/tools/makesyscalls.lua | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua
index 48ad05eb0469..386a79e44eeb 100644
--- a/sys/tools/makesyscalls.lua
+++ b/sys/tools/makesyscalls.lua
@@ -68,6 +68,10 @@ local config = {
 	abi_semid_t = "semid_t",
 	abi_ptr_array_t = "",
 	ptr_intptr_t_cast = "intptr_t",
+	syscall_abi_change = "",
+	sys_abi_change = {},
+	syscall_no_abi_change = "",
+	sys_no_abi_change = {},
 	obsol = "",
 	obsol_dict = {},
 	unimpl = "",
@@ -391,6 +395,18 @@ local function process_unimpl()
 	end
 end
 
+local function process_syscall_abi_change()
+	local changes_abi = config["syscall_abi_change"]
+	for syscall in changes_abi:gmatch("([^ ]+)") do
+		config["sys_abi_change"][syscall] = true
+	end
+
+	local no_changes = config["syscall_no_abi_change"]
+	for syscall in no_changes:gmatch("([^ ]+)") do
+		config["sys_no_abi_change"][syscall] = true
+	end
+end
+
 local function abi_changes(name)
 	if known_abi_flags[name] == nil then
 		abort(1, "abi_changes: unknown flag: " .. name)
@@ -1197,6 +1213,9 @@ process_syscall_def = function(line)
 	if args ~= nil then
 		funcargs, changes_abi = process_args(args)
 	end
+	if config["sys_no_abi_change"][funcname] then
+		changes_abi = false
+	end
 	local noproto = config["abi_flags"] ~= "" and not changes_abi
 
 	local argprefix = ''
@@ -1204,12 +1223,19 @@ process_syscall_def = function(line)
 	if abi_changes("pointer_args") then
 		for _, v in ipairs(funcargs) do
 			if isptrtype(v["type"]) then
+				if config["sys_no_abi_change"][funcname] then
+					print("WARNING: " .. funcname ..
+					    " in syscall_no_abi_change, but pointers args are present")
+				end
 				changes_abi = true
 				goto ptrfound
 			end
 		end
 		::ptrfound::
 	end
+	if config["sys_abi_change"][funcname] then
+		changes_abi = true
+	end
 	if changes_abi then
 		-- argalias should be:
 		--   COMPAT_PREFIX + ABI Prefix + funcname
@@ -1311,6 +1337,7 @@ elseif config["capenabled"] ~= "" then
 end
 process_compat()
 process_abi_flags()
+process_syscall_abi_change()
 process_obsol()
 process_unimpl()
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111222238.1AMMc1aA047543>