kernel: deprecate old init levels

PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL
to replace them.

Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1,
SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug
where the documentation specified SECONDARY ran before the kernel started
up, but actually ran afterwards.

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2016-11-08 11:06:55 -08:00
commit 0b474eef9c
150 changed files with 281 additions and 238 deletions

View file

@ -26,17 +26,25 @@ extern "C" {
#endif
/*
* System initialization levels. The PRIMARY and SECONDARY levels are
* System initialization levels. The PRE_KERNEL_1 and PRE_KERNEL_2 levels are
* executed in the kernel's initialization context, which uses the interrupt
* stack. The remaining levels are executed in the kernel's main task
* (i.e. the nanokernel's background task or the microkernel's idle task).
* stack. The remaining levels are executed in the kernel's main task.
*
* PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL levels are currently deprecated
* and will be removed in the future.
*/
#define _SYS_INIT_LEVEL_PRIMARY 0
#define _SYS_INIT_LEVEL_SECONDARY 1
#define _SYS_INIT_LEVEL_NANOKERNEL 2
#define _SYS_INIT_LEVEL_MICROKERNEL 3
#define _SYS_INIT_LEVEL_APPLICATION 4
#define _SYS_INIT_LEVEL_PRE_KERNEL_1 0
#define _SYS_INIT_LEVEL_PRE_KERNEL_2 1
#define _SYS_INIT_LEVEL_POST_KERNEL 2
#define _SYS_INIT_LEVEL_APPLICATION 3
/* Deprecated, remove eventually */
#define _SYS_INIT_LEVEL_PRIMARY 4
#define _SYS_INIT_LEVEL_SECONDARY 5
#define _SYS_INIT_LEVEL_NANOKERNEL 6
#define _SYS_INIT_LEVEL_MICROKERNEL 7
/* Counter use to avoid issues if two or more system devices are declared
* in the same C file with the same init function