summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Brown2005-04-10 20:30:34 +0200
committerMichael Brown2005-04-10 20:30:34 +0200
commit87508aa0b2e0fea5d4dea8d732150bd2fdbbb9f8 (patch)
tree88771e2c14fad3a6a7c63e74088c0ba266263ca5 /src/core/main.c
parentUse librm_arch_initialise for librm, arch_initialise for others. (diff)
downloadipxe-87508aa0b2e0fea5d4dea8d732150bd2fdbbb9f8.tar.gz
ipxe-87508aa0b2e0fea5d4dea8d732150bd2fdbbb9f8.tar.xz
ipxe-87508aa0b2e0fea5d4dea8d732150bd2fdbbb9f8.zip
arch_initialise() is now sufficiently generic that we may as well just
call it initialise() and place it in main.c. :)
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/main.c b/src/core/main.c
index c95f0ae2..ef8b67bb 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -139,6 +139,23 @@ static int initialized;
/**************************************************************************
+ * initialise() - perform any C-level initialisation
+ *
+ * This does not include initialising the NIC, but it does include
+ * e.g. getting the memory map, relocating to high memory,
+ * initialising the console, etc.
+ **************************************************************************
+ */
+void initialise ( void ) {
+ /* Zero the BSS */
+ memset ( _bss, 0, _ebss - _bss );
+
+ /* Call all registered initialisation functions.
+ */
+ call_init_fns ();
+}
+
+/**************************************************************************
MAIN - Kick off routine
**************************************************************************/
int main ( void ) {
@@ -164,6 +181,10 @@ int main ( void ) {
state = main_loop(state);
}
/* arch_on_exit(exit_status) */
+
+ /* Call registered per-object exit functions */
+ call_exit_fns ();
+
return exit_status;
}