Skip to content
Permalink
Browse files

kernel: Fix usage of CONFIG_SYS_CLOCK_EXISTS

When compiling the kernel with CONFIG_SYS_CLOCK_TICKS_PER_SEC=0,
the CONFIG_SYS_CLOCK_EXISTS internal variable is unset.
This completely disables timer handling in the kernel, but a couple of
spots missed the required conditional compilation.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
  • Loading branch information...
carlescufi committed May 9, 2019
1 parent 6d4a520 commit 201fdf0aecc04a817a8dc54e743d568f5356e4a4
Showing with 10 additions and 0 deletions.
  1. +4 −0 arch/arm/core/cortex_m/vector_table.S
  2. +2 −0 kernel/Kconfig
  3. +2 −0 kernel/work_q.c
  4. +2 −0 subsys/power/reboot.c
@@ -66,5 +66,9 @@ SECTION_SUBSEC_FUNC(exc_vector_table,_vector_table_section,_vector_table)
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
.word __reserved
.word __pendsv
#if defined(CONFIG_SYS_CLOCK_EXISTS)
.word z_clock_isr
#else
.word __reserved
#endif

@@ -557,6 +557,8 @@ config SYS_CLOCK_TICKS_PER_SEC
granularity, not necessarily the number or frequency of
interrupts delivered to the kernel.

A value of 0 completely disables timer support in the kernel.

config SYS_CLOCK_HW_CYCLES_PER_SEC
int "System clock's h/w timer frequency"
help
@@ -19,7 +19,9 @@

#define WORKQUEUE_THREAD_NAME "workqueue"

#ifdef CONFIG_SYS_CLOCK_EXISTS
static struct k_spinlock lock;
#endif

extern void z_work_q_main(void *work_q_ptr, void *p2, void *p3);

@@ -21,7 +21,9 @@ extern void sys_clock_disable(void);
void sys_reboot(int type)
{
(void)irq_lock();
#ifdef CONFIG_SYS_CLOCK_EXISTS
sys_clock_disable();
#endif

sys_arch_reboot(type);

0 comments on commit 201fdf0

Please sign in to comment.
You can’t perform that action at this time.