haiku/headers/private/kernel/arch/riscv64/arch_atomic.h
X512 d031c09ceb kernel/arch/cpu: implement for riscv64
Change-Id: Ib4dd636f9ebb62931f77c809185ea810485d801e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4057
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-08-06 15:41:33 +00:00

41 lines
799 B
C

/*
* Copyright 2014, Paweł Dziepak, pdziepak@quarnos.org.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*/
#ifndef _KERNEL_ARCH_RISCV64_ATOMIC_H
#define _KERNEL_ARCH_RISCV64_ATOMIC_H
static inline void
memory_read_barrier_inline(void)
{
// TODO: investigate reparate read/write barriers
__sync_synchronize();
}
static inline void
memory_write_barrier_inline(void)
{
// TODO: investigate reparate read/write barriers
__sync_synchronize();
}
static inline void
memory_full_barrier_inline(void)
{
__sync_synchronize();
}
#define memory_read_barrier memory_read_barrier_inline
#define memory_write_barrier memory_write_barrier_inline
#define memory_full_barrier memory_full_barrier_inline
#endif // _KERNEL_ARCH_RISCV64_ATOMIC_H