zephyr/tests/kernel/common/src
Andrew Boie b3eb510f5c kernel: fix atomic ops in user mode on some arches
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>
2019-03-18 09:18:00 -04:00
..
atomic.c atomic: Add atomic_set_bit_to() API 2019-01-25 17:35:44 -05:00
bitfield.c tests: Add 'U' to unsigned variable assignments 2018-12-04 22:51:56 -05:00
boot_delay.c tests: common: move boot_delay test to common 2019-02-05 20:40:07 -05:00
byteorder.c
clock.c tests: kernel: common: Bugfix for POSIX arch in TICKLESS 2018-11-13 09:19:03 -05:00
dlist.c misc/dlist: Swap insertion API for a faster one 2019-02-01 15:57:21 -05:00
errno.c tests: common: move errno test to common 2019-02-05 20:40:07 -05:00
intmath.c tests: Add 'U' to unsigned variable assignments 2018-12-04 22:51:56 -05:00
irq_offload.c all: Update reserved function names 2019-03-11 13:48:42 -04:00
main.c kernel: fix atomic ops in user mode on some arches 2019-03-18 09:18:00 -04:00
multilib.c
printk.c tests: fix compilation error for printk 2019-03-06 18:15:06 -05:00
slist.c
timeout_order.c tests: kernel: common: Bugfix for POSIX arch in TICKLESS 2018-11-13 09:19:03 -05:00