init: Support fine-grained device initialization priorities

Introduces the SYS_DEFINE_DEVICE() macro, which supports 5 distinct
levels of device initialization and 100 priorities within each level.

Note: The existing init macros (e.g. nano_early_init()) have been
adapted to utilize the enhanced initialization model, but will
eventually be retired.

Change-Id: If677029d8b711a3fae9b2f32b5470cd97d19aeda
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2015-10-14 11:17:20 -04:00 committed by Anas Nashif
commit a860cb7bff
8 changed files with 139 additions and 171 deletions

View file

@ -108,10 +108,8 @@ extern void _Ctors(void);
static void _main(void)
{
_sys_device_do_config_level(NANO_EARLY);
_sys_device_do_config_level(NANO_LATE);
_sys_device_do_config_level(APP_EARLY);
_sys_device_do_config_level(APP_EARLY);
_sys_device_do_config_level(_SYS_INIT_LEVEL_NANOKERNEL);
_sys_device_do_config_level(_SYS_INIT_LEVEL_APPLICATION);
extern void main(void);
main();
@ -259,9 +257,8 @@ FUNC_NORETURN void _Cstart(void)
/* perform basic hardware initialization */
_sys_device_do_config_level(PRE_KERNEL_CORE);
_sys_device_do_config_level(PRE_KERNEL_EARLY);
_sys_device_do_config_level(PRE_KERNEL_LATE);
_sys_device_do_config_level(_SYS_INIT_LEVEL_PRIMARY);
_sys_device_do_config_level(_SYS_INIT_LEVEL_SECONDARY);
/*
* Initialize random number generator