|
@@ -1,66 +0,0 @@
|
1
|
|
-#ifndef INIT_H
|
2
|
|
-#define INIT_H
|
3
|
|
-
|
4
|
|
-#include "stddef.h" /* for NULL */
|
5
|
|
-#include <gpxe/tables.h>
|
6
|
|
-
|
7
|
|
-/*
|
8
|
|
- * In order to avoid having objects dragged in just because main()
|
9
|
|
- * calls their initialisation function, we allow each object to
|
10
|
|
- * specify that it has a function that must be called to initialise
|
11
|
|
- * that object. The function call_init_fns() will call all the
|
12
|
|
- * included objects' initialisation functions.
|
13
|
|
- *
|
14
|
|
- * Objects that require initialisation should include init.h and
|
15
|
|
- * register the initialisation function using INIT_FN().
|
16
|
|
- *
|
17
|
|
- * Objects may register up to three functions: init, reset and exit.
|
18
|
|
- * init gets called only once, at the point that Etherboot is
|
19
|
|
- * initialised (before the call to main()). reset gets called between
|
20
|
|
- * each boot attempt. exit gets called only once, just before the
|
21
|
|
- * loaded OS starts up (or just before Etherboot exits, if it exits,
|
22
|
|
- * or when the PXE NBP calls UNDI_SHUTDOWN, if it's a PXE NBP).
|
23
|
|
- *
|
24
|
|
- * The syntax is:
|
25
|
|
- * INIT_FN ( init_order, init_function, reset_function, exit_function );
|
26
|
|
- * where init_order is an ordering taken from the list below. Any
|
27
|
|
- * function may be left as NULL.
|
28
|
|
- */
|
29
|
|
-
|
30
|
|
-/* An entry in the initialisation function table */
|
31
|
|
-
|
32
|
|
-struct init_fn {
|
33
|
|
- void ( *init ) ( void );
|
34
|
|
- void ( *reset ) ( void );
|
35
|
|
- void ( *exit ) ( void );
|
36
|
|
-};
|
37
|
|
-
|
38
|
|
-/* Use double digits to avoid problems with "10" < "9" on alphabetic sort */
|
39
|
|
-#define INIT_LIBRM 01
|
40
|
|
-#define INIT_CONSOLE 02
|
41
|
|
-#define INIT_CPU 03
|
42
|
|
-#define INIT_TIMERS 04
|
43
|
|
-#define INIT_PCIBIOS 05
|
44
|
|
-#define INIT_MEMSIZES 06
|
45
|
|
-#define INIT_RELOCATE 07
|
46
|
|
-#define INIT_LOADBUF 08
|
47
|
|
-#define INIT_PCMCIA 09
|
48
|
|
-#define INIT_HEAP 10
|
49
|
|
-#define INIT_RPC 11
|
50
|
|
-
|
51
|
|
-/* Macro for creating an initialisation function table entry */
|
52
|
|
-#define INIT_FN( init_order, init_func, reset_func, exit_func ) \
|
53
|
|
- struct init_fn PREFIX_OBJECT(init_fn__) \
|
54
|
|
- __table ( init_fn, init_order ) = { \
|
55
|
|
- .init = init_func, \
|
56
|
|
- .reset = reset_func, \
|
57
|
|
- .exit = exit_func, \
|
58
|
|
- };
|
59
|
|
-
|
60
|
|
-/* Function prototypes */
|
61
|
|
-
|
62
|
|
-void call_init_fns ( void );
|
63
|
|
-void call_reset_fns ( void );
|
64
|
|
-void call_exit_fns ( void );
|
65
|
|
-
|
66
|
|
-#endif /* INIT_H */
|