diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/console.h | 14 | ||||
| -rw-r--r-- | src/include/gpxe/heap.h | 15 | ||||
| -rw-r--r-- | src/include/gpxe/hidemem.h | 2 | ||||
| -rw-r--r-- | src/include/gpxe/init.h | 83 | ||||
| -rw-r--r-- | src/include/gpxe/process.h | 1 | ||||
| -rw-r--r-- | src/include/gpxe/shutdown.h | 10 |
6 files changed, 54 insertions, 71 deletions
diff --git a/src/include/console.h b/src/include/console.h index fd1382b4a..9addd5265 100644 --- a/src/include/console.h +++ b/src/include/console.h @@ -21,19 +21,19 @@ * Must be made part of the console drivers table by using * #__console_driver. * - * @note Consoles that cannot be used before their INIT_FN() has - * completed should set #disabled=1 initially. This allows other - * console devices to still be used to print out early debugging - * messages. + * @note Consoles that cannot be used before their initialisation + * function has completed should set #disabled=1 initially. This + * allows other console devices to still be used to print out early + * debugging messages. * */ struct console_driver { /** Console is disabled. * * The console's putchar(), putline(), getchar() and iskey() - * methods will not be called while #disabled==1. Typically the - * console's initialisation functions (called via INIT_FN()) - * will set #disabled=0 upon completion. + * methods will not be called while #disabled==1. Typically + * the console's initialisation functions will set #disabled=0 + * upon completion. * */ int disabled; diff --git a/src/include/gpxe/heap.h b/src/include/gpxe/heap.h deleted file mode 100644 index f27937519..000000000 --- a/src/include/gpxe/heap.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _GPXE_HEAP_H -#define _GPXE_HEAP_H - -/** - * @file - * - * Heap - * - */ - -extern char heap[]; - -extern void init_heap ( void ); - -#endif /* _GPXE_HEAP_H */ diff --git a/src/include/gpxe/hidemem.h b/src/include/gpxe/hidemem.h index db867f1cb..547f88815 100644 --- a/src/include/gpxe/hidemem.h +++ b/src/include/gpxe/hidemem.h @@ -17,8 +17,6 @@ enum hidemem_region_id { EXTMEM, }; -extern void hide_etherboot(); -extern void unhide_etherboot(); extern void hide_region ( unsigned int region_id, physaddr_t start, physaddr_t end ); diff --git a/src/include/gpxe/init.h b/src/include/gpxe/init.h index b5e2f864f..a5caa3e0e 100644 --- a/src/include/gpxe/init.h +++ b/src/include/gpxe/init.h @@ -3,35 +3,56 @@ #include <gpxe/tables.h> -/* - * In order to avoid having objects dragged in just because main() - * calls their initialisation function, we allow each object to - * specify that it has a function that must be called to initialise - * that object. The function call_init_fns() will call all the - * included objects' initialisation functions. +/** + * An initialisation function * - * Objects that require initialisation should include init.h and - * register the initialisation function using INIT_FN(). + * Initialisation functions are called exactly once, as part of the + * call to initialise(). + */ +struct init_fn { + void ( * initialise ) ( void ); +}; + +/** Declare an initialisation functon */ +#define __init_fn( init_order ) \ + __table ( struct init_fn, init_fns, init_order ) + +/** @defgroup initfn_order Initialisation function ordering + * @{ + */ + +#define INIT_EARLY 01 /**< Early initialisation */ +#define INIT_NORMAL 02 /**< Normal initialisation */ + +/** @} */ + +/** + * A startup/shutdown function * - * Objects may register up to three functions: init, reset and exit. - * init gets called only once, at the point that Etherboot is - * initialised (before the call to main()). reset gets called between - * each boot attempt. exit gets called only once, just before the - * loaded OS starts up (or just before Etherboot exits, if it exits, - * or when the PXE NBP calls UNDI_SHUTDOWN, if it's a PXE NBP). + * Startup and shutdown functions may be called multiple times, as + * part of the calls to startup() and shutdown(). + */ +struct startup_fn { + void ( * startup ) ( void ); + void ( * shutdown ) ( void ); +}; + +/** Declare a startup/shutdown function */ +#define __startup_fn( startup_order ) \ + __table ( struct startup_fn, startup_fns, startup_order ) + +/** @defgroup startfn_order Startup/shutdown function ordering + * + * Shutdown functions are called in the reverse order to startup + * functions. * - * The syntax is: - * INIT_FN ( init_order, init_function, reset_function, exit_function ); - * where init_order is an ordering taken from the list below. Any - * function may be left as NULL. + * @{ */ -/* An entry in the initialisation function table */ +#define STARTUP_EARLY 01 /**< Early startup */ +#define STARTUP_NORMAL 02 /**< Normal startup */ -struct init_fn { - void ( *init ) ( void ); - void ( *exit ) ( void ); -}; +/** @} */ /* Use double digits to avoid problems with "10" < "9" on alphabetic sort */ #define INIT_CONSOLE 02 @@ -40,19 +61,9 @@ struct init_fn { #define INIT_TIMERS 05 #define INIT_LOADBUF 08 #define INIT_PCMCIA 09 -#define INIT_RPC 11 - -/* Macro for creating an initialisation function table entry */ -#define INIT_FN( init_order, init_func, exit_func ) \ - struct init_fn PREFIX_OBJECT(init_fn__) \ - __table ( struct init_fn, init_fn, init_order ) = { \ - .init = init_func, \ - .exit = exit_func, \ - }; - -/* Function prototypes */ -void call_init_fns ( void ); -void call_exit_fns ( void ); +extern void initialise ( void ); +extern void startup ( void ); +extern void shutdown ( void ); #endif /* _GPXE_INIT_H */ diff --git a/src/include/gpxe/process.h b/src/include/gpxe/process.h index 595787c0f..8d9b109a5 100644 --- a/src/include/gpxe/process.h +++ b/src/include/gpxe/process.h @@ -34,7 +34,6 @@ struct process { extern void process_add ( struct process *process ); extern void process_del ( struct process *process ); extern void step ( void ); -extern void init_processes ( void ); /** * Initialise process without adding to process list diff --git a/src/include/gpxe/shutdown.h b/src/include/gpxe/shutdown.h deleted file mode 100644 index 451029313..000000000 --- a/src/include/gpxe/shutdown.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _GPXE_SHUTDOWN_H -#define _GPXE_SHUTDOWN_H - -/** - * Shut down before exit - */ - -extern void shutdown ( void ); - -#endif /* _GPXE_SHUTDOWN_H */ |
