From 629e1dd861a7e3d366381e43b82715ec6e193840 Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Thu, 28 Jan 2016 14:56:48 -0500 Subject: [PATCH] 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(, ...) does not matter. Change-Id: I5488f430a6fb757cdcb499ef352775dc67aa0565 Signed-off-by: Benjamin Walsh --- include/init.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/init.h b/include/init.h index c65c8030ab6..7adec2f4cf9 100644 --- a/include/init.h +++ b/include/init.h @@ -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