From nobody Thu Feb 02 14:59:04 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 4P72492B7hz3fkJm; Thu, 2 Feb 2023 14:59:05 +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 4P72490pj5z3F3j; Thu, 2 Feb 2023 14:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675349945; 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=Dc8Y5a0xWIOPZuKQ9xBm70I1Bj9sM/DfSmfAaXAoFTE=; b=kQLrb9nwzmUit6PRlzccvOA+ibYYxzqpadPFllIIwCUWgDGTKfEUP1NvRMBgb875d11NKt 6DFpGOF3m9FQyv1xh8WpZbGPIyOapUlwA26JHG+k57ik25jR+av6AmrNqPEuREmC3XXl5+ onQitbp6qk4ElNxYXja5TbNMS13ANF9aje7lqIirs9H3+pWddwNH15vLEVClH1S/qLAkxX EveneEKZeZkA4EpjOi/QStnEoVrKziGd/cy3k1nOTX1rURI7+utx07ZgTLjT1HGt6Sn0cX kuBHsOMNyj4ANaFbQ3dkLkU3WT7jf6w/Cxgua/WNdMnQX3fVvpNP/itbWoNLiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675349945; 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=Dc8Y5a0xWIOPZuKQ9xBm70I1Bj9sM/DfSmfAaXAoFTE=; b=RZTZz2FvGm+ECDa9/wdZbjCv7yduTHP38dGikKUzjQBj0rn4tpRmFoTWeVxYtlvIUFX4sA hEyqieCiGw4izxEs/c8t3S/9QvYkM40uAxzjJNnoQCR4Rehc9RQvqPP13JInGVpAQnxNyd O7at2Pc3mQRVCm1K7mkzovqbtPc0wyLe0Ypea3BuFvEbeo2E2+E5mA6chz7/F5rthgxqDE v7z35HEXUZrN7M0oNdlaMAhhcTvBJdndEHIceSgMfIifTcR7hEx3bAqIrKMZ1yRpehBFCo /dzrRB5j2XNrikr7Z1IFKeXiQX8un6gk7buZEN4l5J1SyKwYII6pXK1fIQ427g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675349945; a=rsa-sha256; cv=none; b=DWaFvPpkCFIqOgQDDKf6LEHYBUiqxk11936Kz5gUWs8ql5sGi1l2cq8R46k01NoE8HG8tE SE+Tz4bER+aJtE0ybW7eW91TJkjvdbF5PQ50UK+cJQNtyRvt6j+75c40R66TpX6cUm7gkH uvAzp6ThQNNeg5PEnIZeWD2uLhvkLjXbxxqpGsxgWpf3JZ06Znsxmivrs6nkXzoyNWpPba wSvcOdtVrjj2WKYrEcWE6tivqkP6u5HLZVS20/PTTdRjhx0FrU58n88cFtyALTrzzZTKTk rFv0pEGD1oX3r5p6b4XR4crd0gekB2NwImXgYSDKDtImz1We2dAB3YOPuuaqig== 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 4P72486lB2zyS3; Thu, 2 Feb 2023 14:59:04 +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 312Ex4JS092037; Thu, 2 Feb 2023 14:59:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 312Ex4q1092036; Thu, 2 Feb 2023 14:59:04 GMT (envelope-from git) Date: Thu, 2 Feb 2023 14:59:04 GMT Message-Id: <202302021459.312Ex4q1092036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 7446514533a4 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 7446514533a40b376eaeb349ea33531ce9c711c2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7446514533a40b376eaeb349ea33531ce9c711c2 commit 7446514533a40b376eaeb349ea33531ce9c711c2 Author: Dmitry Chagin AuthorDate: 2023-02-02 14:58:06 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-02 14:58:06 +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 --- 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 2a9e4909340b..3a2757338c89 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 15caa5a2c2cc..9f681a85647e 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 9a82dc94b6ac..eafdbcbabff8 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