smp: limit the scope of some SMP-only functions
z_smp_init() is only available if CONFIG_SMP is defined, smp_timer_init() also depends on two Kconfig parameters. Also make it conditional in cavs_timer.c. Also clarify some SMP-related comments there. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
parent
cf92031b9b
commit
45b70e1500
2 changed files with 8 additions and 2 deletions
|
@ -88,7 +88,7 @@ static void compare_isr(const void *arg)
|
||||||
curr = count();
|
curr = count();
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
/* If it has been too long since last_count,
|
/* If we are too soon since last_count,
|
||||||
* this interrupt is likely the same interrupt
|
* this interrupt is likely the same interrupt
|
||||||
* event but being processed by another CPU.
|
* event but being processed by another CPU.
|
||||||
* Since it has already been processed and
|
* Since it has already been processed and
|
||||||
|
@ -121,6 +121,7 @@ static void compare_isr(const void *arg)
|
||||||
sys_clock_announce(dticks);
|
sys_clock_announce(dticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Runs on core 0 only */
|
||||||
int sys_clock_driver_init(const struct device *dev)
|
int sys_clock_driver_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
uint64_t curr = count();
|
uint64_t curr = count();
|
||||||
|
@ -181,7 +182,8 @@ uint32_t sys_clock_cycle_get_32(void)
|
||||||
return count32();
|
return count32();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && CONFIG_MP_NUM_CPUS > 1
|
#if defined(CONFIG_SMP) && CONFIG_MP_NUM_CPUS > 1 && !defined(CONFIG_SMP_BOOT_DELAY)
|
||||||
|
/* Runs on secondary cores */
|
||||||
void smp_timer_init(void)
|
void smp_timer_init(void)
|
||||||
{
|
{
|
||||||
/* This enables the Timer 0 (or 1) interrupt for CPU n.
|
/* This enables the Timer 0 (or 1) interrupt for CPU n.
|
||||||
|
|
|
@ -136,9 +136,13 @@ z_thread_return_value_set_with_data(struct k_thread *thread,
|
||||||
thread->base.swap_data = data;
|
thread->base.swap_data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_SMP
|
||||||
extern void z_smp_init(void);
|
extern void z_smp_init(void);
|
||||||
|
|
||||||
|
#if CONFIG_MP_NUM_CPUS > 1 && !defined(CONFIG_SMP_BOOT_DELAY)
|
||||||
extern void smp_timer_init(void);
|
extern void smp_timer_init(void);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void z_early_boot_rand_get(uint8_t *buf, size_t length);
|
extern void z_early_boot_rand_get(uint8_t *buf, size_t length);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue