From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0057.outbound.protection.outlook.com [157.56.110.57]) by dpdk.org (Postfix) with ESMTP id 0116758F7 for ; Fri, 6 Nov 2015 10:41:24 +0100 (CET) Received: from BLUPR0701MB1969.namprd07.prod.outlook.com (10.163.121.20) by BLUPR0701MB1587.namprd07.prod.outlook.com (10.163.84.149) with Microsoft SMTP Server (TLS) id 15.1.312.18; Fri, 6 Nov 2015 09:41:23 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@caviumnetworks.com; Received: from jerin.caveonetworks.com (111.93.218.67) by BLUPR0701MB1969.namprd07.prod.outlook.com (10.163.121.20) with Microsoft SMTP Server (TLS) id 15.1.318.15; Fri, 6 Nov 2015 09:41:19 +0000 From: Jerin Jacob To: Date: Fri, 6 Nov 2015 15:10:20 +0530 Message-ID: <1446802833-22265-2-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1446802833-22265-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1446802833-22265-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0066.INDPRD01.PROD.OUTLOOK.COM (25.164.116.166) To BLUPR0701MB1969.namprd07.prod.outlook.com (25.163.121.20) X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1969; 2:uYCB8SJskrqtX6s6zhKfvsMYY9DXasE2fErnyuKCZu0FG2c1u/63hGDTGNujK2Fz1iiUaTmzILa3g0PuXPuSdGQtpwYdwNaqv3gQY1C85RYrM+gP0YrVF1nVwoPM2yApxIC/XApHLAC3XXo8uz3grcDKSZ3/sbjawaS4Pca5VlU=; 3:LlvnRcgqLceL9kkiSuVQu38FbJu0NvRo2rMl/hguQaCLSToBk//kUNJVnGK/8SPCTLLp8P6F0fnp3l74lgtuVR8P2v3vtgHgl1XGtjvE/IM7M2rUKdwXBnRQxN6MWUFSr5UlrMk/i5wCdl0cAsKgkQ==; 25:+vv9tV22sh7yKh8MoHp6NdG2HZI2vQeZvFNnP/dzFp9idLBelfo3k4LJ4wtQsJe4XjxWhQC/t0DjLSGyB92q7aCPm22dQD4q5ceXmmBNljrFmsMR7RT9b94fKDE9sEuD/Oiw3o0N141vakPgMLK8fnw5DagcIWzr77ID+LXuYCpASsPU+d3e+NEPrt7wSPbBe+KasU/fMLZkkmCTJf5cR/IXCiTGbD54GU844Y790y43MsgXRam+sYasZwyBfv2sB7fWq4PUIEUGCsHrIIqT7A== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1969; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1969; 20:JPhkyWFztGzFMvce3BApOM0xdV21f+wFY7ICjGhEFrQ01bRjLppiMoFUnVes1DeihrQ+Ju+wWjwHtow+SgPSdY7qgDUdF3U+5g/9ZO68cWIUbp3IEabWrwmCOQheY/en4Di67oo/uXungw6d/FTf689TIBUnDi0Mzlv8v4k3T/9q+2ILus48qRG9BbTGlDsflIWvNHGCbYY6IH8ar47728zAWoU3cuhENFKzqpH6DEfmU13zWo8kmk5MRTmqDmg9DNlJzoamZQcDDBrHL38i8SJ0bqk2BukwFhEatV4lXYVOaB9soK5qxRXgBUvqBZcz8zdQ12m5RwR4oLs7umj28MMiUc5LNXWOfHUNDCwuKlgIDKSuTH4TzFuFcQ6SzFqXuMfGf5RlTdYoAZT8/Bj8SeRpzqKQQkahIHus9St0WmRP7yCRCQK5LQXuzUt9ej/9r/PagKob5NlVM8mogOgxSvPY7uPrzsFEUTnbsishU4T21sjfEbLkRg63cC91GUtLuXIK3OTmcVm9hsaKL2Co9jnRf9U+H4vg+U8Ju0wldh3wkY68Py8fej4FH04SI5mpkc7L1PMA+gAjc6kvIy3ewFO9tcNA5wH61aD13tz4Ujc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:BLUPR0701MB1969; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1969; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1969; 4:yXOkgT5vdyitzDPYyPXoSAq4PtUf2sfbPlCQU0zHv1nyX2fLkGAThhfqD4AuTNI/PniTXN4Dypxrz+aY3EwoFaBQqGD01N38w/DzB6cYhP0XS4ACIq5H8VxQGqqxhWM1cJNuAV+2haYtfP88lP2Tb0lQvm7Mq5qfl12b9OwDSWRvI4aNEKXaRgxW9LI+s2uiuEXKftpAZ4mAM46W00BTyl1IVd3M3TWn9b2ngmTRcgzddKcBcK+8jyBmM68EzICgaClNtK76MdQKx9SVai8czr/15yD5csn/05GaS8KJLFkAJr7m2OVN/J14jGHyxeSTL68lBmKLXtp2v+FhqNV9OFvdRLHP5pcCc4K74gr4iDKce/Obe+MIBrGgacuThgYO X-Forefront-PRVS: 07521929C1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(189002)(199003)(50226001)(122386002)(48376002)(50986999)(50466002)(106356001)(229853001)(110136002)(19580405001)(40100003)(76176999)(87976001)(105586002)(5004730100002)(77096005)(19580395003)(2351001)(5003940100001)(92566002)(107886002)(189998001)(5007970100001)(33646002)(5001960100002)(66066001)(5009440100003)(42186005)(2950100001)(4001430100002)(97736004)(101416001)(69596002)(47776003)(36756003)(5008740100001)(53416004)(81156007)(86362001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1969; H:jerin.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1969; 23:sG6BQhadweMMIb/kU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?iKpIzjMqJUXhiHUsUA5s/i9qzh90o182iQBTozVfxzuYoAbQ8up6EofMIPDC?= =?us-ascii?Q?+eVHqL/08X0y0z7aUtporAiGmuYSFNI5yRQIbw77gGoLf9QClFxuqlpUXtEE?= =?us-ascii?Q?G3cA3Dwb0892DDt4z4kuDPBrkltodjrPdgnPHw501YRMGoF2+NhETP4NU1uA?= =?us-ascii?Q?TAjGN16xDTnGjuDFU4N4vUd9a+4Hnj0ekHJ9UNfsMcsHxu3x80axdD/RrHpY?= =?us-ascii?Q?HqFNlqWKcRE9vFuZMQRmveR3yzjVPvh4W?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1969; 5:4rzNRAbotWLZl+sqmOLh4JqBXARWRprBisHsaocTBp4k+iL2kOVvkFHMKzhtEHCIk0yYjp+CyD5ayWhOHiIUEoFWFDWdrMyojS6LVh1wUXbhO9tMpMyUkDYnu6G3gfOH8AdFBOPoF7X9fIeG+60K4Q==; 24:fv7FrUri4cl2wWPeUO1MmX7B6GQpFWS9rwpsX7U77/Nh3P6nzxskg+n9UnM9IJalGat/2rJfOOELz7JwKsV0cVVmGcZ+H83qzbA7Hlew7IU=; 20:PuqqthV2nCCAqxRWjQRm57xEJE0tVr7kkJBy6Xct/zD10PfXWvfRlkce0ElGhu2vMBQtcdvKYH/c3VAc7BJsaA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2015 09:41:19.9439 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1969 X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1587; 2:Z/Gq0JqgIVOMVri2qNqMfXixyEFML3bxSu/ZqkEVmkAbQ14HNi8llIBXGvOi7D55flngZMXHcpfanh20qKK8evm8h0rXlA1GNptRobByHN8q0xLfZc7WBW0RlONgBTsNPM73l91f1YKrz1rl+pIQeAl3fJHb3LTfCTIpD7OFDEc=; 23:EZVcrPmgs29xcf2piGazrXPLO7TM0F0qF+3Rph2DZ/lXfVw9utvXE1SNS8MckuFe2J7HrggHR0MEKubHoXe7vGXoWU+naFr0209qmCwMYt/iId0/kh4iaFiyZkQP+LC/KF62zi6bH91aU/12+QFmkK7ybqZbUiJEycIvvwB/Vi7EBECMqdez/s/7R4y+95Y+ X-OriginatorOrg: caviumnetworks.com Subject: [dpdk-dev] [PATCH v3 01/14] eal: arm64: add armv8-a version of rte_atomic_64.h X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2015 09:41:24 -0000 except rte_?wb() functions other functions are used from RTE_FORCE_INTRINSICS=y scheme Signed-off-by: Jerin Jacob --- .../common/include/arch/arm/rte_atomic.h | 4 + .../common/include/arch/arm/rte_atomic_64.h | 88 ++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 lib/librte_eal/common/include/arch/arm/rte_atomic_64.h diff --git a/lib/librte_eal/common/include/arch/arm/rte_atomic.h b/lib/librte_eal/common/include/arch/arm/rte_atomic.h index f4f5783..f3f3b6e 100644 --- a/lib/librte_eal/common/include/arch/arm/rte_atomic.h +++ b/lib/librte_eal/common/include/arch/arm/rte_atomic.h @@ -33,6 +33,10 @@ #ifndef _RTE_ATOMIC_ARM_H_ #define _RTE_ATOMIC_ARM_H_ +#ifdef RTE_ARCH_64 +#include +#else #include +#endif #endif /* _RTE_ATOMIC_ARM_H_ */ diff --git a/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h new file mode 100644 index 0000000..671caa7 --- /dev/null +++ b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h @@ -0,0 +1,88 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium networks Ltd. 2015. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _RTE_ATOMIC_ARM64_H_ +#define _RTE_ATOMIC_ARM64_H_ + +#ifndef RTE_FORCE_INTRINSICS +# error Platform must be built with CONFIG_RTE_FORCE_INTRINSICS +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include "generic/rte_atomic.h" + +#define dmb(opt) do { asm volatile("dmb " #opt : : : "memory"); } while (0) + +/** + * General memory barrier. + * + * Guarantees that the LOAD and STORE operations generated before the + * barrier occur before the LOAD and STORE operations generated after. + * This function is architecture dependent. + */ +static inline void rte_mb(void) +{ + dmb(ish); +} + +/** + * Write memory barrier. + * + * Guarantees that the STORE operations generated before the barrier + * occur before the STORE operations generated after. + * This function is architecture dependent. + */ +static inline void rte_wmb(void) +{ + dmb(ishst); +} + +/** + * Read memory barrier. + * + * Guarantees that the LOAD operations generated before the barrier + * occur before the LOAD operations generated after. + * This function is architecture dependent. + */ +static inline void rte_rmb(void) +{ + dmb(ishld); +} + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_ATOMIC_ARM64_H_ */ -- 1.9.3