mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-14 15:21:32 +00:00
Use new generic tables infrastructure
This commit is contained in:
parent
b9c9cee8a3
commit
241f426a85
@ -9,8 +9,8 @@
|
||||
|
||||
#include "init.h"
|
||||
|
||||
extern struct init_fn init_fns[];
|
||||
extern struct init_fn init_fns_end[];
|
||||
static struct init_fn init_fns[0] __table_start(init_fn);
|
||||
static struct init_fn init_fns_end[0] __table_end(init_fn);
|
||||
|
||||
void call_init_fns ( void ) {
|
||||
struct init_fn *init_fn;
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef INIT_H
|
||||
#define INIT_H
|
||||
|
||||
#include "tables.h"
|
||||
|
||||
/*
|
||||
* In order to avoid having objects dragged in just because main()
|
||||
* 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 */
|
||||
#define INIT_LIBRM "00"
|
||||
#define INIT_CONSOLE "01"
|
||||
#define INIT_CPU "02"
|
||||
#define INIT_TIMERS "03"
|
||||
#define INIT_PCIBIOS "04"
|
||||
#define INIT_MEMSIZES "05"
|
||||
#define INIT_RELOCATE "06"
|
||||
#define INIT_PCMCIA "07"
|
||||
#define INIT_HEAP "08"
|
||||
#define INIT_LIBRM 01
|
||||
#define INIT_CONSOLE 02
|
||||
#define INIT_CPU 03
|
||||
#define INIT_TIMERS 04
|
||||
#define INIT_PCIBIOS 05
|
||||
#define INIT_MEMSIZES 06
|
||||
#define INIT_RELOCATE 07
|
||||
#define INIT_PCMCIA 08
|
||||
#define INIT_HEAP 09
|
||||
|
||||
/* Macro for creating an initialisation function table entry */
|
||||
#define INIT_FN( init_order, init_func, reset_func, exit_func ) \
|
||||
static struct init_fn init_functions \
|
||||
__attribute__ ((used,__section__(".init_fns." init_order))) = { \
|
||||
__attribute__ (( used, __table_section(init_fn,init_order) )) = { \
|
||||
.init = init_func, \
|
||||
.reset = reset_func, \
|
||||
.exit = exit_func, \
|
||||
|
Loading…
Reference in New Issue
Block a user