From nobody Tue Mar 05 04:53:40 2024 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 4TpjrN6hXYz5Bmxp; Tue, 5 Mar 2024 04:53:40 +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 4TpjrN4ZTFz4qpB; Tue, 5 Mar 2024 04:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709614420; 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=mnmD/Xp++7XZZqdHdOLp31V/JFnhdNBnW8eg+3BB9Ko=; b=RdyFCkbZjNMT1XoEZKxKIEzTrn6nSSBStXOnPTo2Q2iDr6CCSsKrVz6mVQ9m8Atjb3iV4E 2Nc8S6dWvJuF4WRXKnBhcSQNbV0Ba4XTqOPwuZ+F0WswXmTQ9uRSCIYncmTnLwOF77tOxW LUC0jSmuH1BHUX6PKVZFLj3QYeVVhEgF9/VIVTMRsoaRWr6DKWiP53vVPUnKK9UedDoWWG +XboE53X+OCJvEHD85qWZlLXGsU7phcY8zsw5QN5X1tF1fXopD+vOlmraB3hcm7v2FMVzu 0uqJQx3qJWST2IlORu3gTragWOaQAl0fEhbPeNES66A+DloRgir8fk6NpP0zEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709614420; a=rsa-sha256; cv=none; b=jtCAeqGXOVvylVMu6YdlCpZemtRL5OR3risS/VP5cNwraJNU/aTnRtNR+pgqxOj+ZJIXVN BEfeYRTL7lYaOXHs4AyWM27CdmZ1zlYjDl9PqbVbKpM/ZjL9Y5oy3ghpF5FPhUDTBWBI8+ 0iLFxD/U/JkNqO0mm8Haxg4PXxiiw5TynLG9fVP7VVc3EbxniksTgHOoqf1IdcVjIAofr6 4vKc7+12jI+CA0McXbQZuo4PVstApE/RO3LiT3D2g2nmw/ZBpAp/ceUyf9wEHkErb56LHx Jg/VAsWzW1y5felMVpLP/nbz0hba571lfYZyv8YhugEYF7v94tUUlyUAJ7mqsg== 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=1709614420; 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=mnmD/Xp++7XZZqdHdOLp31V/JFnhdNBnW8eg+3BB9Ko=; b=TRD32L+tEXfP+RnGaJckkcTNMhTwfLk0t3hFB0M6tZUPJtx/hvO6ExRfUjXsKRTtQ2C4ez QCW8BBCuKVMmH2b83W24YrO0LRxjoP6JiuUFLqc9uNQc6yCFNJYg+iA0avnb6ENvW6Z+FS v8Vi90kJZnD6gyLiO2BcM+Ijuqiz2ZPQ0b0yGl7y35X3CltSiXIHm6l58saVbYRGnZmYcV R42CVHeA2TqbC66mYPz/tu3BY8Msk8AcZ3v2d5Eb2kNV3F4d5/AwrGbitEWq3R+VABD/R6 A4YY+O+l4DDNC6X0Lc4vQC9DLZG5pJZ2llhWlwkzst9CU9CSozfmqv50tNjNHg== 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 4TpjrN48qpzrwV; Tue, 5 Mar 2024 04:53:40 +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 4254re64027258; Tue, 5 Mar 2024 04:53:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4254re3i027255; Tue, 5 Mar 2024 04:53:40 GMT (envelope-from git) Date: Tue, 5 Mar 2024 04:53:40 GMT Message-Id: <202403050453.4254re3i027255@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: 169641f7dd9f - main - imgact_elf: Add const to a few struct image_params pointers 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 169641f7dd9f0fc23a158716b5ad81e5d5056661 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=169641f7dd9f0fc23a158716b5ad81e5d5056661 commit 169641f7dd9f0fc23a158716b5ad81e5d5056661 Author: Alex Richardson AuthorDate: 2024-03-05 04:51:49 +0000 Commit: John Baldwin CommitDate: 2024-03-05 04:51:49 +0000 imgact_elf: Add const to a few struct image_params pointers This makes it more obvious which functions modify fields in this struct. Reviewed by: imp, kib Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D44214 --- sys/kern/imgact_elf.c | 21 +++++++++++---------- sys/sys/imgact_elf.h | 6 +++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 8f85a4f5e18a..3863f0a2fdae 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -88,8 +88,9 @@ static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, const char *interp, int32_t *osrel, uint32_t *fctl0); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry); -static int __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset, - caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot); +static int __elfN(load_section)(const struct image_params *imgp, + vm_ooffset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, + vm_prot_t prot); static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp); static bool __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel); @@ -545,9 +546,9 @@ __elfN(map_partial)(vm_map_t map, vm_object_t object, vm_ooffset_t offset, } static int -__elfN(map_insert)(struct image_params *imgp, vm_map_t map, vm_object_t object, - vm_ooffset_t offset, vm_offset_t start, vm_offset_t end, vm_prot_t prot, - int cow) +__elfN(map_insert)(const struct image_params *imgp, vm_map_t map, + vm_object_t object, vm_ooffset_t offset, vm_offset_t start, vm_offset_t end, + vm_prot_t prot, int cow) { struct sf_buf *sf; vm_offset_t off; @@ -616,9 +617,9 @@ __elfN(map_insert)(struct image_params *imgp, vm_map_t map, vm_object_t object, return (KERN_SUCCESS); } -static int -__elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset, - caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot) +static int __elfN(load_section)(const struct image_params *imgp, + vm_ooffset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, + vm_prot_t prot) { struct sf_buf *sf; size_t map_len; @@ -721,7 +722,7 @@ __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset, } static int -__elfN(load_sections)(struct image_params *imgp, const Elf_Ehdr *hdr, +__elfN(load_sections)(const struct image_params *imgp, const Elf_Ehdr *hdr, const Elf_Phdr *phdr, u_long rbase, u_long *base_addrp) { vm_prot_t prot; @@ -2711,7 +2712,7 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, size_t *sizep) #define MAX_NOTES_LOOP 4096 bool -__elfN(parse_notes)(struct image_params *imgp, Elf_Note *checknote, +__elfN(parse_notes)(const struct image_params *imgp, Elf_Note *checknote, const char *note_vendor, const Elf_Phdr *pnote, bool (*cb)(const Elf_Note *, void *, bool *), void *cb_arg) { diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h index 3ddb438e14fc..92995d2f2dc3 100644 --- a/sys/sys/imgact_elf.h +++ b/sys/sys/imgact_elf.h @@ -123,9 +123,9 @@ void __elfN(prepare_notes)(struct thread *, struct note_info_list *, void __elfN(size_segments)(struct thread *, struct sseg_closure *, int); size_t __elfN(register_note)(struct thread *, struct note_info_list *, int, outfunc_t, void *); -bool __elfN(parse_notes)(struct image_params *, Elf_Note *, const char *, - const Elf_Phdr *, bool (*)(const Elf_Note *, void *, bool *), - void *); +bool __elfN(parse_notes)(const struct image_params *, Elf_Note *, + const char *, const Elf_Phdr *, + bool (*)(const Elf_Note *, void *, bool *), void *); /* Machine specific function to dump per-thread information. */ void __elfN(dump_thread)(struct thread *, void *, size_t *);