Browse Source

Use new generic tables infrastructure

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
241f426a85
2 changed files with 14 additions and 12 deletions
  1. 2
    2
      src/core/init.c
  2. 12
    10
      src/include/init.h

+ 2
- 2
src/core/init.c View File

9
 
9
 
10
 #include "init.h"
10
 #include "init.h"
11
 
11
 
12
-extern struct init_fn init_fns[];
13
-extern struct init_fn init_fns_end[];
12
+static struct init_fn init_fns[0] __table_start(init_fn);
13
+static struct init_fn init_fns_end[0] __table_end(init_fn);
14
 
14
 
15
 void call_init_fns ( void ) {
15
 void call_init_fns ( void ) {
16
 	struct init_fn *init_fn;
16
 	struct init_fn *init_fn;

+ 12
- 10
src/include/init.h View File

1
 #ifndef INIT_H
1
 #ifndef INIT_H
2
 #define INIT_H
2
 #define INIT_H
3
 
3
 
4
+#include "tables.h"
5
+
4
 /*
6
 /*
5
  * In order to avoid having objects dragged in just because main()
7
  * In order to avoid having objects dragged in just because main()
6
  * calls their initialisation function, we allow each object to
8
  * calls their initialisation function, we allow each object to
33
 };
35
 };
34
 
36
 
35
 /* Use double digits to avoid problems with "10" < "9" on alphabetic sort */
37
 /* Use double digits to avoid problems with "10" < "9" on alphabetic sort */
36
-#define INIT_LIBRM	"00"
37
-#define INIT_CONSOLE	"01"
38
-#define	INIT_CPU	"02"
39
-#define	INIT_TIMERS	"03"
40
-#define INIT_PCIBIOS	"04"
41
-#define	INIT_MEMSIZES	"05"
42
-#define INIT_RELOCATE	"06"
43
-#define	INIT_PCMCIA	"07"
44
-#define	INIT_HEAP	"08"
38
+#define	INIT_LIBRM	01
39
+#define	INIT_CONSOLE	02
40
+#define	INIT_CPU	03
41
+#define	INIT_TIMERS	04
42
+#define	INIT_PCIBIOS	05
43
+#define	INIT_MEMSIZES	06
44
+#define	INIT_RELOCATE	07
45
+#define	INIT_PCMCIA	08
46
+#define	INIT_HEAP	09
45
 
47
 
46
 /* Macro for creating an initialisation function table entry */
48
 /* Macro for creating an initialisation function table entry */
47
 #define INIT_FN( init_order, init_func, reset_func, exit_func )		      \
49
 #define INIT_FN( init_order, init_func, reset_func, exit_func )		      \
48
 	static struct init_fn init_functions				      \
50
 	static struct init_fn init_functions				      \
49
-	    __attribute__ ((used,__section__(".init_fns." init_order))) = {   \
51
+	    __attribute__ (( used, __table_section(init_fn,init_order) )) = { \
50
 		.init = init_func,					      \
52
 		.init = init_func,					      \
51
 		.reset = reset_func,					      \
53
 		.reset = reset_func,					      \
52
 		.exit = exit_func,					      \
54
 		.exit = exit_func,					      \

Loading…
Cancel
Save