init: Add more verbose comment block

There has been some confusion around the usage model of the init
system. Add a comment block to hopefully limit the confusion. This
should not be construed to replace the documentation that has yet to
be written for the init subsystem.

Change-Id: I4df67f056b29b88ce6f0b8c2376deaf022cb8d84
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
This commit is contained in:
Dirk Brandewie 2015-09-25 13:02:12 -07:00 committed by Anas Nashif
commit 92d01351aa

View file

@ -67,8 +67,46 @@
__attribute__((__section__(".initconfig" #id ".init"))) = { \
.config = &(config_##cfg_name),\
.driver_data = data}
/*
* There are four distinct init levels, pre_kernel, nano, micro
* and app. Each init level a unique set of restrictions placed on the
* component being initialized within the level.
* pre_kernel:
* At this level no kernel objects or services are available to
* the component. pre_kernel has three phases, core, early and
* late. The core phase is intended for components that rely
* solely on hardware present in the processor/SOC and do *not*
* rely on services from any other component in the system. The
* early phase can be used by components that do *not* need kernel
* services and may rely on components from the core phase. The
* late phase can be used by components that do *not* need kernel
* services and may rely on components from the core and early
* phases.
* nano:
* At this level nano kernel services are available to the
* component. All services provided by the components initialized
* in the pre_kernel are also available. The nano level has an
* early and late phase. Components in the early phase may rely
* on the nano kernel and pre_kernel services. Components in the
* late phase may rely on, nano kernel, pre_kernel services and
* nano_early services
* micro:
* At this level micro kernel, nano kernel and pre_kernel services
* are available to the component. The micor level has an
* early and late phase. Components in the early phase may rely
* on micro kernel, nano kernel and pre_kernel services.
* Components in the late phase may rely on, micro kernel, nano
* kernel, pre_kernel services and micro_early services
* app:
* The app level is not intended for core kernel components but for
* the application developer to add any components that they wish to
* have initialized automatically during kernel initialization. The
* app level is executed as the final init stage in both nanokernel
* and microkernel configurations. The application component may
* rely any component configured into the system.
*/
/* Run on interrupt stack; no {micro,nano} kernel objects available */
/* Run on pre_kernel stack; no {micro,nano} kernel objects available */
#define pre_kernel_core_init(cfg, data) __define_initconfig(cfg, 0, data)
#define pre_kernel_early_init(cfg, data) __define_initconfig(cfg, 1, data)
#define pre_kernel_late_init(cfg, data) __define_initconfig(cfg, 2, data)