18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
38c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
48c2ecf20Sopenharmony_ci * for more details.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 2001 - 2012 Tensilica Inc.
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef _XTENSA_SYSTEM_H
108c2ecf20Sopenharmony_ci#define _XTENSA_SYSTEM_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <asm/core.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define mb()  ({ __asm__ __volatile__("memw" : : : "memory"); })
158c2ecf20Sopenharmony_ci#define rmb() barrier()
168c2ecf20Sopenharmony_ci#define wmb() mb()
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#if XCHAL_HAVE_S32C1I
198c2ecf20Sopenharmony_ci#define __smp_mb__before_atomic()		barrier()
208c2ecf20Sopenharmony_ci#define __smp_mb__after_atomic()		barrier()
218c2ecf20Sopenharmony_ci#endif
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#include <asm-generic/barrier.h>
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#endif /* _XTENSA_SYSTEM_H */
26