summaryrefslogtreecommitdiff
path: root/arch/sh/include/asm/atomic.h
diff options
context:
space:
mode:
authorRich Felker <dalias@libc.org>2016-07-28 19:21:10 +0000
committerRich Felker <dalias@libc.org>2016-08-05 03:29:34 +0000
commit2b47d54ed41c33baf5825185168b493317c5572f (patch)
treea42a2098fa73f41d6d5b214e1eeca5712d419551 /arch/sh/include/asm/atomic.h
parent834da197058bebcb343320dafb8b62d416d4038c (diff)
sh: add J2 atomics using the cas.l instruction
Signed-off-by: Rich Felker <dalias@libc.org>
Diffstat (limited to 'arch/sh/include/asm/atomic.h')
-rw-r--r--arch/sh/include/asm/atomic.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h
index c399e1c55685..8a7bd80c8b33 100644
--- a/arch/sh/include/asm/atomic.h
+++ b/arch/sh/include/asm/atomic.h
@@ -1,6 +1,12 @@
#ifndef __ASM_SH_ATOMIC_H
#define __ASM_SH_ATOMIC_H
+#if defined(CONFIG_CPU_J2)
+
+#include <asm-generic/atomic.h>
+
+#else
+
/*
* Atomic operations that C can't guarantee us. Useful for
* resource counting etc..
@@ -63,4 +69,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
return c;
}
+#endif /* CONFIG_CPU_J2 */
+
#endif /* __ASM_SH_ATOMIC_H */