mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
sparc32: Add cmpxchg64().
commit 23198ddffb upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9aacd82304
commit
05e15a59ee
@@ -63,6 +63,9 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
|
||||
(unsigned long)_n_, sizeof(*(ptr))); \
|
||||
})
|
||||
|
||||
u64 __cmpxchg_u64(u64 *ptr, u64 old, u64 new);
|
||||
#define cmpxchg64(ptr, old, new) __cmpxchg_u64(ptr, old, new)
|
||||
|
||||
#include <asm-generic/cmpxchg-local.h>
|
||||
|
||||
/*
|
||||
|
||||
@@ -173,6 +173,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;
|
||||
|
||||
Reference in New Issue
Block a user