From 5f88ee4479a5bf81f59509cd9ca1ba8721f3d68e Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 14 Jun 2018 06:41:33 +0000 Subject: [PATCH] bootprog_info is generated in vers.c. Move it's definition to bootstrap.h and remove all the redundant copies. Sponsored by: Netflix --- stand/common/bootstrap.h | 5 +++++ stand/efi/loader/main.c | 2 -- stand/i386/loader/main.c | 3 --- stand/mips/beri/loader/loader.h | 3 --- stand/powerpc/kboot/main.c | 2 -- stand/powerpc/ofw/main.c | 1 - stand/sparc64/loader/main.c | 2 -- stand/uboot/common/main.c | 1 - stand/userboot/userboot/main.c | 1 - 9 files changed, 5 insertions(+), 15 deletions(-) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index 278b3ed6aeb..5a7a84f6398 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -160,6 +160,11 @@ char *pnp_eisaformat(uint8_t *data); */ extern int isapnp_readport; +/* + * Version information + */ +extern char bootprog_info[]; + /* * Preloaded file metadata header. * diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index eb4ec1c364b..d0c830a5cb4 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -53,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" -extern char bootprog_info[]; - struct arch_switch archsw; /* MI/MD interface boundary */ EFI_GUID acpi = ACPI_TABLE_GUID; diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c index 2fc17288b3b..9b6bd6486a4 100644 --- a/stand/i386/loader/main.c +++ b/stand/i386/loader/main.c @@ -79,9 +79,6 @@ struct zfs_boot_args *zargs; static void i386_zfs_probe(void); #endif -/* from vers.c */ -extern char bootprog_info[]; - /* XXX debugging */ extern char end[]; diff --git a/stand/mips/beri/loader/loader.h b/stand/mips/beri/loader/loader.h index d73a7f8e284..3c80a6e4f5c 100644 --- a/stand/mips/beri/loader/loader.h +++ b/stand/mips/beri/loader/loader.h @@ -58,7 +58,4 @@ extern struct bootinfo boot2_bootinfo; /* metadata.c */ int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtbp); -/* vers.c */ -extern char bootprog_info[]; - #endif /* !_BOOT_LOADER_H_ */ diff --git a/stand/powerpc/kboot/main.c b/stand/powerpc/kboot/main.c index 587968f88da..633727ca6a7 100644 --- a/stand/powerpc/kboot/main.c +++ b/stand/powerpc/kboot/main.c @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; extern void *_end; -extern char bootprog_info[]; - int kboot_getdev(void **vdev, const char *devspec, const char **path); ssize_t kboot_copyin(const void *src, vm_offset_t dest, const size_t len); ssize_t kboot_copyout(vm_offset_t src, void *dest, const size_t len); diff --git a/stand/powerpc/ofw/main.c b/stand/powerpc/ofw/main.c index 785c61b914c..93a439f8f60 100644 --- a/stand/powerpc/ofw/main.c +++ b/stand/powerpc/ofw/main.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; /* MI/MD interface boundary */ extern char end[]; -extern char bootprog_info[]; uint32_t acells, scells; diff --git a/stand/sparc64/loader/main.c b/stand/sparc64/loader/main.c index 59a5d0c1297..4801a38c167 100644 --- a/stand/sparc64/loader/main.c +++ b/stand/sparc64/loader/main.c @@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" -extern char bootprog_info[]; - enum { HEAPVA = 0x800000, HEAPSZ = 0x1000000, diff --git a/stand/uboot/common/main.c b/stand/uboot/common/main.c index 8ad33f40c95..4cba1bd0e18 100644 --- a/stand/uboot/common/main.c +++ b/stand/uboot/common/main.c @@ -66,7 +66,6 @@ struct device_type { }; extern char end[]; -extern char bootprog_info[]; extern unsigned char _etext[]; extern unsigned char _edata[]; diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c index 64f5c07f735..294951f88aa 100644 --- a/stand/userboot/userboot/main.c +++ b/stand/userboot/userboot/main.c @@ -52,7 +52,6 @@ static int userboot_zfs_found; struct loader_callbacks *callbacks; void *callbacks_arg; -extern char bootprog_info[]; static jmp_buf jb; struct arch_switch archsw; /* MI/MD interface boundary */