1 /**************************************************************************
2 * call_{init,reset,exit}_fns ()
4 * Call the various initialisation and exit functions. We use a
5 * function table so that we don't end up dragging in an object just
6 * because we call its initialisation function.
7 **************************************************************************
10 #include <gpxe/init.h>
12 static struct init_fn init_fns
[0]
13 __table_start ( struct init_fn
, init_fn
);
14 static struct init_fn init_fns_end
[0]
15 __table_end ( struct init_fn
, init_fn
);
17 void call_init_fns ( void ) {
18 struct init_fn
*init_fn
;
20 for ( init_fn
= init_fns
; init_fn
< init_fns_end
; init_fn
++ ) {
26 void call_reset_fns ( void ) {
27 struct init_fn
*init_fn
;
29 for ( init_fn
= init_fns
; init_fn
< init_fns_end
; init_fn
++ ) {
35 void call_exit_fns ( void ) {
36 struct init_fn
*init_fn
;
39 * Exit functions are called in reverse order to
40 * initialisation functions.
42 for ( init_fn
= init_fns_end
- 1; init_fn
>= init_fns
; init_fn
-- ) {