Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arch: tile: include: asm: add cmpxchg64() definition

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>

authored by

Chen Gang and committed by
Chris Metcalf
cf3a13d7 ad81f054

+6
+6
arch/tile/include/asm/cmpxchg.h
··· 68 68 69 69 #define tas(ptr) (xchg((ptr), 1)) 70 70 71 + #define cmpxchg64(ptr, o, n) \ 72 + ({ \ 73 + BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 74 + cmpxchg((ptr), (o), (n)); \ 75 + }) 76 + 71 77 #endif /* __ASSEMBLY__ */ 72 78 73 79 #endif /* _ASM_TILE_CMPXCHG_H */