Selaa lähdekoodia

Use new generic tables infrastructure

tags/v0.9.3
Michael Brown 19 vuotta sitten
vanhempi
commit
241f426a85
2 muutettua tiedostoa jossa 14 lisäystä ja 12 poistoa
  1. 2
    2
      src/core/init.c
  2. 12
    10
      src/include/init.h

+ 2
- 2
src/core/init.c Näytä tiedosto

@@ -9,8 +9,8 @@
9 9
 
10 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 15
 void call_init_fns ( void ) {
16 16
 	struct init_fn *init_fn;

+ 12
- 10
src/include/init.h Näytä tiedosto

@@ -1,6 +1,8 @@
1 1
 #ifndef INIT_H
2 2
 #define INIT_H
3 3
 
4
+#include "tables.h"
5
+
4 6
 /*
5 7
  * In order to avoid having objects dragged in just because main()
6 8
  * calls their initialisation function, we allow each object to
@@ -33,20 +35,20 @@ struct init_fn {
33 35
 };
34 36
 
35 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 48
 /* Macro for creating an initialisation function table entry */
47 49
 #define INIT_FN( init_order, init_func, reset_func, exit_func )		      \
48 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 52
 		.init = init_func,					      \
51 53
 		.reset = reset_func,					      \
52 54
 		.exit = exit_func,					      \

Loading…
Peruuta
Tallenna