4 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
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_CONSOLE 02 /**< Console initialisation */
30 #define INIT_NORMAL 03 /**< Normal initialisation */
31 #define INIT_LATE 04 /**< Late initialisation */
36 * A startup/shutdown function
38 * Startup and shutdown functions may be called multiple times, as
39 * part of the calls to startup() and shutdown().
42 void ( * startup ) ( void );
43 void ( * shutdown ) ( int booting );
46 /** Startup/shutdown function table */
47 #define STARTUP_FNS __table ( struct startup_fn, "startup_fns" )
49 /** Declare a startup/shutdown function */
50 #define __startup_fn( startup_order ) \
51 __table_entry ( STARTUP_FNS, startup_order )
53 /** @defgroup startfn_order Startup/shutdown function ordering
55 * Shutdown functions are called in the reverse order to startup
61 #define STARTUP_EARLY 01 /**< Early startup */
62 #define STARTUP_NORMAL 02 /**< Normal startup */
63 #define STARTUP_LATE 03 /**< Late startup */
67 extern void initialise ( void );
68 extern void startup ( void );
69 extern void shutdown ( int booting );
72 * Shut down system for OS boot
75 static inline void shutdown_boot ( void ) {
80 * Shut down system for exit back to firmware
83 static inline void shutdown_exit ( void ) {
87 #endif /* _IPXE_INIT_H */