|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
#include <zephyr/syscall_list.h>#include <zephyr/arch/syscall.h>#include <stdbool.h>#include <zephyr/types.h>#include <zephyr/linker/sections.h>Go to the source code of this file.
Functions | |
| static __pinned_func bool | k_is_user_context (void) |
| Indicate whether the CPU is currently in user mode. | |
|
inlinestatic |
Indicate whether the CPU is currently in user mode.
CAUTION! If you branch on k_is_user_context() and then perform a kernel-only operation, you must insert a memory barrier before the privileged operation. Both the compiler and the CPU may reorder memory operations around the branch. Without a barrier, memory accesses related to the privileged path may move before the context check or be speculated.