From nobody Fri Nov 01 15:45:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg4vN1VYbz5c0MC; Fri, 01 Nov 2024 15:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg4vM6lSTz4rlv; Fri, 1 Nov 2024 15:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hjqb0KgE1wJj5t3ivdzx+87dVvfNeAkipXMVkkyPjM4=; b=x2QGoGTxYX/S5kM9GA/09L6LxlJ7qIx7ZzO1BKMBkBwU5Hxld8vmbqix3TiUN6/0afNp5g HMm4GADqLCl7jiErJNicfXwi4wdraFFDk/p2D1doHHkwPPOQZA3yZod4wcWdVIszGd8Lo2 cPRHIYCfAM1d5kBd4zjDtQ5yhxvwTOMbHXYs7hV2ub9pE2ywYh1QHiVWRX3uKRrAJ0KofR FH3Yw/69gfCB0IkSpP56WN9lepvth/aCZIlFbXthnMZZgTyoVi9Ta/9jk4rLX24MxIzDBW KnIw5vOXHeovO05YPOQR/1dI/WlUoOsQY17xi+A1JJzey5VBWqDNNB1nkLQjNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hjqb0KgE1wJj5t3ivdzx+87dVvfNeAkipXMVkkyPjM4=; b=qbclQbUWDq7XcPJbdxSbdwxtuk9UbHCVLS767JTQ1AXJcUZC4DGlutbRyTk6aTB9cz/pIs 4Ag4kVg/Vy1z8FlqAN/wZIf9aeNmP4245D+RrJktqUdwig5Q1tgsb5NfCc/8537eGO9WLX kCGcR4U086Rck0WvjTQvwLbOppf8AZ2DbXhiXWv3uonDoaNAl/S9FQD3qzGQjq5K8Z1Gs4 9kw9LRfwF73/ap0Byepa7QJ3CFRHcSMiO5HVzTzq93MK+UECdvoz9Nt60D90zbiDSoz1CW ovH+Sx2aeq2inSOLi52JGNPzRdbW2J+755kZKe9SVodNCeC2/C2wnaWybuZgRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730475935; a=rsa-sha256; cv=none; b=LwKkijO4lhD8SmUUtjwM35o3g5npNN9v7VLhEKBdrtGKq3ra/pfaDhioI8M3gH3PEPyn53 oRI8RzoXbIGUL0qep/Pn1IkyS5SWUGD/lGBTxncZLULbrn8SSpGC9/Sm4juVD8ABhsPkoU vlEDJjXCeUg4J4M5/uhuUGxeuERfOpGcm2h6KI8WuJ4VWoYDN53U55GlJNBu5APM0h1ona 6O9rQ+C4ZSJbQf9ZcPUhPxfn++MALJ0GTxyaN1X9Lqz4QVkIAacR5NXO9DK7UjSTTx5Svh Vt8NEWVc9BqZ9Zv9wN051uY1rsbHaondpWZO6tdKvbbGRP9sE+VOgiHlGDuWMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg4vM5w0tzR1x; Fri, 1 Nov 2024 15:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1FjZOR029064; Fri, 1 Nov 2024 15:45:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1FjZma029061; Fri, 1 Nov 2024 15:45:35 GMT (envelope-from git) Date: Fri, 1 Nov 2024 15:45:35 GMT Message-Id: <202411011545.4A1FjZma029061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: bbc0f33b1317 - main - sysent: add a NOLIB modifer to prevent stub generation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbc0f33b1317bb922ff3d960216ce7b4af88b8af Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=bbc0f33b1317bb922ff3d960216ce7b4af88b8af commit bbc0f33b1317bb922ff3d960216ce7b4af88b8af Author: Brooks Davis AuthorDate: 2024-10-30 22:48:49 +0000 Commit: Brooks Davis CommitDate: 2024-11-01 15:44:47 +0000 sysent: add a NOLIB modifer to prevent stub generation The yield system call has long existed, but never had a stub. Replace the hardcoded checks for it in libsys_h.lua and syscalls_map.lua and stop inserting it into MIASM (requiring libsys/Makefile.sys to disable the stub). (This seems like overkill, but I've got another case in CheriBSD so this reduces my diff appreciably.) Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1503 --- sys/kern/syscalls.master | 3 ++- sys/tools/syscalls/core/syscall.lua | 1 + sys/tools/syscalls/scripts/libsys_h.lua | 2 +- sys/tools/syscalls/scripts/syscall_mk.lua | 4 ++-- sys/tools/syscalls/scripts/syscalls_map.lua | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 7a7530697e59..2bbd20b5a5b0 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -46,6 +46,7 @@ ; NOPROTO same as STD except do not create structure or ; function prototype in sys/sysproto.h. Does add a ; definition to syscall.h besides adding a sysent. +; NOLIB don't create stubs in libc or libsys ; NOTSTATIC syscall is loadable ; SYSMUX syscall multiplexer. No prototype, argument struct, or ; handler is declared or used. Handled in MD syscall code. @@ -1679,7 +1680,7 @@ _In_opt_ _Contains_ptr_ struct osigevent *sig ); } -321 AUE_NULL STD|CAPENABLED { +321 AUE_NULL STD|CAPENABLED|NOLIB { int yield(void); } 322 AUE_NULL OBSOL thr_sleep diff --git a/sys/tools/syscalls/core/syscall.lua b/sys/tools/syscalls/core/syscall.lua index ca96fc160211..e7e3dc3aac33 100644 --- a/sys/tools/syscalls/core/syscall.lua +++ b/sys/tools/syscalls/core/syscall.lua @@ -27,6 +27,7 @@ syscall.known_flags = util.set { -- flags beyond this point are modifiers "CAPENABLED", + "NOLIB", "NOTSTATIC", "SYSMUX", } diff --git a/sys/tools/syscalls/scripts/libsys_h.lua b/sys/tools/syscalls/scripts/libsys_h.lua index 75627f08750f..91349d5dc870 100755 --- a/sys/tools/syscalls/scripts/libsys_h.lua +++ b/sys/tools/syscalls/scripts/libsys_h.lua @@ -31,7 +31,7 @@ function libsys_h.generate(tbl, config, fh) local print_decl = function (sc) return sc:native() and not sc.type.NODEF and - not sc.type.SYSMUX and sc.name ~= "yield" + not sc.type.NOLIB and not sc.type.SYSMUX end -- Bind the generator to the parameter file. diff --git a/sys/tools/syscalls/scripts/syscall_mk.lua b/sys/tools/syscalls/scripts/syscall_mk.lua index 68438ee8d90c..49d3f6f86c20 100755 --- a/sys/tools/syscalls/scripts/syscall_mk.lua +++ b/sys/tools/syscalls/scripts/syscall_mk.lua @@ -44,7 +44,7 @@ function syscall_mk.generate(tbl, config, fh) for _, v in pairs(s) do local c = v:compatLevel() idx = idx + 1 - if v:native() and not v.type.NODEF then + if v:native() 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())) @@ -53,7 +53,7 @@ function syscall_mk.generate(tbl, config, fh) gen:write(string.format("\t%s.o \\\n", v:symbol())) end -- Handle compat (everything >= FREEBSD3): - elseif c >= 7 and not v.type.NODEF then + 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())) diff --git a/sys/tools/syscalls/scripts/syscalls_map.lua b/sys/tools/syscalls/scripts/syscalls_map.lua index 57bb5e9da93b..023b43052921 100755 --- a/sys/tools/syscalls/scripts/syscalls_map.lua +++ b/sys/tools/syscalls/scripts/syscalls_map.lua @@ -38,7 +38,7 @@ function syscalls_map.generate(tbl, config, fh) for _, v in pairs(s) do --print("num " .. v.num .. " name " .. v.name) - if v:native() and not v.type.NODEF and v.name ~= "yield" then + if v:native() and not v.type.NODEF and not v.type.NOLIB then if v.name ~= "exit" and v.name ~= "vfork" then gen:write(string.format("\t_%s;\n", v.name)) end