kernel: add K_USER flag and _is_thread_user()

Indicates that the thread is configured to run in user mode.
Delete stub function in userspace.c

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-08-30 14:17:44 -07:00 committed by Andrew Boie
commit 5cfa5dc8db
3 changed files with 19 additions and 7 deletions

View file

@ -516,4 +516,17 @@ static inline struct k_thread *_unpend_first_thread(_wait_q_t *wait_q)
return thread;
}
#ifdef CONFIG_USERSPACE
/**
* Indicate whether the currently running thread has been configured to be
* a user thread.
*
* @return nonzero if the current thread is a user thread, regardless of what
* mode the CPU is currently in
*/
static inline int _is_thread_user(void)
{
return _current->base.user_options & K_USER;
}
#endif /* CONFIG_USERSPACE */
#endif /* _ksched__h_ */