arc: include: asm: add generic cmpxchg64(), cmpxchg64_local(), and cmpxchg_local() in cmpxchg.h
PATCH 1/1 arc: include: asm: add generic cmpxchg64(), cmpxchg64_local(), and cmpxchg_local() in cmpxchg.h
Some of sub-systems may need cmpxchg64() or another cmpxchg*local() functions, need implement them, or can not pass compiling.
The related error (allmodconfig for arc):
CC drivers/block/blockconsole.o
drivers/block/blockconsole.c: In function ‘bcon_advance_console_bytes’:
drivers/block/blockconsole.c:164: error: implicit declaration of function ‘cmpxchg64’
--- arch/arc/include/asm/cmpxchg.h | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
arch/arc/include/asm/cmpxchg.h +13 -0
@@ -140,4 +140,17 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr,*/ #define atomic_xchg (v, new) (xchg(&((v)->counter), new)) +#include <asm-generic/cmpxchg-local.h> + +/* +* cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make +* them available. +*/ +#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)) +#define cmpxchg64 (ptr, o, n) cmpxchg64_local((ptr), (o), (n)) + +#endif
Signature · 1 line
1.7.7.6
Hello Maintainers:
Please help check this patch whether OK or not, when you have time.
Thanks.
Quoted 38 lines · Chen Gang
Some of sub-systems may need
cmpxchg64()or another cmpxchg*local() functions, need implement them, or can not pass compiling.The related error (allmodconfig for arc):
CC
drivers/block/blockconsole.o
drivers/block/blockconsole.c: In function ‘bcon_advance_console_bytes’:
drivers/block/blockconsole.c:164: error: implicit declaration of function ‘cmpxchg64’Signed-off-by Chen Gang <[email protected]>--- arch/arc/include/asm/cmpxchg.h | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)arch/arc/include/asm/cmpxchg.h +13
-0@@ -140,4 +140,17 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr,*/ #define atomic_xchg (v, new) (xchg(&((v)->counter), new)) +#include <asm-generic/cmpxchg-local.h> + +/* +* cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make +* them available. +*/ +#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)) +#define cmpxchg64 (ptr, o, n) cmpxchg64_local((ptr), (o), (n)) + +#endif
Signature · 1 line
Chen Gang