diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/main.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/main.c b/src/core/main.c index c95f0ae28..ef8b67bb0 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; } |
