Messages in this thread |  | | Date | Wed, 7 Jun 2017 14:58:50 +0200 | | From | Peter Zijlstra <> | | Subject | Re: [PATCH 13/17] RISC-V: Add include subdirectory |
| |
On Wed, Jun 07, 2017 at 02:36:27PM +0200, Peter Zijlstra wrote: > Which (pending the sub confusion) will generate the entire set of: > > atomic_add, atomic_add_return{_relaxed,_acquire,_release,} atomic_fetch_add{_relaxed,_acquire,_release,} > atomic_sub, atomic_sub_return{_relaxed,_acquire,_release,} atomic_fetch_sub{_relaxed,_acquire,_release,} > > atomic_and, atomic_fetch_and{_relaxed,_acquire,_release,} > atomic_or, atomic_fetch_or{_relaxed,_acquire,_release,} > atomic_xor, atomic_fetch_xor{_relaxed,_acquire,_release,} >
Another approach would be to override __atomic_op_{acquire,release} and use things like:
"FENCE r,rw" -- (load) ACQUIRE "FENCE rw,w" -- (store) RELEASE
And then you only need to provide _relaxed atomics.
Also, and I didn't check for that, you need to provide:
smp_load_acquire(), smp_store_release(), atomic_read_acquire(), atomic_store_release().
|  |