From patchwork Wed May 13 19:05:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salter X-Patchwork-Id: 6399631 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 61A1F9F374 for ; Wed, 13 May 2015 19:05:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9122E2020F for ; Wed, 13 May 2015 19:05:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F275203E6 for ; Wed, 13 May 2015 19:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934327AbbEMTFl (ORCPT ); Wed, 13 May 2015 15:05:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34925 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933685AbbEMTFl (ORCPT ); Wed, 13 May 2015 15:05:41 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4DJ5cIr001855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 13 May 2015 15:05:39 -0400 Received: from deneb.redhat.com (ovpn-113-53.phx2.redhat.com [10.3.113.53]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4DJ5bA9013608; Wed, 13 May 2015 15:05:37 -0400 From: Mark Salter To: Arlin Davis Cc: linux-rdma@vger.kernel.org, Mark Salter Subject: [PATCH] dapl: aarch64 support for linux Date: Wed, 13 May 2015 15:05:33 -0400 Message-Id: <1431543933-27781-1-git-send-email-msalter@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add atomic ops to fix builds for aarch64 Linux. Signed-off-by: Mark Salter Acked-by: Arlin Davis --- dapl/udapl/linux/dapl_osd.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dapl/udapl/linux/dapl_osd.h b/dapl/udapl/linux/dapl_osd.h index 10f71b0..2b255d0 100644 --- a/dapl/udapl/linux/dapl_osd.h +++ b/dapl/udapl/linux/dapl_osd.h @@ -50,7 +50,8 @@ #endif /* __linux__ */ #if !defined (__i386__) && !defined (__ia64__) && !defined(__x86_64__) && \ - !defined(__PPC__) && !defined(__PPC64__) && !defined(__s390x__) + !defined(__PPC__) && !defined(__PPC64__) && !defined(__s390x__) && \ + !defined(__aarch64__) #error UNDEFINED ARCH #endif @@ -214,6 +215,8 @@ dapl_os_atomic_inc ( : "=&r" (tmp), "+m" (v) : "b" (v) : "cc"); +#elif defined(__aarch64__) + __atomic_fetch_add(v, 1, __ATOMIC_ACQ_REL); #else /* !__ia64__ */ __asm__ __volatile__ ( "lock;" "incl %0" @@ -258,6 +261,8 @@ dapl_os_atomic_dec ( : "=&r" (tmp), "+m" (v) : "b" (v) : "cc"); +#elif defined(__aarch64__) + __atomic_fetch_add(v, -1, __ATOMIC_ACQ_REL); #else /* !__ia64__ */ __asm__ __volatile__ ( "lock;" "decl %0" @@ -322,6 +327,10 @@ dapl_os_atomic_assign ( : "=&r" (current_value), "=m" (*v) : "r" (v), "r" (match_value), "r" (new_value), "m" (*v) : "cc", "memory"); +#elif defined(__aarch64__) + current_value = match_value; + __atomic_compare_exchange_n(v, ¤t_value, new_value, 1, + __ATOMIC_ACQ_REL, __ATOMIC_RELAXED); #else __asm__ __volatile__ ( "lock; cmpxchgl %1, %2"