From nobody Mon Feb 5 20:38:42 2024 X-Original-To: dev-commits-src-main@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 4TTJBB48YQz58y2T; Mon, 5 Feb 2024 20:38:42 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TTJBB2qhpz4qKh; Mon, 5 Feb 2024 20:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707165522; 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=hXfvIiItcae46gKqwVGPf+7+mgO3/w5MuETHK5vJVbo=; b=VPmVWQLbF8ZrTqyFrOjnP4R+YPFS4IwCm6MZhULuEqr2aP/y442dJE9zsFiIFVr5pimpQi heiFx6ZVTsK7xhR/2WjwJw6ju/y5uupgZ4SzXudsOyEEkOiL8RUHff0Dn9Ob99erIX3YVU s3WhDBbkoBbAwMa91zS8vDaovXtHMkzkjVAkRn8avYShl5ymhJhmJK9mSpnluuL5CRJsTI eshpcnC9FxN8Y5EQrD+CuZNI2mjpCDmmyg0S12KTNdwB/Nry9SGbZD0ZMv4SaVspOYJCrw tVgDD0t5fWi2BC2uY+jB0HVEdLiTzFnnI8RNYtVBe3r7nVJ7yJzI8Gx2S6Rc7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707165522; 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=hXfvIiItcae46gKqwVGPf+7+mgO3/w5MuETHK5vJVbo=; b=O+5+b7/Cn3kHmBrhnbXfIeA73aju3aXuTYiQN26zhBf59GcKggs6BJ97d4yteq9jm1ATY6 eXM/8LGG8n1e1MsW+eiNaSH7Ohs2R0v6kbINQ0zO7odu4eoU3MC4lWFgfvtEt40mtRGmge IwNN1KQbUjdhd8z180A03kQDBXIjLOoAVBivhtIcPGVmbb81Ze/zE+X+CmoD9htUr1lLiV VXeL9o7fw6ScB+Yrf2sJvVQCsnTZcgV3fdHWMbloOHLXtGsMjlHzZ+ADgxO9aWh69CqXUh amWpcNH0ACYdnxioEJOxNNb2zy7lHx325TJRSd6RBZfSgm1X2DjYtF1Z5giNqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707165522; a=rsa-sha256; cv=none; b=cjk89sTG72NLFoCah5Netn+F28ldfHsEcwl3nG7HjQGLqDafKjClOl+9XNv96wwqpd6g1w hT9GKnh3F6U+9mJxxTvGVZ+lagHX/QQHBwFt9fHVorgH3uvEE0zCO0YMXtjo96lqdtr/0S 4kHdpnshSY3Ie670VogiGJi0mAyRNMkZxJAdYDifh4nPsyiFgcBYfP37gvMPRinXgz3Euu Q3xHEtESbBRjuiIcn8RsOeLM+BbtSedqMMngYuVP2Ld5DKRekHn0U82opQa7esET/zsgvo k3i9fhuEXl4IIYdhn136bpm39GEN8Ft2KLZs/hV+z97Gkgpf2/2vPNBu9lj6uw== 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 4TTJBB1fJtzvMG; Mon, 5 Feb 2024 20:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 415KcgSA069534; Mon, 5 Feb 2024 20:38:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 415KcgXg069531; Mon, 5 Feb 2024 20:38:42 GMT (envelope-from git) Date: Mon, 5 Feb 2024 20:38:42 GMT Message-Id: <202402052038.415KcgXg069531@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: b71defdbd871 - main - makesyscalls: generate private syscall symbols List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: b71defdbd8715c1a778ebf8195e41b1c6db90d6c Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=b71defdbd8715c1a778ebf8195e41b1c6db90d6c commit b71defdbd8715c1a778ebf8195e41b1c6db90d6c Author: Brooks Davis AuthorDate: 2023-11-21 16:55:06 +0000 Commit: Brooks Davis CommitDate: 2024-02-05 20:34:56 +0000 makesyscalls: generate private syscall symbols For libsys we need to expose all the private symbols (_ and __sys_ prefixes) so libsys can replace the libc versions. Rather than trying to maintain a table, teach makesyscalls to generate it. There are a small number of "_" prefixed symbols that are exposed as public interfaces rather than in the private symbol space. Since the list is short, just hardcode it for now. If doesn't appear that we need to export freebsd#_foo symbols for compat system calls explicitly. If it turns out we do, there are probably few enough of them to handle seperately. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908 --- sys/tools/makesyscalls.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua index 393fe57713aa..1c80aa44c1a7 100644 --- a/sys/tools/makesyscalls.lua +++ b/sys/tools/makesyscalls.lua @@ -42,6 +42,7 @@ local generated_tag = "@" .. "generated" local config = { os_id_keyword = "FreeBSD", -- obsolete, ignored on input, not generated abi_func_prefix = "", + libsysmap = "/dev/null", sysnames = "syscalls.c", sysproto = "../sys/sysproto.h", sysproto_h = "_SYS_SYSPROTO_H_", @@ -85,6 +86,7 @@ local output_files = { "sysnames", "syshdr", "sysmk", + "libsysmap", "syssw", "systrace", "sysproto", @@ -922,6 +924,12 @@ local function handle_noncompat(sysnum, thr_flag, flags, sysflags, rettype, config.syscallprefix, funcalias, sysnum)) write_line("sysmk", string.format(" \\\n\t%s.o", funcalias)) + if funcalias ~= "exit" and funcalias ~= "getlogin" and funcalias ~= "vfork" then + write_line("libsysmap", string.format("\t_%s;\n", + funcalias)) + end + write_line("libsysmap", string.format("\t__sys_%s;\n", + funcalias)) end end @@ -1485,6 +1493,13 @@ write_line("sysmk", string.format([[# FreeBSD system call object files. # DO NOT EDIT-- this file is automatically %s. MIASM = ]], generated_tag)) +write_line("libsysmap", string.format([[/* + * FreeBSD system call symbols. + * DO NOT EDIT-- this file is automatically %s. + */ +FBSDprivate_1.0 { +]], generated_tag)) + write_line("systrace", string.format([[/* * System call argument to DTrace register array converstion. * @@ -1548,6 +1563,7 @@ write_line("sysprotoend", string.format([[ ]], config.sysproto_h)) write_line("sysmk", "\n") +write_line("libsysmap", "};\n") write_line("sysent", "};\n") write_line("sysnames", "};\n") -- maxsyscall is the highest seen; MAXSYSCALL should be one higher