1 /* 2 * Copyright 2014, Paweł Dziepak, pdziepak@quarnos.org. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * François Revol <revol@free.fr> 7 */ 8 #ifndef _KERNEL_ARCH_RISCV64_ATOMIC_H 9 #define _KERNEL_ARCH_RISCV64_ATOMIC_H 10 11 12 static inline void 13 memory_read_barrier_inline(void) 14 { 15 // TODO: investigate reparate read/write barriers 16 __sync_synchronize(); 17 } 18 19 20 static inline void 21 memory_write_barrier_inline(void) 22 { 23 // TODO: investigate reparate read/write barriers 24 __sync_synchronize(); 25 } 26 27 28 static inline void 29 memory_full_barrier_inline(void) 30 { 31 __sync_synchronize(); 32 } 33 34 35 #define memory_read_barrier memory_read_barrier_inline 36 #define memory_write_barrier memory_write_barrier_inline 37 #define memory_full_barrier memory_full_barrier_inline 38 39 40 #endif // _KERNEL_ARCH_RISCV64_ATOMIC_H 41