mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
Use new generic tables infrastructure
This commit is contained in:
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
|
|
||||||
extern struct init_fn init_fns[];
|
static struct init_fn init_fns[0] __table_start(init_fn);
|
||||||
extern struct init_fn init_fns_end[];
|
static struct init_fn init_fns_end[0] __table_end(init_fn);
|
||||||
|
|
||||||
void call_init_fns ( void ) {
|
void call_init_fns ( void ) {
|
||||||
struct init_fn *init_fn;
|
struct init_fn *init_fn;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#ifndef INIT_H
|
#ifndef INIT_H
|
||||||
#define INIT_H
|
#define INIT_H
|
||||||
|
|
||||||
|
#include "tables.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In order to avoid having objects dragged in just because main()
|
* In order to avoid having objects dragged in just because main()
|
||||||
* calls their initialisation function, we allow each object to
|
* calls their initialisation function, we allow each object to
|
||||||
@@ -33,20 +35,20 @@ struct init_fn {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Use double digits to avoid problems with "10" < "9" on alphabetic sort */
|
/* Use double digits to avoid problems with "10" < "9" on alphabetic sort */
|
||||||
#define INIT_LIBRM "00"
|
#define INIT_LIBRM 01
|
||||||
#define INIT_CONSOLE "01"
|
#define INIT_CONSOLE 02
|
||||||
#define INIT_CPU "02"
|
#define INIT_CPU 03
|
||||||
#define INIT_TIMERS "03"
|
#define INIT_TIMERS 04
|
||||||
#define INIT_PCIBIOS "04"
|
#define INIT_PCIBIOS 05
|
||||||
#define INIT_MEMSIZES "05"
|
#define INIT_MEMSIZES 06
|
||||||
#define INIT_RELOCATE "06"
|
#define INIT_RELOCATE 07
|
||||||
#define INIT_PCMCIA "07"
|
#define INIT_PCMCIA 08
|
||||||
#define INIT_HEAP "08"
|
#define INIT_HEAP 09
|
||||||
|
|
||||||
/* Macro for creating an initialisation function table entry */
|
/* Macro for creating an initialisation function table entry */
|
||||||
#define INIT_FN( init_order, init_func, reset_func, exit_func ) \
|
#define INIT_FN( init_order, init_func, reset_func, exit_func ) \
|
||||||
static struct init_fn init_functions \
|
static struct init_fn init_functions \
|
||||||
__attribute__ ((used,__section__(".init_fns." init_order))) = { \
|
__attribute__ (( used, __table_section(init_fn,init_order) )) = { \
|
||||||
.init = init_func, \
|
.init = init_func, \
|
||||||
.reset = reset_func, \
|
.reset = reset_func, \
|
||||||
.exit = exit_func, \
|
.exit = exit_func, \
|
||||||
|
|||||||
Reference in New Issue
Block a user