1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

4 Commits

Author SHA1 Message Date
Marian Buschsieweke
78ded2dd08
sys/atomic_utils: add atomic_{load,store}_ptr() 2021-11-23 14:23:50 +01:00
Marian Buschsieweke
8b0007f33a
sys/atomic_utils: return previous value
Update the `atomic_fetch_<OPERATION>_u<WIDTH>()` functions to return the old
value the target contained prior to applying the operation. This makes this
API much more versatile and closer to C11 atomics.
2020-12-16 18:09:35 +01:00
Marian Buschsieweke
a594b8adc1
sys/atomic_utils: Use volatile pointers
Mark all pointers in the atomic utils API as `volatile` for the following
reasons:

1. The guarantees provided by `volatile` is a subset of the guarantees
   provided by the atomic utils. This makes this fact more obvious.
2. Casting `volatile` off is undefined behavior. In order to be able to use
   the atomic utils on memory mapped IO (which needs the `volatile` qualifier)
   without resorting to undefined behavior, this API change is needed.
2020-11-24 14:00:51 +01:00
Marian Buschsieweke
0e8b8ffa64
sys/atomic_utils: Functions for atomic access
A set of functions competing with C11 atomics feature-wise, but are implemented
more efficient.
2020-11-05 10:23:32 +01:00