summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/boot.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2000-04-20 00:06:15 +0000
committerps <ps@FreeBSD.org>2000-04-20 00:06:15 +0000
commit4422f2d83bb4ca051d794f962ed3fdebf99fcddb (patch)
treec0e175580c51dd8f88fefc4346bdb40d530d84f6 /sys/boot/common/boot.c
parentb86f59222971ce8e1ded778420f9d916dd650e5a (diff)
downloadFreeBSD-src-4422f2d83bb4ca051d794f962ed3fdebf99fcddb.zip
FreeBSD-src-4422f2d83bb4ca051d794f962ed3fdebf99fcddb.tar.gz
Add a cleanup function. This is needed for PXE where you should
shutdown the UNDI and unload the stack.
Diffstat (limited to 'sys/boot/common/boot.c')
-rw-r--r--sys/boot/common/boot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/boot/common/boot.c b/sys/boot/common/boot.c
index f69d430..4fded2c 100644
--- a/sys/boot/common/boot.c
+++ b/sys/boot/common/boot.c
@@ -53,6 +53,7 @@ command_boot(int argc, char *argv[])
struct loaded_module *km;
char *cp;
int try;
+ int i;
/*
* See if the user has specified an explicit kernel to boot.
@@ -109,6 +110,11 @@ 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 */
module_formats[km->m_loader]->l_exec(km);
return(CMD_ERROR);
OpenPOWER on IntegriCloud