init: Split pure_init into pure_init_{early,late} levels
Split the pure init level into two phases this allows for easier migration of the nano kernel init process without resorting to naming or link order to force the ordering of functions at pure init time. The need for change was discovered while moving the system timers to be initialized by the init system. The base timer driver (eg. HPET) must be initialised prior to the system clock being enabled both of which need to happen before nano-kernel init. Change-Id: I7a2994965e48a891a78268080113ac8fccceb261 Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
This commit is contained in:
parent
03ab32a66a
commit
a88cd0fc34
2 changed files with 20 additions and 15 deletions
|
@ -34,13 +34,15 @@
|
|||
#include <device.h>
|
||||
#define __used __attribute__((__used__))
|
||||
|
||||
#define PURE 0
|
||||
#define NANO_EARLY 1
|
||||
#define NANO_LATE 2
|
||||
#define MICRO_EARLY 3
|
||||
#define MICRO_LATE 4
|
||||
#define APP_EARLY 5
|
||||
#define APP_LATE 6
|
||||
#define PURE 1
|
||||
#define PURE_EARLY 0
|
||||
#define PURE_LATE 1
|
||||
#define NANO_EARLY 2
|
||||
#define NANO_LATE 3
|
||||
#define MICRO_EARLY 4
|
||||
#define MICRO_LATE 5
|
||||
#define APP_EARLY 6
|
||||
#define APP_LATE 7
|
||||
|
||||
/** @def __define_initconfig
|
||||
*
|
||||
|
@ -67,21 +69,23 @@
|
|||
.driver_data = data}
|
||||
|
||||
/* Run on interrupt stack; no {micro,nano} kernel objects available */
|
||||
#define pure_init(cfg, data) __define_initconfig(cfg, 0, data)
|
||||
#define pure_early_init(cfg, data) __define_initconfig(cfg, 0, data)
|
||||
#define pure_init(cfg, data) __define_initconfig(cfg, 1, data)
|
||||
#define pure_late_init(cfg, data) __define_initconfig(cfg, 1, data)
|
||||
|
||||
/* Run from nano kernel idle task; no micro kernel objects available */
|
||||
#define nano_early_init(cfg, data) __define_initconfig(cfg, 1, data)
|
||||
#define nano_late_init(cfg, data) __define_initconfig(cfg, 2, data)
|
||||
#define nano_early_init(cfg, data) __define_initconfig(cfg, 2, data)
|
||||
#define nano_late_init(cfg, data) __define_initconfig(cfg, 3, data)
|
||||
|
||||
/* Run from micro kernel idle task. */
|
||||
#define micro_early_init(cfg, data) __define_initconfig(cfg, 3, data)
|
||||
#define micro_late_init(cfg, data) __define_initconfig(cfg, 4, data)
|
||||
#define micro_early_init(cfg, data) __define_initconfig(cfg, 4, data)
|
||||
#define micro_late_init(cfg, data) __define_initconfig(cfg, 5, data)
|
||||
|
||||
/* Run in the idle task; In a nano kernel only system run after
|
||||
* nano_late_init(). In a micro kernel system after micro_late_init()
|
||||
*/
|
||||
#define app_early_init(cfg, data) __define_initconfig(cfg, 5, data)
|
||||
#define app_late_init(cfg, data) __define_initconfig(cfg, 6, data)
|
||||
#define app_early_init(cfg, data) __define_initconfig(cfg, 6, data)
|
||||
#define app_late_init(cfg, data) __define_initconfig(cfg, 7, data)
|
||||
|
||||
|
||||
#endif /* _INIT_H_ */
|
||||
|
|
|
@ -282,7 +282,8 @@ FUNC_NORETURN void _Cstart(void)
|
|||
/* perform basic hardware initialization */
|
||||
|
||||
_InitHardware();
|
||||
_sys_device_do_config_level(PURE);
|
||||
_sys_device_do_config_level(PURE_EARLY);
|
||||
_sys_device_do_config_level(PURE_LATE);
|
||||
|
||||
/*
|
||||
* Initialize random number generator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue