kernel: support custom k_busy_wait()

Support architectures implementing their own k_busy_wait.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2017-12-21 18:23:34 -05:00 committed by Anas Nashif
commit 94d034dd5e
2 changed files with 11 additions and 0 deletions

View file

@ -380,6 +380,15 @@ config ARCH_HAS_CUSTOM_SWAP_TO_MAIN
the _main() thread, but instead must do something custom. It must
enable this option in that case.
config ARCH_HAS_CUSTOM_BUSY_WAIT
bool
# hidden
default n
help
It's possible that an architecture port cannot or does not want to use
the provided k_busy_wait(), but instead must do something custom. It must
enable this option in that case.
config SYS_CLOCK_TICKS_PER_SEC
int
prompt "System tick frequency (in ticks/second)"

View file

@ -69,6 +69,7 @@ int _is_thread_essential(void)
return _current->base.user_options & K_ESSENTIAL;
}
#if !defined(CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT)
void k_busy_wait(u32_t usec_to_wait)
{
#if defined(CONFIG_TICKLESS_KERNEL) && \
@ -96,6 +97,7 @@ int saved_always_on = k_enable_sys_clock_always_on();
_sys_clock_always_on = saved_always_on;
#endif
}
#endif
#ifdef CONFIG_THREAD_CUSTOM_DATA
void _impl_k_thread_custom_data_set(void *value)