From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Gang Subject: [PATCH v2] arch: tile: include: asm: add cmpxchg64() definition Date: Mon, 01 Jul 2013 10:21:51 +0800 Message-ID: <51D0E7BF.9030206@asianux.com> References: <51CA6D21.3090901@asianux.com> <51CC492C.1040105@tilera.com> <51CCD891.8000806@asianux.com> <51CCEC27.8050508@asianux.com> <20130628150941.GA22767@linux-mips.org> <51D0E4B3.6080402@asianux.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from intranet.asianux.com ([58.214.24.6]:62174 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751504Ab3GACWn (ORCPT ); Sun, 30 Jun 2013 22:22:43 -0400 In-Reply-To: <51D0E4B3.6080402@asianux.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Ralf Baechle Cc: =?UTF-8?B?SsO2cm4gRW5nZWw=?= , Chris Metcalf , "linux-kernel@vger.kernel.org" , Linux-Arch , Paul Gortmaker 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 =E2=80=98bcon_advance_conso= le_bytes=E2=80=99: drivers/block/blockconsole.c:164:2: error: implicit declaration of fu= nction =E2=80=98cmpxchg64=E2=80=99 [-Werror=3Dimplicit-function-declara= tion] Signed-off-by: Chen Gang --- arch/tile/include/asm/cmpxchg.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/tile/include/asm/cmpxchg.h b/arch/tile/include/asm/cm= pxchg.h index 276f067..1da5bfb 100644 --- a/arch/tile/include/asm/cmpxchg.h +++ b/arch/tile/include/asm/cmpxchg.h @@ -68,6 +68,12 @@ extern unsigned long __cmpxchg_called_with_bad_point= er(void); =20 #define tas(ptr) (xchg((ptr), 1)) =20 +#define cmpxchg64(ptr, o, n) \ +({ \ + BUILD_BUG_ON(sizeof(*(ptr)) !=3D 8); \ + cmpxchg((ptr), (o), (n)); \ +}) + #endif /* __ASSEMBLY__ */ =20 #endif /* _ASM_TILE_CMPXCHG_H */ --=20 1.7.7.6