4 #include <gpxe/tables.h>
7 * An initialisation function
9 * Initialisation functions are called exactly once, as part of the
10 * call to initialise().
13 void ( * initialise ) ( void );
16 /** Initialisation function table */
17 #define INIT_FNS "init_fns"
19 /** Declare an initialisation functon */
20 #define __init_fn( init_order ) \
21 __table ( struct init_fn, INIT_FNS, init_order )
23 /** @defgroup initfn_order Initialisation function ordering
27 #define INIT_EARLY 01 /**< Early initialisation */
28 #define INIT_SERIAL 02 /**< Serial driver initialisation */
29 #define INIT_CONSOLE 03 /**< Console initialisation */
30 #define INIT_NORMAL 04 /**< Normal initialisation */
36 /** Shutdown is in order to exit (return to gPXE's caller) */
37 SHUTDOWN_EXIT = 0x0001,
38 /** Shutdown is in order to boot an OS */
39 SHUTDOWN_BOOT = 0x0002,
40 /** Do not remove devices */
41 SHUTDOWN_KEEP_DEVICES = 0x0004,
45 * A startup/shutdown function
47 * Startup and shutdown functions may be called multiple times, as
48 * part of the calls to startup() and shutdown().
51 void ( * startup ) ( void );
52 void ( * shutdown ) ( int flags );
55 /** Startup/shutdown function table */
56 #define STARTUP_FNS "startup_fns"
58 /** Declare a startup/shutdown function */
59 #define __startup_fn( startup_order ) \
60 __table ( struct startup_fn, STARTUP_FNS, startup_order )
62 /** @defgroup startfn_order Startup/shutdown function ordering
64 * Shutdown functions are called in the reverse order to startup
70 #define STARTUP_EARLY 01 /**< Early startup */
71 #define STARTUP_NORMAL 02 /**< Normal startup */
72 #define STARTUP_LATE 03 /**< Late startup */
76 extern void initialise ( void );
77 extern void startup ( void );
78 extern void shutdown ( int flags );
80 #endif /* _GPXE_INIT_H */