syscalls: Export _is_user_context() regardless of CONFIG_USERSPACE
This commit exports the _is_user_context() function regardless of the CONFIG_USERSPACE setting. If userspace is enabled, the value returned depends on the execution context. If userspace is disabled, the _is_user_context() always returns false. Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
This commit is contained in:
parent
07cfaa27b6
commit
78eb718396
1 changed files with 21 additions and 17 deletions
|
@ -115,23 +115,6 @@ typedef u32_t (*_k_syscall_handler_t)(u32_t arg1, u32_t arg2, u32_t arg3,
|
||||||
void *ssf);
|
void *ssf);
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicate whether we are currently running in user mode
|
|
||||||
*
|
|
||||||
* @return true if the CPU is currently running with user permissions
|
|
||||||
*/
|
|
||||||
static inline bool z_arch_is_user_context(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicate whether the CPU is currently in user mode
|
|
||||||
*
|
|
||||||
* @return true if the CPU is currently running with user permissions
|
|
||||||
*/
|
|
||||||
static inline bool _is_user_context(void)
|
|
||||||
{
|
|
||||||
return z_arch_is_user_context();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper data structures for system calls with large argument lists
|
* Helper data structures for system calls with large argument lists
|
||||||
*/
|
*/
|
||||||
|
@ -271,8 +254,29 @@ static inline u64_t z_syscall_ret64_invoke2(u32_t arg1, u32_t arg2,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicate whether we are currently running in user mode
|
||||||
|
*
|
||||||
|
* @return true if the CPU is currently running with user permissions
|
||||||
|
*/
|
||||||
|
static inline bool z_arch_is_user_context(void);
|
||||||
|
|
||||||
#endif /* CONFIG_USERSPACE */
|
#endif /* CONFIG_USERSPACE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicate whether the CPU is currently in user mode
|
||||||
|
*
|
||||||
|
* @return true if the CPU is currently running with user permissions
|
||||||
|
*/
|
||||||
|
static inline bool _is_user_context(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_USERSPACE
|
||||||
|
return z_arch_is_user_context();
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue