From nobody Mon Mar 04 19:55:24 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 4TpTvK2vjSz5DBXx; Mon, 4 Mar 2024 19:55:25 +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 4TpTvK1RGtz4j8C; Mon, 4 Mar 2024 19:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709582125; 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=oFGS9H+FSXc0x7TKuxwTtRoN1H4kM9QmhXEcCm0LBHs=; b=ZCpAesgNWsKSjNUYuzyW3MXbtfeOveQmpr229LAwR1Pupjg4xFrR116o/RMV4oZya4Nf9U 0StejFZ+qFy1JzNrFBTgG2CxWM8aotFpue14QW8+BX6xDn/2LAvMaV0Djc3yonEw/nipby LeLlVXc0LHvgCSmoK9dlsmYhEfm1G7oFQsRiMke4oYXwhA2RCyx/fC3VM6dKfQwxcl+MGN z0u2P0JxyntUEsfmc0ycJwt5nyk5WA1bGQ+Adx+Cd8qpjSLshgvLWoWFJ7nsUTbmz+N+nw H5+3wpNr3dQMXQAzfUW+EyzohNobcdSK/kSyvF6SJYY+qbMhgZWGJQruTXkb0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709582125; a=rsa-sha256; cv=none; b=JeTfzk6+tk49NS5qUgEsEYCrqyxj/asELo9oaAYtB9lIgqcuSFytWYRfscbI3KGg0es+uK DtUO10g6YNhik90afGXZck5PfknsKPpGn9vjB9C3KEpgMf3qHSBqRV4XiWQD8klWiifNf9 v0EWFxEsO1jDrR8rWu1om0sviTjYD3sI2rjZFEtoMdrE2D9+1X4XdXLKowOMCLqfncOzOH pWEkhISVz7uu4mrx3tuc1daZI6SL0pXizqavHp3LI92o+YXB3J+I4tSc7s5O9QHN9raN2y 5HrD/Sz10CvZBpRnF9Mc4MtQjfyuKGfqKZDW1pLbkpmTa4JoDzQdy+ONZDOkHw== 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=1709582125; 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=oFGS9H+FSXc0x7TKuxwTtRoN1H4kM9QmhXEcCm0LBHs=; b=pZAb67TJglhYDao/4nM/pXabFqi4wizOeyIhfZpbyGi/mV2OCfx61dA8MgQbiGL/QMDtsD E81gjqj+Brc98pu0FWuWddAO+1i9596OJNRVNS14u7MMUmBVxApsXdBxglZV1XtbDIiCqb lXjJJ0nf6jzkBYkaUtke2gKrtebwHJJE+1lFJeNy2b1OlBcvBBh83J//BL8JUDsgCxk/2A CyOSS6ikG9UshEGsQdtYP5T/18P8ArYfzn4teO151bxTh6FtwNm/Ykp4W8+Pp26n3B0gnP 4P0rqAQKgeTHCFKNyJ2UEpuhNZrlWsTBBdgVd/t4qr3aOxPyUfwmBjalth8Ogg== 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 4TpTvK0WBtzbFx; Mon, 4 Mar 2024 19:55:25 +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 424JtOJm015224; Mon, 4 Mar 2024 19:55:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 424JtOps015221; Mon, 4 Mar 2024 19:55:24 GMT (envelope-from git) Date: Mon, 4 Mar 2024 19:55:24 GMT Message-Id: <202403041955.424JtOps015221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 327ada0b0ec0 - main - imgact_elf: Add const to the header_supported callback arguments 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 327ada0b0ec0044cea016f7e8333a5a3754eb8af Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=327ada0b0ec0044cea016f7e8333a5a3754eb8af commit 327ada0b0ec0044cea016f7e8333a5a3754eb8af Author: Alex Richardson AuthorDate: 2024-03-04 19:52:21 +0000 Commit: John Baldwin CommitDate: 2024-03-04 19:52:21 +0000 imgact_elf: Add const to the header_supported callback arguments This callback shouldn't be modifying any of the arguments. Reviewed by: imp, kib, emaste, jhb Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D44193 --- sys/amd64/amd64/elf_machdep.c | 4 ++-- sys/arm/arm/elf_machdep.c | 8 ++++---- sys/arm64/arm64/elf32_machdep.c | 8 ++++---- sys/powerpc/powerpc/elf64_machdep.c | 16 ++++++++-------- sys/sys/imgact_elf.h | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c index a66faf3d347e..0e6c8d310dfd 100644 --- a/sys/amd64/amd64/elf_machdep.c +++ b/sys/amd64/amd64/elf_machdep.c @@ -165,8 +165,8 @@ amd64_lower_shared_page(struct sysentvec *sv) } static bool -freebsd_brand_info_la57_img_compat(struct image_params *imgp, - int32_t *osrel __unused, uint32_t *fctl0) +freebsd_brand_info_la57_img_compat(const struct image_params *imgp, + const int32_t *osrel __unused, const uint32_t *fctl0) { if ((imgp->proc->p_md.md_flags & P_MD_LA57) != 0) return (true); diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c index 7c91dfe3babc..e1003b71543a 100644 --- a/sys/arm/arm/elf_machdep.c +++ b/sys/arm/arm/elf_machdep.c @@ -54,8 +54,8 @@ #include "opt_global.h" /* for OPT_KDTRACE_HOOKS */ #include "opt_stack.h" /* for OPT_STACK */ -static bool elf32_arm_abi_supported(struct image_params *, int32_t *, - uint32_t *); +static bool elf32_arm_abi_supported(const struct image_params *, + const int32_t *, const uint32_t *); u_long elf_hwcap; u_long elf_hwcap2; @@ -121,8 +121,8 @@ SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, &freebsd_brand_info); static bool -elf32_arm_abi_supported(struct image_params *imgp, int32_t *osrel __unused, - uint32_t *fctl0 __unused) +elf32_arm_abi_supported(const struct image_params *imgp, + const int32_t *osrel __unused, const uint32_t *fctl0 __unused) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c index de0ee9607ad1..fd2a2690b7a1 100644 --- a/sys/arm64/arm64/elf32_machdep.c +++ b/sys/arm64/arm64/elf32_machdep.c @@ -76,8 +76,8 @@ static void freebsd32_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void freebsd32_set_syscall_retval(struct thread *, int); -static bool elf32_arm_abi_supported(struct image_params *, int32_t *, - uint32_t *); +static bool elf32_arm_abi_supported(const struct image_params *, + const int32_t *, const uint32_t *); static void elf32_fixlimit(struct rlimit *rl, int which); extern void freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); @@ -167,8 +167,8 @@ register_elf32_brand(void *arg) SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, register_elf32_brand, NULL); static bool -elf32_arm_abi_supported(struct image_params *imgp, int32_t *osrel __unused, - uint32_t *fctl0 __unused) +elf32_arm_abi_supported(const struct image_params *imgp, + const int32_t *osrel __unused, const uint32_t *fctl0 __unused) { const Elf32_Ehdr *hdr; diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c index 6edfd965b7ec..b780a2ed82fc 100644 --- a/sys/powerpc/powerpc/elf64_machdep.c +++ b/sys/powerpc/powerpc/elf64_machdep.c @@ -145,10 +145,10 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_regset_end = SET_LIMIT(__elfN(regset)), }; -static bool ppc64_elfv1_header_match(struct image_params *params, - int32_t *, uint32_t *); -static bool ppc64_elfv2_header_match(struct image_params *params, - int32_t *, uint32_t *); +static bool ppc64_elfv1_header_match(const struct image_params *params, + const int32_t *, const uint32_t *); +static bool ppc64_elfv2_header_match(const struct image_params *params, + const int32_t *, const uint32_t *); static Elf64_Brandinfo freebsd_brand_info_elfv1 = { .brand = ELFOSABI_FREEBSD, @@ -221,8 +221,8 @@ ppc64_init_sysvecs(void *arg) SYSINIT(elf64_sysvec, SI_SUB_EXEC, SI_ORDER_ANY, ppc64_init_sysvecs, NULL); static bool -ppc64_elfv1_header_match(struct image_params *params, int32_t *osrel __unused, - uint32_t *fctl0 __unused) +ppc64_elfv1_header_match(const struct image_params *params, + const int32_t *osrel __unused, const uint32_t *fctl0 __unused) { const Elf64_Ehdr *hdr = (const Elf64_Ehdr *)params->image_header; int abi = (hdr->e_flags & 3); @@ -231,8 +231,8 @@ ppc64_elfv1_header_match(struct image_params *params, int32_t *osrel __unused, } static bool -ppc64_elfv2_header_match(struct image_params *params, int32_t *osrel __unused, - uint32_t *fctl0 __unused) +ppc64_elfv2_header_match(const struct image_params *params, + const int32_t *osrel __unused, const uint32_t *fctl0 __unused) { const Elf64_Ehdr *hdr = (const Elf64_Ehdr *)params->image_header; int abi = (hdr->e_flags & 3); diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h index 51e149476a28..3ddb438e14fc 100644 --- a/sys/sys/imgact_elf.h +++ b/sys/sys/imgact_elf.h @@ -86,8 +86,8 @@ typedef struct { const char *interp_newpath; int flags; Elf_Brandnote *brand_note; - bool (*header_supported)(struct image_params *, - int32_t *, uint32_t *); + bool (*header_supported)(const struct image_params *, + const int32_t *, const uint32_t *); /* High 8 bits of flags is private to the ABI */ #define BI_CAN_EXEC_DYN 0x0001 #define BI_BRAND_NOTE 0x0002 /* May have note.ABI-tag section. */