From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH] xen/arm32: __cmpxchg_mb should be marked always_inline Date: Thu, 3 Apr 2014 18:09:10 +0100 Message-ID: <1396544950-21909-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WVl8d-0002bZ-VA for xen-devel@lists.xenproject.org; Thu, 03 Apr 2014 17:09:16 +0000 Received: by mail-wg0-f45.google.com with SMTP id l18so2191200wgh.4 for ; Thu, 03 Apr 2014 10:09:14 -0700 (PDT) List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Currently __cmpxchg_mb is only marked inline. The compiler can decide to not inline this function. In this case, the call to __cmpxchg will be inlined but not optimised. This will result linking failure because of __bad_cmpxchg. Catched by clang 3.5. --- xen/include/asm-arm/arm32/cmpxchg.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-arm/arm32/cmpxchg.h b/xen/include/asm-arm/arm32/cmpxchg.h index 70c6090..3f4e7a1 100644 --- a/xen/include/asm-arm/arm32/cmpxchg.h +++ b/xen/include/asm-arm/arm32/cmpxchg.h @@ -112,8 +112,9 @@ static always_inline unsigned long __cmpxchg( return oldval; } -static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old, - unsigned long new, int size) +static always_inline unsigned long __cmpxchg_mb(volatile void *ptr, + unsigned long old, + unsigned long new, int size) { unsigned long ret; -- 1.7.10.4