mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-02 04:46:29 +00:00
Most CPUs have instructions like LOCK, LDREX/STREX, etc which allows for atomic operations without locking interrupts that can be invoked from user mode without complication. They typically use compiler builtin atomic operations, or custom assembly to implement them. However, some CPUs may lack these kinds of instructions, such as Cortex-M0 or some ARC. They use these C-based atomic operation implementations instead. Unfortunately these require grabbing a spinlock to ensure proper concurrency with other threads and ISRs. Hence, they will trigger an exception when called from user mode. For these platforms, which support user mode but not atomic operation instructions, the atomic API has been exposed as system calls. Some of the implementations in atomic_c.c which can be instead expressed in terms of other atomic operations have been removed. The kernel test of atomic operations now runs in user mode to prove that this works. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com> |
||
---|---|---|
.. | ||
include | ||
atomic_c.c | ||
CMakeLists.txt | ||
compiler_stack_protect.c | ||
device.c | ||
errno.c | ||
idle.c | ||
init.c | ||
int_latency_bench.c | ||
Kconfig | ||
Kconfig.power_mgmt | ||
mailbox.c | ||
mem_domain.c | ||
mem_slab.c | ||
mempool.c | ||
msg_q.c | ||
mutex.c | ||
pipes.c | ||
poll.c | ||
queue.c | ||
sched.c | ||
sem.c | ||
smp.c | ||
stack.c | ||
system_work_q.c | ||
thread_abort.c | ||
thread.c | ||
timeout.c | ||
timer.c | ||
userspace_handler.c | ||
userspace.c | ||
version.c | ||
work_q.c |