aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/lib
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-09-27 22:38:19 -0700
committerDavid S. Miller <davem@davemloft.net>2017-09-27 22:38:19 -0700
commit23198ddffb6cddb5d5824230af4dd4b46e4046a4 (patch)
tree652e124f2107f25a2d2507057905695375414b72 /arch/sparc/lib
parentsbus: char: Move D7S_MINOR to include/linux/miscdevice.h (diff)
downloadlinux-dev-23198ddffb6cddb5d5824230af4dd4b46e4046a4.tar.xz
linux-dev-23198ddffb6cddb5d5824230af4dd4b46e4046a4.zip
sparc32: Add cmpxchg64().
This fixes the build with i40e driver enabled. Reported-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/lib')
-rw-r--r--arch/sparc/lib/atomic32.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/sparc/lib/atomic32.c b/arch/sparc/lib/atomic32.c
index 2c373329d5cb..ddacb5aeb424 100644
--- a/arch/sparc/lib/atomic32.c
+++ b/arch/sparc/lib/atomic32.c
@@ -172,6 +172,20 @@ unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new)
}
EXPORT_SYMBOL(__cmpxchg_u32);
+u64 __cmpxchg_u64(u64 *ptr, u64 old, u64 new)
+{
+ unsigned long flags;
+ u64 prev;
+
+ spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
+ if ((prev = *ptr) == old)
+ *ptr = new;
+ spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
+
+ return prev;
+}
+EXPORT_SYMBOL(__cmpxchg_u64);
+
unsigned long __xchg_u32(volatile u32 *ptr, u32 new)
{
unsigned long flags;