sysent: add a new NORETURN type flag

System calls of type NORETURN don't return and their stubs are declare
not to.

Reviewed by:	kevans, kib
Differential Revision:	https://reviews.freebsd.org/D51673
This commit is contained in:
Brooks Davis committed 2025-08-08 10:30:17 +01:00
1 parent 8433f8cd06
commit 202ac0975e
3 files changed
+8 -2

No files matched your search

+1
View File
@@ -51,6 +51,7 @@
; SYSMUX syscall multiplexer. No prototype, argument struct, or
; handler is declared or used. Handled in MD syscall code.
; CAPENABLED syscall is allowed in capability mode
; NORETURN the syscall does not return
;
; To support programmatic generation of both the default ABI and 32-bit compat
; (freebsd32) we impose a number of restrictions on the types of system calls.
+1
View File
@@ -28,6 +28,7 @@ syscall.known_flags = util.set {
-- flags beyond this point are modifiers
"CAPENABLED",
"NOLIB",
"NORETURN",
"NOTSTATIC",
"SYSMUX",
}
+6 -2
View File
@@ -76,8 +76,12 @@ function libsys_h.generate(tbl, config, fh)
for _, v in pairs(s) do
if print_decl(v) then
gen:write(string.format("%s __sys_%s(%s);\n",
v.ret, v.name, v.argstr_type_var))
local ret_attr = "";
if v.type.NORETURN then
ret_attr = "_Noreturn "
end
gen:write(string.format("%s%s __sys_%s(%s);\n",
ret_attr, v.ret, v.name, v.argstr_type_var))
end
end