]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
arch: tile: include: asm: add cmpxchg64() definition
authorChen Gang <gang.chen@asianux.com>
Mon, 1 Jul 2013 02:21:51 +0000 (10:21 +0800)
committerChris Metcalf <cmetcalf@tilera.com>
Wed, 17 Jul 2013 16:45:38 +0000 (12:45 -0400)
Need add cmpxchg64(), or will cause compiling issue.

Need define it as cmpxchg() only for 64-bit operation, since cmpxchg()
can support 8 bytes.

The related error (with allmodconfig):

  drivers/block/blockconsole.c: In function ‘bcon_advance_console_bytes’:
  drivers/block/blockconsole.c:164:2: error: implicit declaration of function ‘cmpxchg64’ [-Werror=implicit-function-declaration]

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
arch/tile/include/asm/cmpxchg.h

index 276f067e36406e52657f7f0c8f95f9e71cdf28df..1da5bfbd8c61d135edda020c17724de4ab315ebe 100644 (file)
@@ -68,6 +68,12 @@ extern unsigned long __cmpxchg_called_with_bad_pointer(void);
 
 #define tas(ptr) (xchg((ptr), 1))
 
+#define cmpxchg64(ptr, o, n)                                           \
+({                                                                     \
+       BUILD_BUG_ON(sizeof(*(ptr)) != 8);                              \
+       cmpxchg((ptr), (o), (n));                                       \
+})
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_TILE_CMPXCHG_H */