2006-04-30 03:35:01 +02:00
|
|
|
#ifndef _GPXE_INIT_H
|
|
|
|
#define _GPXE_INIT_H
|
2006-04-30 03:08:52 +02:00
|
|
|
|
|
|
|
#include <gpxe/tables.h>
|
|
|
|
|
2007-07-04 00:09:56 +02:00
|
|
|
/**
|
|
|
|
* An initialisation function
|
2006-04-30 03:08:52 +02:00
|
|
|
*
|
2007-07-04 00:09:56 +02:00
|
|
|
* 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
|
2006-04-30 03:08:52 +02:00
|
|
|
*
|
2007-07-04 00:09:56 +02:00
|
|
|
* 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.
|
2006-04-30 03:08:52 +02:00
|
|
|
*
|
2007-07-04 00:09:56 +02:00
|
|
|
* @{
|
2006-04-30 03:08:52 +02:00
|
|
|
*/
|
|
|
|
|
2007-07-04 00:09:56 +02:00
|
|
|
#define STARTUP_EARLY 01 /**< Early startup */
|
|
|
|
#define STARTUP_NORMAL 02 /**< Normal startup */
|
2006-04-30 03:08:52 +02:00
|
|
|
|
2007-07-04 00:09:56 +02:00
|
|
|
/** @} */
|
2006-04-30 03:08:52 +02:00
|
|
|
|
|
|
|
/* Use double digits to avoid problems with "10" < "9" on alphabetic sort */
|
|
|
|
#define INIT_CONSOLE 02
|
2007-06-30 23:43:31 +02:00
|
|
|
#define INIT_GDBSYM 03
|
|
|
|
#define INIT_CPU 04
|
|
|
|
#define INIT_TIMERS 05
|
2006-04-30 03:08:52 +02:00
|
|
|
#define INIT_LOADBUF 08
|
|
|
|
#define INIT_PCMCIA 09
|
|
|
|
|
2007-07-04 00:09:56 +02:00
|
|
|
extern void initialise ( void );
|
|
|
|
extern void startup ( void );
|
|
|
|
extern void shutdown ( void );
|
2006-04-30 03:08:52 +02:00
|
|
|
|
2006-04-30 03:35:01 +02:00
|
|
|
#endif /* _GPXE_INIT_H */
|