init.h
Go to the documentation of this file.00001 #ifndef _GPXE_INIT_H
00002 #define _GPXE_INIT_H
00003
00004 FILE_LICENCE ( GPL2_OR_LATER );
00005
00006 #include <gpxe/tables.h>
00007
00008
00009
00010
00011
00012
00013
00014 struct init_fn {
00015 void ( * initialise ) ( void );
00016 };
00017
00018
00019 #define INIT_FNS __table ( struct init_fn, "init_fns" )
00020
00021
00022 #define __init_fn( init_order ) __table_entry ( INIT_FNS, init_order )
00023
00024
00025
00026
00027
00028 #define INIT_EARLY 01
00029 #define INIT_SERIAL 02
00030 #define INIT_CONSOLE 03
00031 #define INIT_NORMAL 04
00032
00033
00034
00035
00036 enum shutdown_flags {
00037
00038 SHUTDOWN_EXIT = 0x0001,
00039
00040 SHUTDOWN_BOOT = 0x0002,
00041
00042 SHUTDOWN_KEEP_DEVICES = 0x0004,
00043 };
00044
00045
00046
00047
00048
00049
00050
00051 struct startup_fn {
00052 void ( * startup ) ( void );
00053 void ( * shutdown ) ( int flags );
00054 };
00055
00056
00057 #define STARTUP_FNS __table ( struct startup_fn, "startup_fns" )
00058
00059
00060 #define __startup_fn( startup_order ) \
00061 __table_entry ( STARTUP_FNS, startup_order )
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 #define STARTUP_EARLY 01
00072 #define STARTUP_NORMAL 02
00073 #define STARTUP_LATE 03
00074
00075
00076
00077 extern void initialise ( void );
00078 extern void startup ( void );
00079 extern void shutdown ( int flags );
00080
00081 #endif