kernel: convert most thread APIs to system calls
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
76c04a21ee
commit
468190a795
6 changed files with 162 additions and 27 deletions
|
@ -50,18 +50,22 @@ static inline int _is_idle_thread_ptr(k_tid_t thread)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_MULTITHREADING
|
||||
#define _ASSERT_VALID_PRIO(prio, entry_point) do { \
|
||||
__ASSERT(((prio) == K_IDLE_PRIO && _is_idle_thread(entry_point)) || \
|
||||
#define _VALID_PRIO(prio, entry_point) \
|
||||
(((prio) == K_IDLE_PRIO && _is_idle_thread(entry_point)) || \
|
||||
(_is_prio_higher_or_equal((prio), \
|
||||
K_LOWEST_APPLICATION_THREAD_PRIO) && \
|
||||
_is_prio_lower_or_equal((prio), \
|
||||
K_HIGHEST_APPLICATION_THREAD_PRIO)), \
|
||||
K_HIGHEST_APPLICATION_THREAD_PRIO)))
|
||||
|
||||
#define _ASSERT_VALID_PRIO(prio, entry_point) do { \
|
||||
__ASSERT(_VALID_PRIO((prio), (entry_point)), \
|
||||
"invalid priority (%d); allowed range: %d to %d", \
|
||||
(prio), \
|
||||
K_LOWEST_APPLICATION_THREAD_PRIO, \
|
||||
K_HIGHEST_APPLICATION_THREAD_PRIO); \
|
||||
} while ((0))
|
||||
#else
|
||||
#define _VALID_PRIO(prio, entry_point) ((prio) == -1)
|
||||
#define _ASSERT_VALID_PRIO(prio, entry_point) __ASSERT((prio) == -1, "")
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue