Microkernel timer uses new driver initialization
Update microkernel systems to use the new driver initialization model on the timer driver. Change-Id: Ida9ef2a395d0dddf4104d490d78b13b11ea3c347 Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
parent
b99194ee98
commit
03ab32a66a
3 changed files with 13 additions and 29 deletions
|
@ -33,16 +33,19 @@
|
|||
/*
|
||||
DESCRIPTION
|
||||
Initializing the timer driver is done in this module to reduce code duplication.
|
||||
Although both nanokernel and microkernel systems initialize the timer driver at
|
||||
the same point, the two systems differ in when the system can begin to process
|
||||
system clock ticks. A nanokernel system can process system clock ticks once
|
||||
the driver has initialized. However, in a microkernel system all system clock
|
||||
ticks are deferred (and stored on the kernel server command stack) until the
|
||||
kernel server fiber starts and begins processing any queued ticks.
|
||||
*/
|
||||
|
||||
#include <nanokernel.h>
|
||||
#include <init.h>
|
||||
#include <drivers/system_timer.h>
|
||||
|
||||
#ifdef CONFIG_NANOKERNEL
|
||||
|
||||
DECLARE_DEVICE_INIT_CONFIG(sys_clock, "sys_clock",
|
||||
_sys_clock_driver_init, NULL);
|
||||
pure_init(sys_clock, NULL);
|
||||
|
||||
#endif
|
||||
pure_init(sys_clock, NULL);
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#endif
|
||||
|
||||
extern void _k_init_node(void); /* defined by sysgen */
|
||||
extern void _k_init_drivers(void); /* defined by sysgen */
|
||||
|
||||
char __noinit __stack _k_server_stack[CONFIG_MICROKERNEL_SERVER_STACK_SIZE];
|
||||
|
||||
|
@ -52,8 +51,14 @@ char __noinit __stack _k_server_stack[CONFIG_MICROKERNEL_SERVER_STACK_SIZE];
|
|||
int _k_debug_halt = 0;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INIT_STACKS
|
||||
static uint32_t _k_server_command_stack_storage
|
||||
[CONFIG_COMMAND_STACK_SIZE] =
|
||||
{ [0 ... CONFIG_COMMAND_STACK_SIZE - 1] = 0xAAAAAAAA };
|
||||
#else
|
||||
static uint32_t __noinit _k_server_command_stack_storage
|
||||
[CONFIG_COMMAND_STACK_SIZE];
|
||||
#endif
|
||||
|
||||
struct nano_stack _k_command_stack = {NULL,
|
||||
_k_server_command_stack_storage,
|
||||
|
@ -81,11 +86,6 @@ void _k_kernel_init(void)
|
|||
*/
|
||||
_k_init_node();
|
||||
|
||||
#ifdef CONFIG_INIT_STACKS
|
||||
memset((char *)_k_server_command_stack_storage, 0xaa,
|
||||
sizeof(_k_server_command_stack_storage));
|
||||
#endif
|
||||
|
||||
task_fiber_start(_k_server_stack,
|
||||
CONFIG_MICROKERNEL_SERVER_STACK_SIZE,
|
||||
K_swapper,
|
||||
|
@ -94,7 +94,6 @@ void _k_kernel_init(void)
|
|||
CONFIG_MICROKERNEL_SERVER_PRIORITY,
|
||||
0);
|
||||
|
||||
_k_init_drivers();
|
||||
_sys_device_do_config_level(MICRO_EARLY);
|
||||
_sys_device_do_config_level(MICRO_LATE);
|
||||
_sys_device_do_config_level(APP_EARLY);
|
||||
|
|
|
@ -62,8 +62,6 @@ mbx_list = []
|
|||
map_list = []
|
||||
pool_list = []
|
||||
|
||||
driver_list = []
|
||||
|
||||
group_dictionary = {}
|
||||
group_key_list = []
|
||||
|
||||
|
@ -287,7 +285,6 @@ def kernel_main_c_header():
|
|||
do_not_edit_warning +
|
||||
"\n" +
|
||||
"#include <zephyr.h>\n" +
|
||||
"#include <drivers/system_timer.h>\n" +
|
||||
"#include <micro_private_types.h>\n" +
|
||||
"#include <kernel_main.h>\n" +
|
||||
"#include <toolchain.h>\n" +
|
||||
|
@ -959,20 +956,6 @@ def kernel_main_c_kernel_services():
|
|||
kernel_main_c_out("};\n")
|
||||
|
||||
|
||||
def kernel_main_c_driver_init():
|
||||
""" Generate driver initialization routine """
|
||||
|
||||
kernel_main_c_out("\n" +
|
||||
"void _k_init_drivers(void)\n" +
|
||||
"{\n" +
|
||||
"#ifdef CONFIG_SYS_CLOCK_EXISTS\n" +
|
||||
" _sys_clock_driver_init(NULL);\n" +
|
||||
"#endif\n")
|
||||
for driver_call in driver_list:
|
||||
kernel_main_c_out(" " + driver_call + ";\n")
|
||||
kernel_main_c_out("}\n")
|
||||
|
||||
|
||||
def kernel_main_c_node_init():
|
||||
""" Generate node initialization routine """
|
||||
|
||||
|
@ -1018,7 +1001,6 @@ def kernel_main_c_generate():
|
|||
kernel_main_c_maps()
|
||||
kernel_main_c_pools()
|
||||
kernel_main_c_kernel_services()
|
||||
kernel_main_c_driver_init()
|
||||
kernel_main_c_node_init()
|
||||
kernel_main_c_main()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue