aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/atomic_common.h
Commit message (Collapse)AuthorAgeFilesLines
* atomic: add stub atomic_load_consume_ptrMateusz Guzik2021-01-251-0/+8
|
* atomic: make atomic_store_ptr type-awareMateusz Guzik2021-01-251-1/+1
|
* atomic_common.h: Fix the volatile qualifier placement in atomic_load_ptrJessica Clarke2020-09-201-1/+1
| | | | | | | | | | | | | | | | This was broken in r357940 which introduced the __typeof use. We need the volatile qualifier to be on the pointee not the pointer otherwise it does nothing. This was found by mhorne in D26498, noticing there was a problem (a spin loop condition was hoisted for RISC-V boot code) but not the root cause of it. Reported by: mhorne Reviewed by: mhorne, mjg Approved by: mhorne, mjg Differential Revision: https://reviews.freebsd.org/D26500 Notes: svn path=/head/; revision=365932
* Make atomic_load_ptr type-awareMateusz Guzik2020-02-141-1/+1
| | | | | | | | | | Returned value has type based on the argument, meaning consumers no longer have to cast in the commmon case. This commit keeps the kernel compilable without patching the rest. Notes: svn path=/head/; revision=357940
* Add the missing volatile qualifier in atomic_store_ptrAndrew Turner2019-11-071-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=354451
* Add atomic_load(9) and atomic_store(9) operations.Konstantin Belousov2017-12-191-0/+73
They provide relaxed-ordered atomic access semantic. Due to the FreeBSD memory model, the operations are syntaxical wrappers around the volatile accesses. The volatile qualifier is used to ensure that the access not optimized out and in turn depends on the volatile semantic as implemented by supported compilers. The motivation for adding the operation is to help people coming from other systems or knowing the C11/C++ standards where atomics have special type and require use of the special access operations. It is still the case that FreeBSD requires plain load and stores of aligned integer types to be atomic. Suggested by: jhb Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13534 Notes: svn path=/head/; revision=326971