2014-02-13 09:11:11 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2014, Paweł Dziepak, pdziepak@quarnos.org.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Alexander von Gluck IV <kallisti5@unixzen.com>
|
|
|
|
*/
|
|
|
|
#ifndef _KERNEL_ARCH_ARM_ATOMIC_H
|
|
|
|
#define _KERNEL_ARCH_ARM_ATOMIC_H
|
|
|
|
|
|
|
|
|
2019-06-20 20:04:47 +03:00
|
|
|
#include <arch_cpu.h>
|
2014-02-26 22:49:38 +04:00
|
|
|
|
|
|
|
|
2014-02-13 09:11:11 +04:00
|
|
|
static inline void
|
|
|
|
memory_read_barrier_inline(void)
|
|
|
|
{
|
2014-02-26 22:49:38 +04:00
|
|
|
dmb();
|
2014-02-13 09:11:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
memory_write_barrier_inline(void)
|
|
|
|
{
|
2014-02-26 22:49:38 +04:00
|
|
|
dmb();
|
2014-02-13 09:11:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
memory_full_barrier_inline(void)
|
|
|
|
{
|
2014-02-26 22:49:38 +04:00
|
|
|
dmb();
|
2014-02-13 09:11:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-02-26 22:49:38 +04:00
|
|
|
#define memory_read_barrier memory_read_barrier_inline
|
|
|
|
#define memory_write_barrier memory_write_barrier_inline
|
|
|
|
#define memory_full_barrier memory_full_barrier_inline
|
|
|
|
|
2014-02-13 09:11:11 +04:00
|
|
|
|
|
|
|
#endif // _KERNEL_ARCH_ARM_ATOMIC_H
|