From nobody Fri Sep 16 15:53:56 2022 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 4MTdsc3Frdz4cKyc; Fri, 16 Sep 2022 15:53:56 +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 4MTdsc2vnbz3hcf; Fri, 16 Sep 2022 15:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663343636; 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=elB5JphMZmHY5xfBekaTzdey6ZGOWVreJaa42b/zILw=; b=iwkJWZH8QeRAT/fK5SGz4Nl0E5btYH7k/MvKpm79lfc03QvERLY0tcpsaEW78hfEs8r5Mu TuvzSD1HAZdu4e664q77xhU8mGsoghi/dPzDX79dCO3k/Mr+1iLlUykkPKlxgZ9lj9+2GX OM9ZxqQCIhq9vrLCfXoBlMgw+mezi4As92QVj+ufOLz+QVyJjH2sH5kafEx1h5j79soEQ6 5EJJ6t4c5qT039X6hPhpzKInhRtHooy2ZqiIypMuWSpLbImI9o/EIrUIrX4/04MzaBaB47 2/iRdRQ6noaWUgbPPrFIfOcwuolhlTs3/evocUsr17bZJ2PKkuYoYzxYSk+wyw== 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 4MTdsc1sBFzPtG; Fri, 16 Sep 2022 15:53:56 +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 28GFruci086430; Fri, 16 Sep 2022 15:53:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28GFrugw086429; Fri, 16 Sep 2022 15:53:56 GMT (envelope-from git) Date: Fri, 16 Sep 2022 15:53:56 GMT Message-Id: <202209161553.28GFrugw086429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5d1531d9d4e7 - main - stand: Move md_copymodules into modinfo.c and reduce copies 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d1531d9d4e7d1b1b706ab23ac3f864416e87522 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663343636; 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=elB5JphMZmHY5xfBekaTzdey6ZGOWVreJaa42b/zILw=; b=fTpc8Et6FrqxNF8pkG6zaa4H2YZqcAgZ2M5BPEWWe3TnUFlq0wGegoyAgFZgutZvICvqjo lsJJ17pLCNsP4tS/GrQbrrosJaxRoaHOubjjMOlhwH3XSYvYO7J6OssvRz8iqC10wtmz/F wbAl7PEOdbSOD+5wevGud3yoD5jde4aZSUVjFsdljVgj7LE4fBakseDn6jSTCDJCYoKXgu Ik3pZLSyBQkKpN76Mv2abRfK3SffvWPLFjRSZS/LNvcYC1X3ptZtchjV5N8XBmSOPuTP4v eBcDJ4hiSTYYRwe6bnp1F/xt+MkXw/L5/6i2wlIjcYmkKJwZ6xU6FMCaHCW0JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663343636; a=rsa-sha256; cv=none; b=GUVX7sqTl73RqcCxQu0Cx6CO4aATI0YXz+C7u1+JSlx8cawkmW08Q35SKtOZOuRiH1AGTa JnnpqLNCn9X4D1zGYl7fsqh9CXmUQ7SaMXFtgxJ6CnbrYMDdupZsnUQh2pJDbPsKlIKF5L vN8MZspmr0a8ffzEbmYnx9w0i9b1XRoJt66rfWkqmNCY0xPbpz3VzvG8G1ycOvJFOv4eYK j1GZb2u0s9EXPy6nnK/6eVkv5xy58keha1xMVk6G4+LTKT8cb3+pnC5BEFpIwtcZomdpMS BlWO+mzzXVAFyj98GB4U/M8Cn//u4S/tdm7lA/jOs+VEp7W/wgIJ7s764OjlXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5d1531d9d4e7d1b1b706ab23ac3f864416e87522 commit 5d1531d9d4e7d1b1b706ab23ac3f864416e87522 Author: Warner Losh AuthorDate: 2022-09-16 15:08:47 +0000 Commit: Warner Losh CommitDate: 2022-09-16 15:18:56 +0000 stand: Move md_copymodules into modinfo.c and reduce copies md_copymodules, bi_copymdoules, bi_copymodules32 (x2) and bi_copymodules64 (x2) are all the same routine... Replace them all with md_copymodules. This saves about 800 bytes on i386 BIOS loader, which is a nice bonus. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D36572 --- stand/common/metadata.c | 43 ------------------ stand/common/modinfo.c | 86 ++++++++++++++++++++++++++++++++++++ stand/common/modinfo.h | 2 + stand/efi/loader/bootinfo.c | 39 +--------------- stand/i386/libi386/bootinfo32.c | 35 +-------------- stand/i386/libi386/bootinfo64.c | 38 +--------------- stand/loader.mk | 1 + stand/userboot/userboot/bootinfo32.c | 34 +------------- stand/userboot/userboot/bootinfo64.c | 38 +--------------- 9 files changed, 99 insertions(+), 217 deletions(-) diff --git a/stand/common/metadata.c b/stand/common/metadata.c index 99b67cfd1060..37171ec3be99 100644 --- a/stand/common/metadata.c +++ b/stand/common/metadata.c @@ -93,49 +93,6 @@ md_copyenv(vm_offset_t addr) return(addr); } -static int align; -#define MOD_ALIGN(l) roundup(l, align) - -static vm_offset_t -md_copymodules(vm_offset_t addr, int kern64) -{ - struct preloaded_file *fp; - struct file_metadata *md; - uint64_t scratch64; - uint32_t scratch32; - int c; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - if (kern64) { - scratch64 = fp->f_addr; - MOD_ADDR(addr, scratch64, c); - scratch64 = fp->f_size; - MOD_SIZE(addr, scratch64, c); - } else { - scratch32 = fp->f_addr; -#ifdef __arm__ - scratch32 -= __elfN(relocation_offset); -#endif - MOD_ADDR(addr, scratch32, c); - MOD_SIZE(addr, fp->f_size, c); - } - for (md = fp->f_metadata; md != NULL; md = md->md_next) { - if (!(md->md_type & MODINFOMD_NOCOPY)) { - MOD_METADATA(addr, md, c); - } - } - } - MOD_END(addr, c); - return(addr); -} - /* * Load the information expected by a kernel. * diff --git a/stand/common/modinfo.c b/stand/common/modinfo.c new file mode 100644 index 000000000000..a274890ace64 --- /dev/null +++ b/stand/common/modinfo.c @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 1998 Michael Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: FreeBSD: src/sys/boot/sparc64/loader/metadata.c,v 1.6 + */ +#include +#include +#include +#include +#include +#if defined(LOADER_FDT_SUPPORT) +#include +#endif + +#ifdef __arm__ +#include +#endif +#include + +#include "bootstrap.h" +#include "modinfo.h" + +static int align; +#define MOD_ALIGN(l) roundup(l, align) + +vm_offset_t +md_copymodules(vm_offset_t addr, bool kern64) +{ + struct preloaded_file *fp; + struct file_metadata *md; + uint64_t scratch64; + uint32_t scratch32; + int c; + + c = addr != 0; + /* start with the first module on the list, should be the kernel */ + for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { + + MOD_NAME(addr, fp->f_name, c); /* this field must come first */ + MOD_TYPE(addr, fp->f_type, c); + if (fp->f_args) + MOD_ARGS(addr, fp->f_args, c); + if (kern64) { + scratch64 = fp->f_addr; + MOD_ADDR(addr, scratch64, c); + scratch64 = fp->f_size; + MOD_SIZE(addr, scratch64, c); + } else { + scratch32 = fp->f_addr; +#ifdef __arm__ + scratch32 -= __elfN(relocation_offset); +#endif + MOD_ADDR(addr, scratch32, c); + MOD_SIZE(addr, fp->f_size, c); + } + for (md = fp->f_metadata; md != NULL; md = md->md_next) { + if (!(md->md_type & MODINFOMD_NOCOPY)) { + MOD_METADATA(addr, md, c); + } + } + } + MOD_END(addr, c); + return(addr); +} diff --git a/stand/common/modinfo.h b/stand/common/modinfo.h index 245784ccb2ed..3d7f26a3c963 100644 --- a/stand/common/modinfo.h +++ b/stand/common/modinfo.h @@ -69,4 +69,6 @@ COPY32(0, a, c); \ } +vm_offset_t md_copymodules(vm_offset_t addr, bool kern64); + #endif /* COMMON_MODINFO_H */ diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 08ed518d9cff..9f56365536d1 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -61,11 +61,6 @@ __FBSDID("$FreeBSD$"); #include "geliboot.h" #endif -/* - * Align to a pointer / long - */ -#define MOD_ALIGN(l) roundup(l, sizeof(u_long)) - int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs); @@ -170,36 +165,6 @@ bi_copyenv(vm_offset_t start) return(last); } -static vm_offset_t -bi_copymodules(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - uint64_t v; - - c = addr != 0; - /* Start with the first module on the list, should be the kernel. */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - MOD_NAME(addr, fp->f_name, c); /* This must come first. */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - v = fp->f_addr; -#if defined(__arm__) - v -= __elfN(relocation_offset); -#endif - MOD_ADDR(addr, v, c); - v = fp->f_size; - MOD_SIZE(addr, v, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - MOD_END(addr, c); - return(addr); -} - static EFI_STATUS efi_do_vmap(EFI_MEMORY_DESCRIPTOR *mm, UINTN sz, UINTN mmsz, UINT32 mmver) { @@ -487,7 +452,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) #endif bi_load_efi_data(kfp, exit_bs); - size = bi_copymodules(0); + size = md_copymodules(0, true); kernend = roundup(addr + size, PAGE_SIZE); *kernendp = kernend; @@ -512,7 +477,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) #endif /* Copy module list and metadata. */ - (void)bi_copymodules(addr); + (void)md_copymodules(addr, true); return (0); } diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c index f00c692a3993..965b62bbad81 100644 --- a/stand/i386/libi386/bootinfo32.c +++ b/stand/i386/libi386/bootinfo32.c @@ -44,37 +44,6 @@ __FBSDID("$FreeBSD$"); static struct bootinfo bi; -/* - * We have 4 byte alignment for 32-bit targets. This code is compiled as 32-bit - * code... - */ -#define MOD_ALIGN(l) roundup(l, sizeof(u_long)) - -static vm_offset_t -bi_copymodules32(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - MOD_ADDR(addr, fp->f_addr, c); - MOD_SIZE(addr, fp->f_size, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - MOD_END(addr, c); - return(addr); -} - /* * Load the information expected by an i386 kernel. * @@ -179,7 +148,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t /* Figure out the size and location of the metadata */ *modulep = addr; - size = bi_copymodules32(0); + size = md_copymodules(0, false); kernend = roundup(addr + size, PAGE_SIZE); *kernendp = kernend; @@ -188,7 +157,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t bcopy(&kernend, md->md_data, sizeof kernend); /* copy module list and metadata */ - (void)bi_copymodules32(addr); + (void)md_copymodules(addr, false); ssym = esym = 0; md = file_findmetadata(kfp, MODINFOMD_SSYM); diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c index 18ed4af3e27f..8b5eb8c1db93 100644 --- a/stand/i386/libi386/bootinfo64.c +++ b/stand/i386/libi386/bootinfo64.c @@ -45,40 +45,6 @@ __FBSDID("$FreeBSD$"); #include "geliboot.h" #endif -/* - * We have 8 byte alignment for 64-bit targets. This code is compiled as 64-bit - * code... - */ -#define MOD_ALIGN(l) roundup(l, sizeof(uint64_t)) - -static vm_offset_t -bi_copymodules64(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - uint64_t v; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - v = fp->f_addr; - MOD_ADDR(addr, v, c); - v = fp->f_size; - MOD_SIZE(addr, v, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - MOD_END(addr, c); - return(addr); -} - /* * Check to see if this CPU supports long mode. */ @@ -197,7 +163,7 @@ bi_load64(char *args, vm_offset_t *modulep, #endif bi_load_vbe_data(kfp); - size = bi_copymodules64(0); + size = md_copymodules(0, true); /* copy our environment */ envp = roundup(addr + size, PAGE_SIZE); @@ -216,7 +182,7 @@ bi_load64(char *args, vm_offset_t *modulep, bcopy(&envp, md->md_data, sizeof envp); /* copy module list and metadata */ - (void)bi_copymodules64(*modulep); + (void)md_copymodules(*modulep, true); return(0); } diff --git a/stand/loader.mk b/stand/loader.mk index aa88122cb7a1..9fa4c74e2501 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -6,6 +6,7 @@ CFLAGS+=-I${LDRSRC} SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c +SRCS+= modinfo.c SRCS+= module.c nvstore.c pnglite.c tslog.c CFLAGS.module.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c index a717f4ad1f5a..8203f90c98fe 100644 --- a/stand/userboot/userboot/bootinfo32.c +++ b/stand/userboot/userboot/bootinfo32.c @@ -43,36 +43,6 @@ __FBSDID("$FreeBSD$"); static struct bootinfo bi; -/* - * We have 4 byte alignment for 32-bit targets. - */ -#define MOD_ALIGN(l) roundup(l, sizeof(uint32_t)) - -static vm_offset_t -bi_copymodules32(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - MOD_ADDR(addr, fp->f_addr, c); - MOD_SIZE(addr, fp->f_size, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - MOD_END(addr, c); - return(addr); -} - /* * Load the information expected by an i386 kernel. * @@ -157,7 +127,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t /* Figure out the size and location of the metadata */ *modulep = addr; - size = bi_copymodules32(0); + size = md_copymodules(0, false); kernend = roundup(addr + size, PAGE_SIZE); *kernendp = kernend; @@ -166,7 +136,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t bcopy(&kernend, md->md_data, sizeof kernend); /* copy module list and metadata */ - (void)bi_copymodules32(addr); + (void)md_copymodules(addr, false); ssym = esym = 0; md = file_findmetadata(kfp, MODINFOMD_SSYM); diff --git a/stand/userboot/userboot/bootinfo64.c b/stand/userboot/userboot/bootinfo64.c index 773f59474bf4..6d711cf51759 100644 --- a/stand/userboot/userboot/bootinfo64.c +++ b/stand/userboot/userboot/bootinfo64.c @@ -40,40 +40,6 @@ __FBSDID("$FreeBSD$"); #include "modinfo.h" #include "libuserboot.h" -/* - * We have 8 byte alignment for 64-bit targets. This code is compiled as 32-bit - * code... - */ -#define MOD_ALIGN(l) roundup(l, sizeof(uint64_t)) - -static vm_offset_t -bi_copymodules64(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - uint64_t v; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - v = fp->f_addr; - MOD_ADDR(addr, v, c); - v = fp->f_size; - MOD_SIZE(addr, v, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - MOD_END(addr, c); - return(addr); -} - /* * Check to see if this CPU supports long mode. */ @@ -190,7 +156,7 @@ bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) /* Figure out the size and location of the metadata */ *modulep = addr; - size = bi_copymodules64(0); + size = md_copymodules(0, true); kernend = roundup(addr + size, PAGE_SIZE); *kernendp = kernend; @@ -199,7 +165,7 @@ bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) bcopy(&kernend, md->md_data, sizeof kernend); /* copy module list and metadata */ - (void)bi_copymodules64(addr); + (void)md_copymodules(addr, true); return(0); }