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 __table ( struct init_fn, "init_fns" )
19 /** Declare an initialisation functon */
20 #define __init_fn( init_order ) __table_entry ( INIT_FNS, init_order )
22 /** @defgroup initfn_order Initialisation function ordering
26 #define INIT_EARLY 01 /**< Early initialisation */
27 #define INIT_SERIAL 02 /**< Serial driver initialisation */
28 #define INIT_CONSOLE 03 /**< Console initialisation */
29 #define INIT_NORMAL 04 /**< Normal initialisation */
35 /** Shutdown is in order to exit (return to gPXE's caller) */
36 SHUTDOWN_EXIT = 0x0001,
37 /** Shutdown is in order to boot an OS */
38 SHUTDOWN_BOOT = 0x0002,
39 /** Do not remove devices */
40 SHUTDOWN_KEEP_DEVICES = 0x0004,
44 * A startup/shutdown function
46 * Startup and shutdown functions may be called multiple times, as
47 * part of the calls to startup() and shutdown().
50 void ( * startup ) ( void );
51 void ( * shutdown ) ( int flags );
54 /** Startup/shutdown function table */
55 #define STARTUP_FNS __table ( struct startup_fn, "startup_fns" )
57 /** Declare a startup/shutdown function */
58 #define __startup_fn( startup_order ) \
59 __table_entry ( STARTUP_FNS, startup_order )
61 /** @defgroup startfn_order Startup/shutdown function ordering
63 * Shutdown functions are called in the reverse order to startup
69 #define STARTUP_EARLY 01 /**< Early startup */
70 #define STARTUP_NORMAL 02 /**< Normal startup */
71 #define STARTUP_LATE 03 /**< Late startup */
75 extern void initialise ( void );
76 extern void startup ( void );
77 extern void shutdown ( int flags );
79 #endif /* _GPXE_INIT_H */