git: 335615c4cad7 - main - stand: update prototypes for md_load and md_load64

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 06 Dec 2022 02:09:49 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=335615c4cad79765b46048bfa782120fd9cadb95

commit 335615c4cad79765b46048bfa782120fd9cadb95
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-12-05 17:40:15 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-12-05 23:59:58 +0000

    stand: update prototypes for md_load and md_load64
    
    These are declared as extern in a number of files (some with the wrong
    return type). Centralize this in modinfo.h and remove a few extra stray
    declarations as well that are no longer used. No functional change.
    
    Note: I've not tried to cope with the bi_load() functions which are the
    same logical thing. These will be handled separately.
    
    Sponsored by:           Netflix
---
 stand/common/modinfo.h                         | 3 +++
 stand/efi/loader/arch/arm/exec.c               | 1 -
 stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c | 3 +--
 stand/libofw/libofw.h                          | 4 ----
 stand/powerpc/ofw/elf_freebsd.c                | 1 +
 stand/powerpc/ofw/ppc64_elf_freebsd.c          | 1 +
 stand/uboot/arch/powerpc/ppc64_elf_freebsd.c   | 5 +----
 stand/uboot/elf_freebsd.c                      | 3 +--
 8 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/stand/common/modinfo.h b/stand/common/modinfo.h
index e4739df0b68f..967367beeeb0 100644
--- a/stand/common/modinfo.h
+++ b/stand/common/modinfo.h
@@ -6,6 +6,9 @@
 #ifndef COMMON_MODINFO_H
 #define COMMON_MODINFO_H
 
+int md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
+int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
+
 vm_offset_t md_copymodules(vm_offset_t addr, bool kern64);
 vm_offset_t md_copyenv(vm_offset_t addr);
 
diff --git a/stand/efi/loader/arch/arm/exec.c b/stand/efi/loader/arch/arm/exec.c
index a110f3d07cbc..2fecb2ea043a 100644
--- a/stand/efi/loader/arch/arm/exec.c
+++ b/stand/efi/loader/arch/arm/exec.c
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
 #include "bootstrap.h"
 #include "loader_efi.h"
 
-extern vm_offset_t md_load(char *, vm_offset_t *);
 extern int bi_load(char *, vm_offset_t *, vm_offset_t *, bool);
 
 static int
diff --git a/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c b/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
index 5851d71fdc13..3341771be09a 100644
--- a/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
+++ b/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include "bootstrap.h"
 #include "syscall_nr.h"
 #include "host_syscall.h"
+#include "modinfo.h"
 
 extern char		end[];
 extern void		*kerneltramp;
@@ -55,8 +56,6 @@ struct trampoline_data {
 	uint32_t	mdp_size;
 };
 
-vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
-
 int
 ppc64_elf_loadfile(char *filename, uint64_t dest,
     struct preloaded_file **result)
diff --git a/stand/libofw/libofw.h b/stand/libofw/libofw.h
index dc520d741290..2d6ea9a5bf24 100644
--- a/stand/libofw/libofw.h
+++ b/stand/libofw/libofw.h
@@ -69,10 +69,6 @@ int ofw_common_parsedev(struct devdesc **dev, const char *devspec, const char **
 struct preloaded_file;
 struct file_format;
 
-/* MD code implementing MI interfaces */
-vm_offset_t md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
-vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
-
 extern void	reboot(void);
 
 struct ofw_reg
diff --git a/stand/powerpc/ofw/elf_freebsd.c b/stand/powerpc/ofw/elf_freebsd.c
index 89811e965d6e..ee173d55e25c 100644
--- a/stand/powerpc/ofw/elf_freebsd.c
+++ b/stand/powerpc/ofw/elf_freebsd.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include "bootstrap.h"
 #include "libofw.h"
 #include "openfirm.h"
+#include "modinfo.h"
 
 extern char		end[];
 extern vm_offset_t	reloc;	/* From <arch>/conf.c */
diff --git a/stand/powerpc/ofw/ppc64_elf_freebsd.c b/stand/powerpc/ofw/ppc64_elf_freebsd.c
index 38c664228c12..ece3dbc6d822 100644
--- a/stand/powerpc/ofw/ppc64_elf_freebsd.c
+++ b/stand/powerpc/ofw/ppc64_elf_freebsd.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include "bootstrap.h"
 #include "libofw.h"
 #include "openfirm.h"
+#include "modinfo.h"
 
 extern char		end[];
 extern vm_offset_t	reloc;	/* From <arch>/conf.c */
diff --git a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c
index 57b2e791fbba..feabcde3bf4a 100644
--- a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c
+++ b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c
@@ -40,10 +40,7 @@ __FBSDID("$FreeBSD$");
 
 #include "bootstrap.h"
 #include "libuboot.h"
-
-vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
-extern char		end[];
-extern vm_offset_t	reloc;	/* From <arch>/conf.c */
+#include "modinfo.h"
 
 int
 ppc64_uboot_elf_loadfile(char *filename, uint64_t dest,
diff --git a/stand/uboot/elf_freebsd.c b/stand/uboot/elf_freebsd.c
index 802d6e96dee6..0541edd92c64 100644
--- a/stand/uboot/elf_freebsd.c
+++ b/stand/uboot/elf_freebsd.c
@@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$");
 
 #include "bootstrap.h"
 #include "libuboot.h"
-
-extern vm_offset_t md_load(char *, vm_offset_t *, vm_offset_t *);
+#include "modinfo.h"
 
 int
 __elfN(uboot_load)(char *filename, uint64_t dest,