From owner-dev-commits-src-all@freebsd.org Mon Feb 1 14:41:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2283F52C248; Mon, 1 Feb 2021 14:41:39 +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 4DTrHR0WyGz3l0g; Mon, 1 Feb 2021 14:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 04D311CC79; Mon, 1 Feb 2021 14:41:39 +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 111EfcEd056174; Mon, 1 Feb 2021 14:41:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Efc7G056173; Mon, 1 Feb 2021 14:41:38 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:41:38 GMT Message-Id: <202102011441.111Efc7G056173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau Monné Subject: git: 45ecda8ebf80 - main - stand/amd64: remove unused addr parameter from bi_load64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45ecda8ebf80bb341aa3b4955810518ae6fab158 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 14:41:39 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=45ecda8ebf80bb341aa3b4955810518ae6fab158 commit 45ecda8ebf80bb341aa3b4955810518ae6fab158 Author: Roger Pau Monné AuthorDate: 2021-01-29 11:29:37 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-01 14:41:26 +0000 stand/amd64: remove unused addr parameter from bi_load64 All callers of bi_load64 pass 0 as the addr parameter, so just remove it and always calculate the last load address from the module chain. No functional change. Sponsored by: Citrix Systems R&D Reviewed by: tsoome, imp Differential revision: https://reviews.freebsd.org/D28412 --- stand/i386/libi386/bootinfo64.c | 14 +++++++------- stand/i386/libi386/elf64_freebsd.c | 2 +- stand/i386/libi386/libi386.h | 2 +- stand/i386/libi386/multiboot.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c index 9f038f2a4f2b..1ffa4188d926 100644 --- a/stand/i386/libi386/bootinfo64.c +++ b/stand/i386/libi386/bootinfo64.c @@ -182,7 +182,7 @@ bi_checkcpu(void) * - Module metadata are formatted and placed in kernel space. */ int -bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, +bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, int add_smap) { struct preloaded_file *xp, *kfp; @@ -191,6 +191,7 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, uint64_t kernend; uint64_t envp; uint64_t module; + uint64_t addr; vm_offset_t size; char *rootdevname; int howto; @@ -217,12 +218,11 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, /* Try reading the /etc/fstab file to select the root device */ getrootmount(i386_fmtdev((void *)rootdev)); - if (addr == 0) { - /* find the last module in the chain */ - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; - } + addr = 0; + /* find the last module in the chain */ + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + if (addr < (xp->f_addr + xp->f_size)) + addr = xp->f_addr + xp->f_size; } /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); diff --git a/stand/i386/libi386/elf64_freebsd.c b/stand/i386/libi386/elf64_freebsd.c index 6bf884045eea..1108a9e4d713 100644 --- a/stand/i386/libi386/elf64_freebsd.c +++ b/stand/i386/libi386/elf64_freebsd.c @@ -80,7 +80,7 @@ elf64_exec(struct preloaded_file *fp) return(EFTYPE); ehdr = (Elf_Ehdr *)&(md->md_data); - err = bi_load64(fp->f_args, 0, &modulep, &kernend, 1); + err = bi_load64(fp->f_args, &modulep, &kernend, 1); if (err != 0) return(err); diff --git a/stand/i386/libi386/libi386.h b/stand/i386/libi386/libi386.h index dbd6565f8d1c..a52a1190e7ec 100644 --- a/stand/i386/libi386/libi386.h +++ b/stand/i386/libi386/libi386.h @@ -151,7 +151,7 @@ void bi_setboothowto(int howto); vm_offset_t bi_copyenv(vm_offset_t addr); int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernend); -int bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, +int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend, int add_smap); void pxe_enable(void *pxeinfo); diff --git a/stand/i386/libi386/multiboot.c b/stand/i386/libi386/multiboot.c index 71fd63bb4c88..2d0a4a9b2274 100644 --- a/stand/i386/libi386/multiboot.c +++ b/stand/i386/libi386/multiboot.c @@ -274,7 +274,7 @@ multiboot_exec(struct preloaded_file *fp) bzero(mb_mod, sizeof(struct multiboot_mod_list) * NUM_MODULES); - error = bi_load64(fp->f_args, 0, &modulep, &kernend, 0); + error = bi_load64(fp->f_args, &modulep, &kernend, 0); if (error != 0) { printf("bi_load64 failed: %d\n", error); goto error;