From nobody Thu Oct 26 17:37:37 2023 X-Original-To: dev-commits-src-branches@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 4SGY0L0Gpwz4y5Fx; Thu, 26 Oct 2023 17:37:38 +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 4SGY0K57WCz4ZnZ; Thu, 26 Oct 2023 17:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698341857; 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=qrtA6uTStpwpzJDd8TWWHcy7C0EUbv7PaGVC2afbbWk=; b=HGUaSV1k36wOykTN05GWpHpU3r6hLaZcGwaPShGGqj1Ttt2NoLk+dZTy8uT4pcNhYKAFhR 3cf9H88SzpTTIhYp9Xi5YySd8t9hv73Sl4h+n+O9HCE4ducXeNh0Ehm+HG8tlLXEBkGbV9 DzuEdEVSnsoBlZZCUYEzhq5867pOeOLcxz7ax5j5t8aqtrVOfw2jeqFRSHOGxNq/ghGiKt /C5xdDUq6ZZk1O9io/8ODpHGaHzVQ3I94ipbROygEyU7qb+vkxXfY0BfIU/u3kR50cvu+1 7z0Z8pnS8VaZ52z21tuJNF+TQafANDjKnwc3+CAVsHBfN0tw+oS0j3W5HmkVZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698341857; 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=qrtA6uTStpwpzJDd8TWWHcy7C0EUbv7PaGVC2afbbWk=; b=axePVlxEYOLxW1rbihdSo88LK0VNIBhh+nc0Web9uHlMy5bq6EZApjFMm2P2rtHtbgdEVH /WRX318XH+Enpq6A97cawB+l3lMet+IurTLTK/nxl5RlkLEXVLpJH6p6DFJDcKSTQYuSKP u3z0RUUg61H/tZ6NNCyqP0ZimMsVSUX5lP78NJ7/2Mh7HNCBHmbMip+d+wRRM+Zf1rZoT7 dOtVWteJq5SUraDEoKopIPzOrdldQx//9BIxXQpMevMtppfZIIc07UpNqZ1fhdDR7vmGzi NqWUPGRfYiURzn7b9a5g8jz1teHA7PKIGUeZMiSi1yy7U3Dz1YO4PAcDI3h8XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698341857; a=rsa-sha256; cv=none; b=HluPcW3hxLgMrLbtnHTReYyt3o3PNXaOMiveG5EAp9xpOPRQ64bS9NG6ofbpqYsMnkFyBq /73ThGmEk6SjLfJrAihStAIKl+yW4/3oFnCyqkzk4yQIaENUPlwlvLOrOHax3QK/FCCzH4 W0kull8aTze7BwWAVY2EQcuITKBQocOj+bkIsEnPn9dd+pVRI6MRGHdg2RR1pYLss3coog 77EBIpKXDyI4IpV2M1CJ6rKSHs2gSrMuj0ZxVhaM65nWcIG8Tw7ytVhpKfK6mqqboaqPLP Eu2KaZYebDXYlTLDp0oxUaAzfMKif3D/CtqJLrirk5C3V0k/XcB8k6Oe6+/qVQ== 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 4SGY0K3y7Qzgfy; Thu, 26 Oct 2023 17:37:37 +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 39QHbbFg089859; Thu, 26 Oct 2023 17:37:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39QHbbHJ089857; Thu, 26 Oct 2023 17:37:37 GMT (envelope-from git) Date: Thu, 26 Oct 2023 17:37:37 GMT Message-Id: <202310261737.39QHbbHJ089857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 58a50eabf390 - stable/14 - libprocstat: improve conditional for 32-bit compat List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 58a50eabf390afd621a00dad46ea15fd343189fc Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=58a50eabf390afd621a00dad46ea15fd343189fc commit 58a50eabf390afd621a00dad46ea15fd343189fc Author: Brooks Davis AuthorDate: 2023-10-16 16:53:29 +0000 Commit: Brooks Davis CommitDate: 2023-10-25 23:31:02 +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 (cherry picked from commit 248fe3d3483cb3ec2c78dd31dc02a467060a6577) --- 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;