From nobody Mon Oct 16 16:59:21 2023 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 4S8Ncn5WQCz4xZp7; Mon, 16 Oct 2023 16:59:21 +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 4S8Ncn4shvz3SZN; Mon, 16 Oct 2023 16:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697475561; 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=J7xSUG2Fdxw3waXyVFOXzf/e3eOcg7id+0Y0RUkm/Ic=; b=ANj9vEOnDw3Sj8gZjOaLX5UWIXiRPFa01dvCqeLhgptUb6cu0bnSADCctwR7q8KcIxOX0n vFccuKpCL0LSegyLNSf/imja99+vDq+aGwtprH/C99IoQckJF2DGYSi4gZFzPk6Pklmagl /e8YEr8eaXgQ0s8KwAlYLWnoUpDEiYVcEPO+0X+2HapNPnPlsLM64Or2GML51IK9FXUX6H XgRJ1RpQsGOEGp9w/a17P0xr1vkqTW8vcaIPOwyUautbrxjwyaSbTooxEQ4yu7OUz39lVO as0+jctPhZEMd691Qli9rkwuKvHQTRjanwMhUtBBQD2EP2lAS+VFytOjGtsJoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697475561; a=rsa-sha256; cv=none; b=eVQGxzafJDy1glJHCmYwaU8gtIzQRyzNdNKakryM7Mw42IQ1mjJ4TSy/cFEyaAiRCs++ax otG/lHK+5U2X1VwAVOMY/bupVWA0SEKZXhE7WV0pBrFoMsJuyWydYXOG1pkb6nsVW7cnjH yzZAY8WYD3SmBPKcx4zV3WdfySYJT1kdnHK7rRRqbjRY4poHUILAt9v+eovt3YsbyhHEdN 7j/dmGmYRHqKx/AQwsMvohbGQQEoiLNkL5Mm3V6bMIGsUNbWZz9TChJUBH+XwSPd8AUgzY B08/QG2BbegxercsIkvmu3xpeLxg0+818Kmh/6SMDYt+uuWNyFXa4gpS2XCj5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697475561; 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=J7xSUG2Fdxw3waXyVFOXzf/e3eOcg7id+0Y0RUkm/Ic=; b=UWMPqerC90qX3+6T6u8ueVc0cHSfmCd3UIm5SOezdnqiWVNrZAE3WcurO8xV4ayDyhZb8D W+cYjugE4VKbgAynYbI1UYrCv+xydcY6qNu5AdL7sPyNeXcshwoBajV/lrmpQcoWPEozv8 ChXKmQ94taUE+YFgWkpzLW13bMMkJy/3/8M46xj2ygn6tjaj3MorZpbJsv9R8J6E1nRn8A wtYD1ADYMAlU1RNfCQxcQDIaL+W0cn1gwCOhG0vTAeyeoGOFPLGvz5ibdKs6JPnicFcy0U YurYrW3ooqvm1hN3XhG2zNA4/II0kFkfTZ3ij1cs+rRQsBswHmlp7FOy7Pb6/g== 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 4S8Ncn3tgrznlc; Mon, 16 Oct 2023 16:59:21 +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 39GGxLqW028963; Mon, 16 Oct 2023 16:59:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39GGxLAY028960; Mon, 16 Oct 2023 16:59:21 GMT (envelope-from git) Date: Mon, 16 Oct 2023 16:59:21 GMT Message-Id: <202310161659.39GGxLAY028960@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: 248fe3d3483c - main - libprocstat: improve conditional for 32-bit compat 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 248fe3d3483cb3ec2c78dd31dc02a467060a6577 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=248fe3d3483cb3ec2c78dd31dc02a467060a6577 commit 248fe3d3483cb3ec2c78dd31dc02a467060a6577 Author: Brooks Davis AuthorDate: 2023-10-16 16:53:29 +0000 Commit: Brooks Davis CommitDate: 2023-10-16 16:58:49 +0000 libprocstat: improve conditional for 32-bit compat Include support for translating 32-bit auxv vectors on non-64-bit platforms that aren't riscv (which has no 32-bit ABI support and probably never will). Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42201 --- lib/libprocstat/libprocstat.c | 6 +++--- lib/libprocstat/libprocstat.h | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index 031294387ca7..c6a225a021a7 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -2381,7 +2381,7 @@ procstat_getosrel(struct procstat *procstat, struct kinfo_proc *kp, int *osrelp) #define PROC_AUXV_MAX 256 -#if __ELF_WORD_SIZE == 64 +#ifdef PS_ARCH_HAS_FREEBSD32 static const char *elf32_sv_names[] = { "Linux ELF32", "FreeBSD ELF32", @@ -2464,7 +2464,7 @@ out: free(auxv32); return (auxv); } -#endif /* __ELF_WORD_SIZE == 64 */ +#endif /* PS_ARCH_HAS_FREEBSD32 */ static Elf_Auxinfo * procstat_getauxv_sysctl(pid_t pid, unsigned int *cntp) @@ -2473,7 +2473,7 @@ procstat_getauxv_sysctl(pid_t pid, unsigned int *cntp) int name[4]; size_t len; -#if __ELF_WORD_SIZE == 64 +#ifdef PS_ARCH_HAS_FREEBSD32 if (is_elf32_sysctl(pid)) return (procstat_getauxv32_sysctl(pid, cntp)); #endif diff --git a/lib/libprocstat/libprocstat.h b/lib/libprocstat/libprocstat.h index 0df01817663e..3d30b4db4018 100644 --- a/lib/libprocstat/libprocstat.h +++ b/lib/libprocstat/libprocstat.h @@ -102,6 +102,11 @@ #define PS_FST_FFLAG_EXEC 0x2000 #define PS_FST_FFLAG_HASLOCK 0x4000 +#if !defined(__ILP32__) && !defined(__riscv) +/* Target architecture supports 32-bit compat */ +#define PS_ARCH_HAS_FREEBSD32 1 +#endif + struct kinfo_kstack; struct kinfo_proc; struct kinfo_vmentry;