@@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -OF_ASSUME_NONNULL_BEGIN - static OF_INLINE int of_atomic_int_add(volatile int *_Nonnull p, int i) { __asm__ __volatile__ ( "0:\n\t" @@ -358,45 +356,27 @@ return r; } static OF_INLINE void -of_memory_barrier_sync(void) -{ - __asm__ __volatile__ ( - "sync" ::: "memory" - ); -} - -static OF_INLINE void -of_memory_barrier_enter(void) -{ - __asm__ __volatile__ ( - "sync" ::: "memory" - ); -} - -static OF_INLINE void -of_memory_barrier_exit(void) -{ - __asm__ __volatile__ ( - "sync" ::: "memory" - ); -} - -static OF_INLINE void -of_memory_barrier_producer(void) -{ - __asm__ __volatile__ ( - "sync" ::: "memory" - ); -} - -static OF_INLINE void -of_memory_barrier_consumer(void) -{ - __asm__ __volatile__ ( - "sync" ::: "memory" - ); -} - -OF_ASSUME_NONNULL_END +of_memory_barrier(void) +{ + __asm__ __volatile__ ( + "lwsync" ::: "memory" + ); +} + +static OF_INLINE void +of_memory_barrier_acquire(void) +{ + __asm__ __volatile__ ( + "lwsync" ::: "memory" + ); +} + +static OF_INLINE void +of_memory_barrier_release(void) +{ + __asm__ __volatile__ ( + "lwsync" ::: "memory" + ); +}