xref: /openbmc/linux/arch/arc/include/asm/atomic.h (revision 97e6f135)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4  */
5 
6 #ifndef _ASM_ARC_ATOMIC_H
7 #define _ASM_ARC_ATOMIC_H
8 
9 #ifndef __ASSEMBLY__
10 
11 #include <linux/types.h>
12 #include <linux/compiler.h>
13 #include <asm/cmpxchg.h>
14 #include <asm/barrier.h>
15 #include <asm/smp.h>
16 
17 #define arch_atomic_read(v)  READ_ONCE((v)->counter)
18 
19 #ifdef CONFIG_ARC_HAS_LLSC
20 #include <asm/atomic-llsc.h>
21 #else
22 #include <asm/atomic-spinlock.h>
23 #endif
24 
25 /*
26  * 64-bit atomics
27  */
28 #ifdef CONFIG_GENERIC_ATOMIC64
29 #include <asm-generic/atomic64.h>
30 #else
31 #include <asm/atomic64-arcv2.h>
32 #endif
33 
34 #endif	/* !__ASSEMBLY__ */
35 
36 #endif
37