2 * Memory barrier implementations for PKUnity SoC and UniCore ISA
4 * Copyright (C) 2001-2012 GUAN Xue-tao
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 #ifndef __UNICORE_BARRIER_H__
11 #define __UNICORE_BARRIER_H__
13 #define isb() __asm__ __volatile__ ("" : : : "memory")
14 #define dsb() __asm__ __volatile__ ("" : : : "memory")
15 #define dmb() __asm__ __volatile__ ("" : : : "memory")
17 #define mb() barrier()
18 #define rmb() barrier()
19 #define wmb() barrier()
20 #define smp_mb() barrier()
21 #define smp_rmb() barrier()
22 #define smp_wmb() barrier()
23 #define read_barrier_depends() do { } while (0)
24 #define smp_read_barrier_depends() do { } while (0)
26 #define set_mb(var, value) do { var = value; smp_mb(); } while (0)
28 #endif /* __UNICORE_BARRIER_H__ */