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:
parent
35b2021d87
commit
94d034dd5e
2 changed files with 11 additions and 0 deletions
|
@ -380,6 +380,15 @@ config ARCH_HAS_CUSTOM_SWAP_TO_MAIN
|
||||||
the _main() thread, but instead must do something custom. It must
|
the _main() thread, but instead must do something custom. It must
|
||||||
enable this option in that case.
|
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
|
config SYS_CLOCK_TICKS_PER_SEC
|
||||||
int
|
int
|
||||||
prompt "System tick frequency (in ticks/second)"
|
prompt "System tick frequency (in ticks/second)"
|
||||||
|
|
|
@ -69,6 +69,7 @@ int _is_thread_essential(void)
|
||||||
return _current->base.user_options & K_ESSENTIAL;
|
return _current->base.user_options & K_ESSENTIAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT)
|
||||||
void k_busy_wait(u32_t usec_to_wait)
|
void k_busy_wait(u32_t usec_to_wait)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_TICKLESS_KERNEL) && \
|
#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;
|
_sys_clock_always_on = saved_always_on;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_THREAD_CUSTOM_DATA
|
#ifdef CONFIG_THREAD_CUSTOM_DATA
|
||||||
void _impl_k_thread_custom_data_set(void *value)
|
void _impl_k_thread_custom_data_set(void *value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue