From nobody Thu Feb 09 07:56:41 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 4PC8MY4ByVz3mxwn; Thu, 9 Feb 2023 07:56:41 +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 4PC8MY1pMnz44qx; Thu, 9 Feb 2023 07:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929401; 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=0SE9TYRTa21TrnLyubEFC57cES/HOKNC7VJNHt7iumU=; b=qhnMdmjswL7+sHpjr742H4gIpwuOtEkmDPQZRrpxw761tei5molLIqr8cz7du0hYyfwiQF V2/UijDyiQAVNnURnXyLw7ylKi727/dbzHJ7anrGHu+2cnba2H7nFymgq3mP1L5/f+wuOh lQriv97ThV//Dlvaj9aJCmxz5x4rd68KPqjkHSiYiTeE79FM1U1KwXPwY1uP8UdkPaZO9d 5bBnK05MRi7QeVJz+D3/a87CqIg55s1LvGRdAULgeXhPSY/wjR/P7L2JgrS/0xWQYtSJ5p a3B3oj/k3eJUeW0l8Kno4h39pGz/lFo4oFiOSxjBfMZ+pmg2N/O5l+oCHRwjiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675929401; 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=0SE9TYRTa21TrnLyubEFC57cES/HOKNC7VJNHt7iumU=; b=dUU591vcj1Y5Q6/IqBneJZWqwqeO2YAt2qyXcKWEQSqq7bADN+mW3hzGdCseHfQWxQ91SQ wFPrkalwdggwL8W0wJi5LGonZ/Dy+2lkOsL71urSnljB6XRSg1if9I0kHfBXO/pXNGdDKc VfK92a0YXwwBtKxvjzzJ2sQuSPZwJIxq0LM+XK6SlcSwe4sqDT8S013DK+ICczdmb/GY6m rZVSL9Gj75miczkMDCQXaYA/93Jl+Ef0V9+IpCcZnjfVA1Zc9K9GKzv4N9lC53dcMgYXHm j7dMuw7AFk3+1zfueU2ylslgl1ObEWh3cpSJzEXZccXd1w7OCbFG3WptC1q8UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675929401; a=rsa-sha256; cv=none; b=nQceAGElz6YHbwfLW00HUR6ZG3ghKajSmcLJmPOo3Q2qUwkVSFbVfPH2gN0PS+FSCG/pQ4 sQhqLqlOwLYjOwzcOCtiIAoGAyubEj+gm+2Auj475ILT4dvkCEloUxjIpjnUPaTZFc4iHJ Wt/5znViNWBp17/n2RFcttkULmc3hjEez9pw/z17DeOtp6R+JWfLItLNisdBWIH/7Z22tE 9h8PCToHSU10tKs9JwQmrjRBIXWG35pWeyJW4LqCpyRNgVQCNwhkG1RiiNInjwTsWBtvWx Ql2ULbPCz2qhpQ2xr2j9S0XezLYO/O8+ONdKdY9ZJXTahmRNYzg5Ml2n1I7skA== 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 4PC8MY0vxgzVSv; Thu, 9 Feb 2023 07:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3197ufJG092845; Thu, 9 Feb 2023 07:56:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3197uf9w092844; Thu, 9 Feb 2023 07:56:41 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:56:41 GMT Message-Id: <202302090756.3197uf9w092844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 4f5d095fb4af - stable/13 - linux(4): Microoptimize linux_elf.h for future use. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f5d095fb4afb59dca19c0fb3e5004711538d0bf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=4f5d095fb4afb59dca19c0fb3e5004711538d0bf commit 4f5d095fb4afb59dca19c0fb3e5004711538d0bf Author: Dmitry Chagin AuthorDate: 2023-02-02 14:58:06 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-09 07:54:16 +0000 linux(4): Microoptimize linux_elf.h for future use. In order to reduce code duplication move coredump support definitions into the appropriate header and hide private definitions. MFC after: 1 week (cherry picked from commit 7446514533a40b376eaeb349ea33531ce9c711c2) --- sys/amd64/linux/linux_sysvec.c | 1 + sys/amd64/linux32/linux32_sysvec.c | 1 + sys/arm64/linux/linux_sysvec.c | 3 +++ sys/compat/linux/linux_elf.c | 28 ++++++++++++++++++++++++---- sys/compat/linux/linux_elf.h | 30 ++++++++---------------------- sys/compat/linux/linux_emul.h | 6 ------ 6 files changed, 37 insertions(+), 32 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 60e90c03ad95..eb45fa183f84 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index dc87d1a8a531..6aa171c3f5ea 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 2533092b4cfd..bc9b0de9b095 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#define __ELF_WORD_SIZE 64 + #include #include #include @@ -59,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index b02b6e2cc777..e73dbdae888e 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -61,11 +61,31 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#include -#include -/* This adds "linux32_" and "linux64_" prefixes. */ -#define __linuxN(x) __CONCAT(__CONCAT(__CONCAT(linux,__ELF_WORD_SIZE),_),x) +struct l_elf_siginfo { + l_int si_signo; + l_int si_code; + l_int si_errno; +}; + +typedef struct linux_pt_regset l_elf_gregset_t; + +struct linux_elf_prstatus { + struct l_elf_siginfo pr_info; + l_short pr_cursig; + l_ulong pr_sigpend; + l_ulong pr_sighold; + l_pid_t pr_pid; + l_pid_t pr_ppid; + l_pid_t pr_pgrp; + l_pid_t pr_sid; + l_timeval pr_utime; + l_timeval pr_stime; + l_timeval pr_cutime; + l_timeval pr_cstime; + l_elf_gregset_t pr_reg; + l_int pr_fpvalid; +}; #define LINUX_NT_AUXV 6 diff --git a/sys/compat/linux/linux_elf.h b/sys/compat/linux/linux_elf.h index 4bb9318e360b..18d229d8481e 100644 --- a/sys/compat/linux/linux_elf.h +++ b/sys/compat/linux/linux_elf.h @@ -28,29 +28,15 @@ #ifndef _COMPAT_LINUX_ELF_H_ #define _COMPAT_LINUX_ELF_H_ -struct l_elf_siginfo { - l_int si_signo; - l_int si_code; - l_int si_errno; -}; +struct note_info_list; -typedef struct linux_pt_regset l_elf_gregset_t; +/* Linux core notes are labeled "CORE" */ +#define LINUX_ABI_VENDOR "CORE" -struct linux_elf_prstatus { - struct l_elf_siginfo pr_info; - l_short pr_cursig; - l_ulong pr_sigpend; - l_ulong pr_sighold; - l_pid_t pr_pid; - l_pid_t pr_ppid; - l_pid_t pr_pgrp; - l_pid_t pr_sid; - l_timeval pr_utime; - l_timeval pr_stime; - l_timeval pr_cutime; - l_timeval pr_cstime; - l_elf_gregset_t pr_reg; - l_int pr_fpvalid; -}; +/* This adds "linux32_" and "linux64_" prefixes. */ +#define __linuxN(x) __CONCAT(__CONCAT(__CONCAT(linux,__ELF_WORD_SIZE),_),x) + +void __linuxN(prepare_notes)(struct thread *, struct note_info_list *, + size_t *); #endif diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h index 9b552ab9c720..fde97c01895f 100644 --- a/sys/compat/linux/linux_emul.h +++ b/sys/compat/linux/linux_emul.h @@ -33,10 +33,6 @@ #define _LINUX_EMUL_H_ struct image_params; -struct note_info_list; - -/* Linux core notes are labeled "CORE" */ -#define LINUX_ABI_VENDOR "CORE" /* * modeled after similar structure in NetBSD @@ -61,8 +57,6 @@ void linux_schedtail(struct thread *); void linux_on_exec(struct proc *, struct image_params *); void linux_thread_dtor(struct thread *); int linux_common_execve(struct thread *, struct image_args *); -void linux32_prepare_notes(struct thread *, struct note_info_list *, size_t *); -void linux64_prepare_notes(struct thread *, struct note_info_list *, size_t *); /* process emuldata flags */ #define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated