init: add SYS_INIT()
This is to be used by subsystem that don't really want to create a device but rather only want to be initialized automatically during the kernel init sequence. It is just a wrapper around DEVICE_INIT(), and thus still uses a device object, but it hides that fact and can be replaced in the future without changing its model. It can be used when a device created does not have objects associated with it, but only an init function, and also when the device name (DEVICE_INIT(<dev_name>, ...) does not matter. Change-Id: I5488f430a6fb757cdcb499ef352775dc67aa0565 Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
47c04f4ac2
commit
629e1dd861
1 changed files with 3 additions and 0 deletions
|
@ -38,6 +38,9 @@ extern "C" {
|
|||
#define _SYS_INIT_LEVEL_MICROKERNEL 3
|
||||
#define _SYS_INIT_LEVEL_APPLICATION 4
|
||||
|
||||
#define SYS_INIT(init_fn, level, prio) \
|
||||
DEVICE_INIT(sys_init_##init_fn, "", init_fn, NULL, NULL, level, prio)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue