4 FILE_LICENCE ( GPL2_OR_LATER );
6 #include <ipxe/tables.h>
9 * An initialisation function
11 * Initialisation functions are called exactly once, as part of the
12 * call to initialise().
15 void ( * initialise ) ( void );
18 /** Initialisation function table */
19 #define INIT_FNS __table ( struct init_fn, "init_fns" )
21 /** Declare an initialisation functon */
22 #define __init_fn( init_order ) __table_entry ( INIT_FNS, init_order )
24 /** @defgroup initfn_order Initialisation function ordering
28 #define INIT_EARLY 01 /**< Early initialisation */
29 #define INIT_SERIAL 02 /**< Serial driver initialisation */
30 #define INIT_CONSOLE 03 /**< Console initialisation */
31 #define INIT_NORMAL 04 /**< Normal initialisation */
32 #define INIT_LATE 05 /**< Late initialisation */
37 * A startup/shutdown function
39 * Startup and shutdown functions may be called multiple times, as
40 * part of the calls to startup() and shutdown().
43 void ( * startup ) ( void );
44 void ( * shutdown ) ( int booting );
47 /** Startup/shutdown function table */
48 #define STARTUP_FNS __table ( struct startup_fn, "startup_fns" )
50 /** Declare a startup/shutdown function */
51 #define __startup_fn( startup_order ) \
52 __table_entry ( STARTUP_FNS, startup_order )
54 /** @defgroup startfn_order Startup/shutdown function ordering
56 * Shutdown functions are called in the reverse order to startup
62 #define STARTUP_EARLY 01 /**< Early startup */
63 #define STARTUP_NORMAL 02 /**< Normal startup */
64 #define STARTUP_LATE 03 /**< Late startup */
68 extern void initialise ( void );
69 extern void startup ( void );
70 extern void shutdown ( int booting );
73 * Shut down system for OS boot
76 static inline void shutdown_boot ( void ) {
81 * Shut down system for exit back to firmware
84 static inline void shutdown_exit ( void ) {
88 #endif /* _IPXE_INIT_H */