From 2cf57ad9b9c2468c4571fb3be8da39e159a9237a Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Tue, 21 Jan 2025 19:38:38 +0000 Subject: [PATCH] makesyscalls: reduce redundency in syscall.mk code The two outer blocks had identical contents and the two inner blocks differed in a single location. Sponsored by: DARPA, AFRL --- sys/tools/syscalls/scripts/syscall_mk.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/sys/tools/syscalls/scripts/syscall_mk.lua b/sys/tools/syscalls/scripts/syscall_mk.lua index 49d3f6f86c201d..8f8755af31c078 100755 --- a/sys/tools/syscalls/scripts/syscall_mk.lua +++ b/sys/tools/syscalls/scripts/syscall_mk.lua @@ -43,24 +43,14 @@ function syscall_mk.generate(tbl, config, fh) gen:write("MIASM = \\\n") -- preamble for _, v in pairs(s) do local c = v:compatLevel() + local bs = " \\" idx = idx + 1 - if v:native() and not v.type.NODEF and not v.type.NOLIB then + if (v:native() or c >= 7) and not v.type.NODEF and not v.type.NOLIB then if idx >= size then -- At last system call, no backslash. - gen:write(string.format("\t%s.o\n", v:symbol())) - else - -- Normal behavior. - gen:write(string.format("\t%s.o \\\n", v:symbol())) - end - -- Handle compat (everything >= FREEBSD3): - elseif c >= 7 and not v.type.NODEF and not v.type.NOLIB then - if idx >= size then - -- At last system call, no backslash. - gen:write(string.format("\t%s.o\n", v:symbol())) - else - -- Normal behavior. - gen:write(string.format("\t%s.o \\\n", v:symbol())) + bs = "" end + gen:write(string.format("\t%s.o%s\n", v:symbol(), bs)) end end end