Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00c30e06 authored by Jonas Bonn's avatar Jonas Bonn
Browse files

asm-generic: move cmpxchg*_local defs to cmpxchg.h



asm/cmpxchg.h can be included on its own and needs to be self-consistent.
The definitions for the cmpxchg*_local macros, as such, need to be part
of this file.

This fixes a build issue on OpenRISC since the system.h smashing patch
96f951ed that introdued the direct inclusion
asm/cmpxchg.h into linux/llist.h.

CC: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarJonas Bonn <jonas@southpole.se>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
parent d4cb776f
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -136,12 +136,6 @@ static inline void atomic_dec(atomic_t *v)
#define atomic_xchg(ptr, v)		(xchg(&(ptr)->counter, (v)))
#define atomic_xchg(ptr, v)		(xchg(&(ptr)->counter, (v)))
#define atomic_cmpxchg(v, old, new)	(cmpxchg(&((v)->counter), (old), (new)))
#define atomic_cmpxchg(v, old, new)	(cmpxchg(&((v)->counter), (old), (new)))


#define cmpxchg_local(ptr, o, n)				  	       \
	((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
			(unsigned long)(n), sizeof(*(ptr))))

#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))

static inline int __atomic_add_unless(atomic_t *v, int a, int u)
static inline int __atomic_add_unless(atomic_t *v, int a, int u)
{
{
  int c, old;
  int c, old;
+10 −0
Original line number Original line Diff line number Diff line
@@ -92,6 +92,16 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
 */
 */
#include <asm-generic/cmpxchg-local.h>
#include <asm-generic/cmpxchg-local.h>


#ifndef cmpxchg_local
#define cmpxchg_local(ptr, o, n)				  	       \
	((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
			(unsigned long)(n), sizeof(*(ptr))))
#endif

#ifndef cmpxchg64_local
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
#endif

#define cmpxchg(ptr, o, n)	cmpxchg_local((ptr), (o), (n))
#define cmpxchg(ptr, o, n)	cmpxchg_local((ptr), (o), (n))
#define cmpxchg64(ptr, o, n)	cmpxchg64_local((ptr), (o), (n))
#define cmpxchg64(ptr, o, n)	cmpxchg64_local((ptr), (o), (n))