git: 3f8f46a0ae4f - main - makesyscalls: Add a way to include per-ABI headers

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Mon, 22 Nov 2021 22:37:46 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=3f8f46a0ae4f7dbe886ade676917a0d68ca1f86e

commit 3f8f46a0ae4f7dbe886ade676917a0d68ca1f86e
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2021-11-22 22:36:56 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2021-11-22 22:36:56 +0000

    makesyscalls: Add a way to include per-ABI headers
    
    When the string %%ABI_HEADERS%% is found in syscalls.master, replace
    it with the contents of the abi_headers config variable.  This allows
    an ABI-specific syscalls.conf to add lines like:
    
            #include <compat/freebsd32/freebsd32.h>
    
    when working from a shared syscalls.master.
    
    Reviewed by:    kevans
---
 sys/tools/makesyscalls.lua | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua
index 622a6ad4b1dd..fef991296316 100644
--- a/sys/tools/makesyscalls.lua
+++ b/sys/tools/makesyscalls.lua
@@ -60,6 +60,7 @@ local config = {
 	abi_type_suffix = "",
 	abi_flags = "",
 	abi_flags_mask = 0,
+	abi_headers = "",
 	ptr_intptr_t_cast = "intptr_t",
 }
 
@@ -438,6 +439,16 @@ local pattern_table = {
 			write_line_pfile('systrace.*', line)
 		end,
 	},
+	{
+		dump_prevline = true,
+		pattern = "%%ABI_HEADERS%%",
+		process = function()
+			if config['abi_headers'] ~= "" then
+				line = config['abi_headers'] .. "\n"
+				write_line('sysinc', line)
+			end
+		end,
+	},
 	{
 		-- Buffer anything else
 		pattern = ".+",