2019-06-04 10:11:33 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-01-18 15:12:16 +05:30
|
|
|
/*
|
|
|
|
* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ASM_ARC_ATOMIC_H
|
|
|
|
#define _ASM_ARC_ATOMIC_H
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/compiler.h>
|
|
|
|
#include <asm/cmpxchg.h>
|
|
|
|
#include <asm/barrier.h>
|
|
|
|
#include <asm/smp.h>
|
|
|
|
|
2021-05-25 15:02:13 +01:00
|
|
|
#define arch_atomic_read(v) READ_ONCE((v)->counter)
|
2013-01-18 15:12:16 +05:30
|
|
|
|
|
|
|
#ifdef CONFIG_ARC_HAS_LLSC
|
2021-08-03 20:26:09 -07:00
|
|
|
#include <asm/atomic-llsc.h>
|
2013-01-18 15:12:16 +05:30
|
|
|
#else
|
2021-08-03 20:26:09 -07:00
|
|
|
#include <asm/atomic-spinlock.h>
|
2013-01-18 15:12:16 +05:30
|
|
|
#endif
|
|
|
|
|
2020-05-11 13:27:23 -07:00
|
|
|
/*
|
|
|
|
* 64-bit atomics
|
|
|
|
*/
|
2015-07-27 17:23:28 +05:30
|
|
|
#ifdef CONFIG_GENERIC_ATOMIC64
|
2013-01-18 15:12:16 +05:30
|
|
|
#include <asm-generic/atomic64.h>
|
2021-08-03 20:26:09 -07:00
|
|
|
#else
|
|
|
|
#include <asm/atomic64-arcv2.h>
|
|
|
|
#endif
|
2015-07-27 17:23:28 +05:30
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
2013-01-18 15:12:16 +05:30
|
|
|
|
|
|
|
#endif
|