kernel: remove deprecated init levels
Change-Id: Id69ec05d9f3417dcfe5ef7ff170681a0a40f3fe7 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
327486282a
commit
de38141898
5 changed files with 0 additions and 56 deletions
|
@ -9,8 +9,6 @@
|
||||||
#define _DEVICE_H_
|
#define _DEVICE_H_
|
||||||
|
|
||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
/* for __deprecated */
|
|
||||||
#include <toolchain.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Device Driver APIs
|
* @brief Device Driver APIs
|
||||||
|
@ -30,28 +28,11 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XXX the easiest way to trigger a warning on a preprocessor macro
|
|
||||||
* is to use _Pragma("GCC warning \"...\"), however it's impossible to filter
|
|
||||||
* those out of -Werror, needed for sanitycheck. So we do this nastiness
|
|
||||||
* instead. These functions get compiled but don't take up extra space in
|
|
||||||
* the binary..
|
|
||||||
*/
|
|
||||||
static __deprecated const int _INIT_LEVEL_PRIMARY = 1;
|
|
||||||
static __deprecated const int _INIT_LEVEL_SECONDARY = 1;
|
|
||||||
static __deprecated const int _INIT_LEVEL_NANOKERNEL = 1;
|
|
||||||
static __deprecated const int _INIT_LEVEL_MICROKERNEL = 1;
|
|
||||||
static const int _INIT_LEVEL_PRE_KERNEL_1 = 1;
|
static const int _INIT_LEVEL_PRE_KERNEL_1 = 1;
|
||||||
static const int _INIT_LEVEL_PRE_KERNEL_2 = 1;
|
static const int _INIT_LEVEL_PRE_KERNEL_2 = 1;
|
||||||
static const int _INIT_LEVEL_POST_KERNEL = 1;
|
static const int _INIT_LEVEL_POST_KERNEL = 1;
|
||||||
static const int _INIT_LEVEL_APPLICATION = 1;
|
static const int _INIT_LEVEL_APPLICATION = 1;
|
||||||
|
|
||||||
#define _DEPRECATION_CHECK(dev_name, level) \
|
|
||||||
static inline void _CONCAT(_deprecation_check_, dev_name)() \
|
|
||||||
{ \
|
|
||||||
int foo = _CONCAT(_INIT_LEVEL_, level); \
|
|
||||||
(void)foo; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def DEVICE_INIT
|
* @def DEVICE_INIT
|
||||||
*
|
*
|
||||||
|
@ -123,7 +104,6 @@ static const int _INIT_LEVEL_APPLICATION = 1;
|
||||||
.name = drv_name, .init = (init_fn), \
|
.name = drv_name, .init = (init_fn), \
|
||||||
.config_info = (cfg_info) \
|
.config_info = (cfg_info) \
|
||||||
}; \
|
}; \
|
||||||
_DEPRECATION_CHECK(dev_name, level) \
|
|
||||||
static struct device _CONCAT(__device_, dev_name) __used \
|
static struct device _CONCAT(__device_, dev_name) __used \
|
||||||
__attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \
|
__attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \
|
||||||
.config = &_CONCAT(__config_, dev_name), \
|
.config = &_CONCAT(__config_, dev_name), \
|
||||||
|
@ -157,7 +137,6 @@ static const int _INIT_LEVEL_APPLICATION = 1;
|
||||||
.device_pm_control = (pm_control_fn), \
|
.device_pm_control = (pm_control_fn), \
|
||||||
.config_info = (cfg_info) \
|
.config_info = (cfg_info) \
|
||||||
}; \
|
}; \
|
||||||
_DEPRECATION_CHECK(dev_name, level) \
|
|
||||||
static struct device _CONCAT(__device_, dev_name) __used \
|
static struct device _CONCAT(__device_, dev_name) __used \
|
||||||
__attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \
|
__attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \
|
||||||
.config = &_CONCAT(__config_, dev_name), \
|
.config = &_CONCAT(__config_, dev_name), \
|
||||||
|
|
|
@ -19,9 +19,6 @@ extern "C" {
|
||||||
* System initialization levels. The PRE_KERNEL_1 and PRE_KERNEL_2 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
|
* executed in the kernel's initialization context, which uses the interrupt
|
||||||
* stack. The remaining levels are executed in the kernel's main 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_PRE_KERNEL_1 0
|
#define _SYS_INIT_LEVEL_PRE_KERNEL_1 0
|
||||||
|
@ -29,12 +26,6 @@ extern "C" {
|
||||||
#define _SYS_INIT_LEVEL_POST_KERNEL 2
|
#define _SYS_INIT_LEVEL_POST_KERNEL 2
|
||||||
#define _SYS_INIT_LEVEL_APPLICATION 3
|
#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
|
/* Counter use to avoid issues if two or more system devices are declared
|
||||||
* in the same C file with the same init function
|
* in the same C file with the same init function
|
||||||
|
|
|
@ -83,10 +83,6 @@
|
||||||
DEVICE_INIT_LEVEL(PRE_KERNEL_2) \
|
DEVICE_INIT_LEVEL(PRE_KERNEL_2) \
|
||||||
DEVICE_INIT_LEVEL(POST_KERNEL) \
|
DEVICE_INIT_LEVEL(POST_KERNEL) \
|
||||||
DEVICE_INIT_LEVEL(APPLICATION) \
|
DEVICE_INIT_LEVEL(APPLICATION) \
|
||||||
DEVICE_INIT_LEVEL(PRIMARY) \
|
|
||||||
DEVICE_INIT_LEVEL(SECONDARY) \
|
|
||||||
DEVICE_INIT_LEVEL(NANOKERNEL) \
|
|
||||||
DEVICE_INIT_LEVEL(MICROKERNEL) \
|
|
||||||
__device_init_end = .; \
|
__device_init_end = .; \
|
||||||
DEVICE_BUSY_BITFIELD() \
|
DEVICE_BUSY_BITFIELD() \
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,6 @@ extern struct device __device_PRE_KERNEL_1_start[];
|
||||||
extern struct device __device_PRE_KERNEL_2_start[];
|
extern struct device __device_PRE_KERNEL_2_start[];
|
||||||
extern struct device __device_POST_KERNEL_start[];
|
extern struct device __device_POST_KERNEL_start[];
|
||||||
extern struct device __device_APPLICATION_start[];
|
extern struct device __device_APPLICATION_start[];
|
||||||
|
|
||||||
/* Deprecated */
|
|
||||||
extern struct device __device_PRIMARY_start[];
|
|
||||||
extern struct device __device_SECONDARY_start[];
|
|
||||||
extern struct device __device_NANOKERNEL_start[];
|
|
||||||
extern struct device __device_MICROKERNEL_start[];
|
|
||||||
|
|
||||||
extern struct device __device_init_end[];
|
extern struct device __device_init_end[];
|
||||||
|
|
||||||
static struct device *config_levels[] = {
|
static struct device *config_levels[] = {
|
||||||
|
@ -29,13 +22,6 @@ static struct device *config_levels[] = {
|
||||||
__device_PRE_KERNEL_2_start,
|
__device_PRE_KERNEL_2_start,
|
||||||
__device_POST_KERNEL_start,
|
__device_POST_KERNEL_start,
|
||||||
__device_APPLICATION_start,
|
__device_APPLICATION_start,
|
||||||
|
|
||||||
/* Deprecated levels */
|
|
||||||
__device_PRIMARY_start,
|
|
||||||
__device_SECONDARY_start,
|
|
||||||
__device_NANOKERNEL_start,
|
|
||||||
__device_MICROKERNEL_start,
|
|
||||||
|
|
||||||
/* End marker */
|
/* End marker */
|
||||||
__device_init_end,
|
__device_init_end,
|
||||||
};
|
};
|
||||||
|
|
|
@ -179,11 +179,6 @@ static void _main(void *unused1, void *unused2, void *unused3)
|
||||||
|
|
||||||
_sys_device_do_config_level(_SYS_INIT_LEVEL_POST_KERNEL);
|
_sys_device_do_config_level(_SYS_INIT_LEVEL_POST_KERNEL);
|
||||||
|
|
||||||
/* These 3 are deprecated */
|
|
||||||
_sys_device_do_config_level(_SYS_INIT_LEVEL_SECONDARY);
|
|
||||||
_sys_device_do_config_level(_SYS_INIT_LEVEL_NANOKERNEL);
|
|
||||||
_sys_device_do_config_level(_SYS_INIT_LEVEL_MICROKERNEL);
|
|
||||||
|
|
||||||
/* Final init level before app starts */
|
/* Final init level before app starts */
|
||||||
_sys_device_do_config_level(_SYS_INIT_LEVEL_APPLICATION);
|
_sys_device_do_config_level(_SYS_INIT_LEVEL_APPLICATION);
|
||||||
|
|
||||||
|
@ -353,9 +348,6 @@ FUNC_NORETURN void _Cstart(void)
|
||||||
|
|
||||||
prepare_multithreading(dummy_thread);
|
prepare_multithreading(dummy_thread);
|
||||||
|
|
||||||
/* Deprecated */
|
|
||||||
_sys_device_do_config_level(_SYS_INIT_LEVEL_PRIMARY);
|
|
||||||
|
|
||||||
/* perform basic hardware initialization */
|
/* perform basic hardware initialization */
|
||||||
_sys_device_do_config_level(_SYS_INIT_LEVEL_PRE_KERNEL_1);
|
_sys_device_do_config_level(_SYS_INIT_LEVEL_PRE_KERNEL_1);
|
||||||
_sys_device_do_config_level(_SYS_INIT_LEVEL_PRE_KERNEL_2);
|
_sys_device_do_config_level(_SYS_INIT_LEVEL_PRE_KERNEL_2);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue