Skip to content

Commit

Permalink
makesyscalls: reduce redundency in syscall.mk code
Browse files Browse the repository at this point in the history
The two outer blocks had identical contents and the two inner blocks
differed in a single location.

Sponsored by:	DARPA, AFRL
  • Loading branch information
brooksdavis committed Jan 21, 2025
1 parent 26b050c commit 2cf57ad
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions sys/tools/syscalls/scripts/syscall_mk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 56 in sys/tools/syscalls/scripts/syscall_mk.lua

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
Expand Down

0 comments on commit 2cf57ad

Please sign in to comment.