|
Revision 237, 1.5 kB
(checked in by mwhitworth, 9 months ago)
|
|
Add to plenty of include files.
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | #ifndef INIT_H |
|---|
| 20 | #define INIT_H |
|---|
| 21 | |
|---|
| 22 | #include <typedefs.h> |
|---|
| 23 | |
|---|
| 24 | #define __init __attribute__ ((section (".init.text"))) |
|---|
| 25 | #define __initdata __attribute__ ((section ("init.data"))) |
|---|
| 26 | #define __exit __attribute__ ((section (".exit.text")) |
|---|
| 27 | |
|---|
| 28 | typedef int (*InitCall)(); |
|---|
| 29 | typedef void (*ExitCall)(); |
|---|
| 30 | |
|---|
| 31 | #define ATTR_USED __attribute__((used)) |
|---|
| 32 | |
|---|
| 33 | #define DeclareInitCall(level,func) \ |
|---|
| 34 | static InitCall __initcall_##func ATTR_USED \ |
|---|
| 35 | __attribute__((__section__(".initcall" level ".init")))=func |
|---|
| 36 | |
|---|
| 37 | #define CoreInit(func) DeclareInitCall("1",func) |
|---|
| 38 | #define FsInit(func) DeclareInitCall("2",func) |
|---|
| 39 | #define NetInit(func) DeclareInitCall("2",func) |
|---|
| 40 | #define DeviceInit(func) DeclareInitCall("3",func) |
|---|
| 41 | #define SubSysInit(func) DeclareInitCall("4", func) |
|---|
| 42 | |
|---|
| 43 | #endif |
|---|