summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2000-06-14 10:34:29 +0000
committerps <ps@FreeBSD.org>2000-06-14 10:34:29 +0000
commit013be4c7436a478bcd8131713f2c92e2d408f9dd (patch)
treec34105d95bedc3e09436d43a7fd6630809657345
parent021d03f5bf631a868a0518181a8ca19a75e04d16 (diff)
downloadFreeBSD-src-013be4c7436a478bcd8131713f2c92e2d408f9dd.zip
FreeBSD-src-013be4c7436a478bcd8131713f2c92e2d408f9dd.tar.gz
Delay calling the device cleanup routines until the absolute last
moment. We were cleaning up after PXE too early and the module dependancy code would not be able to load any files if it needed too.
-rw-r--r--sys/boot/alpha/libalpha/elf_freebsd.c1
-rw-r--r--sys/boot/common/boot.c5
-rw-r--r--sys/boot/common/bootstrap.h2
-rw-r--r--sys/boot/common/misc.c11
-rw-r--r--sys/boot/i386/libi386/aout_freebsd.c1
-rw-r--r--sys/boot/i386/libi386/elf32_freebsd.c1
-rw-r--r--sys/boot/i386/libi386/elf64_freebsd.c1
-rw-r--r--sys/boot/i386/libi386/elf_freebsd.c1
8 files changed, 18 insertions, 5 deletions
diff --git a/sys/boot/alpha/libalpha/elf_freebsd.c b/sys/boot/alpha/libalpha/elf_freebsd.c
index 71849b5..e76741f 100644
--- a/sys/boot/alpha/libalpha/elf_freebsd.c
+++ b/sys/boot/alpha/libalpha/elf_freebsd.c
@@ -152,6 +152,7 @@ elf_exec(struct preloaded_file *fp)
printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
closeall();
+ dev_cleanup();
alpha_pal_imb();
(*(void (*)())hdr->e_entry)(ffp_save, ptbr_save,
BOOTINFO_MAGIC, &bootinfo_v1, 1, 0);
diff --git a/sys/boot/common/boot.c b/sys/boot/common/boot.c
index dfd400c..7c02e56 100644
--- a/sys/boot/common/boot.c
+++ b/sys/boot/common/boot.c
@@ -110,11 +110,6 @@ command_boot(int argc, char *argv[])
if (archsw.arch_autoload() != 0)
return(CMD_ERROR);
- /* Call cleanup routines */
- for (i = 0; devsw[i] != NULL; ++i)
- if (devsw[i]->dv_cleanup != NULL)
- (devsw[i]->dv_cleanup)();
-
/* Call the exec handler from the loader matching the kernel */
file_formats[fp->f_loader]->l_exec(fp);
return(CMD_ERROR);
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index 4c38154..67ca502 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -314,3 +314,5 @@ extern struct arch_switch archsw;
/* This must be provided by the MD code, but should it be in the archsw? */
extern void delay(int delay);
+
+extern void dev_cleanup(void);
diff --git a/sys/boot/common/misc.c b/sys/boot/common/misc.c
index 819d4a4..bc33c53 100644
--- a/sys/boot/common/misc.c
+++ b/sys/boot/common/misc.c
@@ -131,3 +131,14 @@ hexdump(caddr_t region, size_t len)
}
pager_close();
}
+
+void
+dev_cleanup(void)
+{
+ int i;
+
+ /* Call cleanup routines */
+ for (i = 0; devsw[i] != NULL; ++i)
+ if (devsw[i]->dv_cleanup != NULL)
+ (devsw[i]->dv_cleanup)();
+}
diff --git a/sys/boot/i386/libi386/aout_freebsd.c b/sys/boot/i386/libi386/aout_freebsd.c
index 5f720c2..857dc3a4 100644
--- a/sys/boot/i386/libi386/aout_freebsd.c
+++ b/sys/boot/i386/libi386/aout_freebsd.c
@@ -77,6 +77,7 @@ aout_exec(struct preloaded_file *fp)
bi->bi_symtab = ssym; /* XXX this is only the primary kernel symtab */
bi->bi_esymtab = esym;
+ dev_cleanup();
__exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop);
panic("exec returned");
diff --git a/sys/boot/i386/libi386/elf32_freebsd.c b/sys/boot/i386/libi386/elf32_freebsd.c
index f528d96..a3ad9fb 100644
--- a/sys/boot/i386/libi386/elf32_freebsd.c
+++ b/sys/boot/i386/libi386/elf32_freebsd.c
@@ -84,6 +84,7 @@ elf_exec(struct preloaded_file *fp)
printf("Start @ 0x%lx ...\n", entry);
#endif
+ dev_cleanup();
__exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop);
panic("exec returned");
diff --git a/sys/boot/i386/libi386/elf64_freebsd.c b/sys/boot/i386/libi386/elf64_freebsd.c
index f528d96..a3ad9fb 100644
--- a/sys/boot/i386/libi386/elf64_freebsd.c
+++ b/sys/boot/i386/libi386/elf64_freebsd.c
@@ -84,6 +84,7 @@ elf_exec(struct preloaded_file *fp)
printf("Start @ 0x%lx ...\n", entry);
#endif
+ dev_cleanup();
__exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop);
panic("exec returned");
diff --git a/sys/boot/i386/libi386/elf_freebsd.c b/sys/boot/i386/libi386/elf_freebsd.c
index f528d96..a3ad9fb 100644
--- a/sys/boot/i386/libi386/elf_freebsd.c
+++ b/sys/boot/i386/libi386/elf_freebsd.c
@@ -84,6 +84,7 @@ elf_exec(struct preloaded_file *fp)
printf("Start @ 0x%lx ...\n", entry);
#endif
+ dev_cleanup();
__exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop);
panic("exec returned");
OpenPOWER on IntegriCloud