From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0064.outbound.protection.outlook.com [104.47.41.64]) by dpdk.org (Postfix) with ESMTP id F0CA97CA9 for ; Tue, 4 Jul 2017 16:35:34 +0200 (CEST) Received: from BN6PR03CA0070.namprd03.prod.outlook.com (10.173.137.32) by BN1PR0301MB0595.namprd03.prod.outlook.com (10.160.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Tue, 4 Jul 2017 14:35:32 +0000 Received: from BL2FFO11FD052.protection.gbl (2a01:111:f400:7c09::157) by BN6PR03CA0070.outlook.office365.com (2603:10b6:404:4c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11 via Frontend Transport; Tue, 4 Jul 2017 14:35:32 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD052.mail.protection.outlook.com (10.173.161.214) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1199.9 via Frontend Transport; Tue, 4 Jul 2017 14:35:31 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v64EZM6l016426; Tue, 4 Jul 2017 07:35:29 -0700 From: Shreyansh Jain To: CC: , Date: Tue, 4 Jul 2017 20:13:54 +0530 Message-ID: <1499179471-19145-4-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> References: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131436525320542418; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39400400002)(39410400002)(39860400002)(39840400002)(39380400002)(39850400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(50986999)(6666003)(53936002)(8656002)(105606002)(6916009)(76176999)(2950100002)(8936002)(106466001)(38730400002)(33646002)(110136004)(2351001)(54906002)(81166006)(8676002)(48376002)(47776003)(2906002)(498600001)(50466002)(104016004)(50226002)(189998001)(305945005)(36756003)(356003)(626005)(86362001)(85426001)(5003940100001)(68736007)(69596002)(4326008)(5660300001)(575784001)(77096006)(2004002)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0595; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2FFO11FD052; 1:nHLO+hUpFAXL1SXTMs4Tfdt86T5FoEG1FqCZ1eILI4?= =?us-ascii?Q?NgdJMNsnXTRxmYPUbFuKy2Wn+OYc/4OEkm/oc/9WDOYJbFV0CQw4bmaMuLDD?= =?us-ascii?Q?HgLZG6V3YjQzMX2ivhfJbA4VwmSfgQfMtQu52vDcNe8Vrj8KPTsQl5rwT0Y6?= =?us-ascii?Q?xlfx/euQVBsjfn7l68gh1Wx/FGsQY6ogS4+jUeT46yWpms4cxanLH0oZ1Yt2?= =?us-ascii?Q?VIgjS/kYpOE6XjvnsDNJdPnaTUmEntOST4otWBnmabkc1zzaI8abxuP0JNpV?= =?us-ascii?Q?gz5Fh1iZXBQXOMKFW73n1hnIg/NZs9aDwVFydI8stHtoXPuPlSpglymrFU6W?= =?us-ascii?Q?5f2JDX8WHWg69RnJMEpaCgDpV062dOCpTnln1JJS9KkvitIlXak+te6oBXAu?= =?us-ascii?Q?AAnYj+Dxn/o7bAaPmSbPpDOsevDnHEWSEQ0q04+skRW05O2KM7A2E/cnWjd8?= =?us-ascii?Q?/1PzEhC0v9kgKxDx7F2UcMLwu+UgG2G/u/X2XR/azKGUGOpBTL2gsXpvA5+z?= =?us-ascii?Q?GT/9lqb3PTur6/KMNPkD9Xv/r+CVtSBKjDeUpUIZjYdU+XXWuZuy+0ZiI6gD?= =?us-ascii?Q?Rf0u0KS81AZUu/X2pYEqzTrPVJwIxCSEkyVmLNmvzZIkMjVlWM7p0j+7Q7zM?= =?us-ascii?Q?K2dHd5Cm/m3rmDYSXBJg+J44BnCJZZj4ODjMHt1lCplf3JM3oLCj081ouFL+?= =?us-ascii?Q?/9IlQieaUE2n7DY5VcaOEhIxPptCsVX2/PkhPa436HRK8M/0q/NQZWf5LSro?= =?us-ascii?Q?V+pndwJWBk68uYE6VAoJx5n/9lnux8O0sDmtmLXST8c+5zwVeBqSd0VCRs7S?= =?us-ascii?Q?kuVFAdC60GXOkrFHztfqfg4RGzBXBCz9nubGBxMXIrmQDRqCDkjSbfB4sIC8?= =?us-ascii?Q?a4tYV2CsSMNNS2dtmJVFTo/P1Pmks5YcpWOansQp3SPWa6RNSzHQncLHl8tj?= =?us-ascii?Q?qG6TnvpuRpbYml8FrzjwCTkQYEDbMBfzSxGYoReafhqzYCDydBWO6xe0JDs8?= =?us-ascii?Q?tYcou7FdEJZRZ3eSr9yBkbLbOxvp5iFCceFa77yaCiZAOzC6G80ltc9Xf13W?= =?us-ascii?Q?r7CXu82PJdF0t8qi8JW01bZ+pQ4LV5gAv5LC6p0Tah1Mj8oQ=3D=3D?= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: deaab27c-fcdb-42de-ac72-08d4c2e9ec9f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN1PR0301MB0595; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0595; 3:cCjhTQPW6pmt8xs0GquGiL9c5xxUKU+RxvxzKuibVu4b95x7pQHcnFyJUdy93qx605Q1L+Zcr6MWHFjYRkxgoTUii41mSLznLwIsCBAE5dn4p7LfSIpqT2SFDoSBIFs7O7chSpKHMc74u/T8RddbF0ZK04ISL0lIsqsXxl+2+cl4qlROVBoe753R9zdA4BxUY08HR7mkjY7cxsQoPeovO+bpXZVNC2/g7Q7draT0Hfqog8P/s3FrAIJO+Arm9JTXZDTKWg92QzHMInkDELUUXfYYSOcYwtDCN8j2IrjZHT8WXKsdYvTkwd+5APu+q9Xp2EGuDHn6CXJHHpKJqYEQw2EKS8M+eyt55V7PRzQJeGCoIvomMfAVkhNx1TuHF3IsBBWQCIcilbC1BlJ9exQmfHzuhZmWVBinhp9FhN0vMJl90D/pCaURhqZWSjVanVL9Est7T3SqNGn5+xpHYmWNgA3ZffULEKNX2ezIjjaJwtAh6+6di4xy9QVypsX5FIh+VwP8ccuJ9OG1apbBpfcaH8kIPx9e8R+PclGS3OT+j7zuHsmFCgZuuW1Zk/gWKwIALWdB1W3C2b+kF38jNUsxxx6HN9EDm3G1RBYGp+H2vQCVBLsloPsgc1Rg9cC04IX/A+b351xysxRSJ7j+tCcwx9R4ZJacN9oC2fPSsXR+o/y6ufivflLaVq/uJHE240eYbcM6dlnI2YfDSZiEf9PIjY75Wt7c/5K09YCx9G1ov7Nf8MKaCMG8cDkIubdsFMAYkT+t+Kks0A3rJXe6lQaA7X/Q1PMoulD1MDaWO56JKyS8GadfdbCiSip1i7a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/92jxm3I2XY= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0595; 31:7EJHelLMrM0D+R/P7p8OcAkFADA2/G7jMYkGGxmpN1OpBNcWJIpONp1Z4128JiWgxxQK7njxzkBiM7rp3yy7UqyytVbX9IbA72RXJ1sYhyfY+NwcS1A+qXNFa2gjaU2Y99AM4N/3KXyM9st1Gak4djgYpVwWKTg39MaNhla0fjtFgCYKeVF734aD87X0VESCh1V2R/E8wlfnMQr9xZzyf1c8q4SNkjY9hpMroBn9JkUOREqV60XAgBQO6tH97wzkAxI0vPvcFoOmTOFzj+zzkLf357B8kMbUTTFV6vuNDj544k1RfekkXUAZKw5cmi2XmK26jlRKFHZSm2IWi0Spd09ftjoKFLVuq8vwsVUMU3XEVQP8r6QHi5YKrNOgGGXVhipmwcZhioBTLQGPI/ThjyDxIgrFVndQ/Zp+Tjzh+9qG/VBF5CTKIDVi4k7ilw46m1cEVSLj51r3Yfh58KafeWUNDsgs43CRNvupahFaCjs/2gxxoMIaj3Q58/XyAvdZLsYDrwv8Z7X/uIC2qkwC7UAfPFFmKPflH2R37sEUfcnwnFl4bmGSpWeYqPEluavpJqJ+blBTZVl74Vi7w4subptekNp2NMjxw+39QgJBrMaz1QjGXEtCjC+oYv6/1C18q04fmgLq3nPU3chl1yh674HrtFXxlquQiTV9qxOW0jJoC0wNdMsmruuBMG+MNCEJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(185117386973197)(48057245064654)(148574349560750)(158140799945019); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6096035)(20161123559100)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123561025)(20161123565025)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN1PR0301MB0595; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN1PR0301MB0595; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0595; 4:OBhicpPLHfNkMuFsxECzcqP5SaZi4FChC/5e5SIo?= =?us-ascii?Q?EYPEQzGV8/TMgZ55H5Kyr44YbnBwLWOKFB0nIySqta4SUZWfWp0hxpMpuF81?= =?us-ascii?Q?9C2LLmdOp0g2XHsOl/rhsI4llWsEfA9BBI1ItKESfbCp5YOO8SJK3YKHW7Le?= =?us-ascii?Q?asKpLqOs6ORg0PdiCMZGbFZvWcrB59ox2Hg90gCJ2zFkuX3UrQRLtXnY24bH?= =?us-ascii?Q?wNp3PK41ZM3nI9+TgHJQttkb0DzWP/lfU6bBtJNrQJKD4HWn7PbFqvFsmCVZ?= =?us-ascii?Q?5diDdgy79gJrGh4KJ7K81xUGIab2IH03h09gsXqSAPlg9EQE3uHY8I4DoUnk?= =?us-ascii?Q?VdBUCNN/yZSlj+TTfJHD+dRultW2pnZGRmA6C2gatw3nyfaVOo1FJhhHEPZo?= =?us-ascii?Q?17zYnhWabd9ac3SEqVVDFa8qt/00l8hpCpm2Z3SZgG6WgwFSAAxF1y0J3HYi?= =?us-ascii?Q?VdSNy03YMxWFD7kpeceFMsjx9P8lat5Ar1w+aMULvca3XN4104jKHwrV74/j?= =?us-ascii?Q?Yilh3fKCDN0DtDEiUCKB7JsebDnvP7D01Pyt3+31k1SFwPEhSmLBY05wCRxS?= =?us-ascii?Q?Kfvru+5Ymp7TomphzO7B83gHiluoujINLr+QVaXVvUGSXzXuLGebblrX9Was?= =?us-ascii?Q?LO3awfJVCVqWqTiRf+sIIeQ0l6txNr8UMWyb5mZQtbrH2ZCAcCrFRJ6s8TC2?= =?us-ascii?Q?+zvzqGjXl0ZycQYm5/FmPRdQAA/BvQzXBIBvKi0b2Yy2Rws+W3yZUYSM7GMp?= =?us-ascii?Q?kgt3MC6rgD9RlJvrjF2fVkVK1gLkqTy8YN3ARQgdFdic0qnJ0FzZgSY3KZxV?= =?us-ascii?Q?BFEOj6wRJwhsbH86HXeEZf7x7ypw9cQcowm68ME4HnHd97pVb9F+rUa2j66/?= =?us-ascii?Q?hXRB6lNpOJI/tloPb8wmNVCis+bm+ApzVYdYuUaSx1oYmqn+sDxEjd++rU64?= =?us-ascii?Q?V3faejiMFeZkROcUrGRdX5kCHRqRVcidTDean4ar/I5pvtACnRb21KAUP4aC?= =?us-ascii?Q?B7NPfA9zP9uX2ZMTE+zF3xqheaBzT3itLN9858WRXvXEkK66d3vaiWZTRTZ5?= =?us-ascii?Q?ZZDqG7DCz9lN+mNN7HgBqUhJi5Ki/ARt8YEhmWP7GO8DW+mCLBK4GK0w1lz2?= =?us-ascii?Q?KANo776L1hd24JQilsdE3i9JoHPuaPD26N3dOpntBHRN29p4MoRQXcmpxSA5?= =?us-ascii?Q?YMjegEkPsmGEeSA4Hv79z2Xz2Qq5G8Hx13j3btybfHZewxhFubZ+8gcy+mrr?= =?us-ascii?Q?iHEAQ2HAmJuTDpThHTDgvHur9DzQShe3qk6r0duYtQygmH3p6SKXMxWXjqBz?= =?us-ascii?Q?TBdVXnMxshz+yU6LKwJLXFVa6SFA1v7rFTl7x9fhJMQB4TIzD4fSMnU0UZ1y?= =?us-ascii?Q?w6Cz0HuwHAI1xdifLJgEZW82B97B9IwDgEnQVF/rmfabLnI2?= X-Forefront-PRVS: 0358535363 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0595; 23:97ucYJoiyZC6KiHb1aK/HBjiWSUeUerZyE1UE/u?= =?us-ascii?Q?+heqBQC5K90KTYPAFBKm6knppAtoNLPGJ71/HS7fjbD2nwy9KsCPez/y5FYk?= =?us-ascii?Q?lrpWSuUif6OPaC6t+p65Vba5lxOtDAt4Vgtp7j9wwPZgq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2W3SzpV2d/qPMWKEqE0y84hL13qIepfMQ21qz4bj+/C9uP0qwE6ipLTuCpW4tRKU0aqo= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2017 14:35:31.6798 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0595 Subject: [dpdk-dev] [PATCH v2 03/40] bus/dpaa: add compatibility and helper macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jul 2017 14:35:35 -0000 From: Hemant Agrawal Linked list, bit operations and compatibility macros. Signed-off-by: Geoff Thorpe Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/include/compat.h | 383 +++++++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/dpaa_bits.h | 65 ++++++ drivers/bus/dpaa/include/dpaa_list.h | 101 +++++++++ 3 files changed, 549 insertions(+) create mode 100644 drivers/bus/dpaa/include/compat.h create mode 100644 drivers/bus/dpaa/include/dpaa_bits.h create mode 100644 drivers/bus/dpaa/include/dpaa_list.h diff --git a/drivers/bus/dpaa/include/compat.h b/drivers/bus/dpaa/include/compat.h new file mode 100644 index 0000000..3d46232 --- /dev/null +++ b/drivers/bus/dpaa/include/compat.h @@ -0,0 +1,383 @@ +/*- + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * BSD LICENSE + * + * Copyright 2011 Freescale Semiconductor, Inc. + * All rights reserved. + * + * 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 the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * GPL LICENSE SUMMARY + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * 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 HOLDERS 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 __COMPAT_H +#define __COMPAT_H + +#include + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* The following definitions are primarily to allow the single-source driver + * interfaces to be included by arbitrary program code. Ie. for interfaces that + * are also available in kernel-space, these definitions provide compatibility + * with certain attributes and types used in those interfaces. + */ + +/* Required compiler attributes */ +#define __maybe_unused __rte_unused +#define __always_unused __rte_unused +#define __packed __rte_packed +#define noinline __attribute__((noinline)) + +#define L1_CACHE_BYTES 64 +#define ____cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES))) +#define __stringify_1(x) #x +#define __stringify(x) __stringify_1(x) + +#ifdef ARRAY_SIZE +#undef ARRAY_SIZE +#endif +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + +/* Debugging */ +#define prflush(fmt, args...) \ + do { \ + printf(fmt, ##args); \ + fflush(stdout); \ + } while (0) + +#define pr_crit(fmt, args...) prflush("CRIT:" fmt, ##args) +#define pr_err(fmt, args...) prflush("ERR:" fmt, ##args) +#define pr_warn(fmt, args...) prflush("WARN:" fmt, ##args) +#define pr_info(fmt, args...) prflush(fmt, ##args) + +#define ASSERT(x) do {\ + if (!(x)) \ + rte_panic("DPAA: x"); \ +} while (0) +#define BUG_ON(x) ASSERT(!(x)) + +/* Required types */ +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; +typedef uint64_t dma_addr_t; +typedef cpu_set_t cpumask_t; +typedef uint32_t phandle; +typedef uint32_t gfp_t; +typedef uint32_t irqreturn_t; + +#define IRQ_HANDLED 0 +#define request_irq qbman_request_irq +#define free_irq qbman_free_irq + +#define __iomem +#define GFP_KERNEL 0 +#define __raw_readb(p) (*(const volatile unsigned char *)(p)) +#define __raw_readl(p) (*(const volatile unsigned int *)(p)) +#define __raw_writel(v, p) {*(volatile unsigned int *)(p) = (v); } + +/* SMP stuff */ +#define DEFINE_PER_CPU(t, x) __thread t per_cpu__##x +#define get_cpu_var(x) per_cpu__##x +/* to be used as an upper-limit only */ +#define NR_CPUS 64 + +/* Waitqueue stuff */ +typedef struct { } wait_queue_head_t; +#define DECLARE_WAIT_QUEUE_HEAD(x) int dummy_##x __always_unused +#define wake_up(x) do { } while (0) + +/* I/O operations */ +static inline u32 in_be32(volatile void *__p) +{ + volatile u32 *p = __p; + return rte_be_to_cpu_32(*p); +} + +static inline void out_be32(volatile void *__p, u32 val) +{ + volatile u32 *p = __p; + *p = rte_cpu_to_be_32(val); +} + +#define dcbt_ro(p) __builtin_prefetch(p, 0) +#define dcbt_rw(p) __builtin_prefetch(p, 1) + +#define dcbz(p) { asm volatile("dc zva, %0" : : "r" (p) : "memory"); } +#define dcbz_64(p) dcbz(p) +#define hwsync() rte_rmb() +#define lwsync() rte_wmb() +#define dcbf(p) { asm volatile("dc cvac, %0" : : "r"(p) : "memory"); } +#define dcbf_64(p) dcbf(p) +#define dccivac(p) { asm volatile("dc civac, %0" : : "r"(p) : "memory"); } + +#define dcbit_ro(p) \ + do { \ + dccivac(p); \ + asm volatile("prfm pldl1keep, [%0, #64]" : : "r" (p)); \ + } while (0) + +#define barrier() { asm volatile ("" : : : "memory"); } +#define cpu_relax barrier + +static inline uint64_t mfatb(void) +{ + uint64_t ret, ret_new, timeout = 200; + + asm volatile ("mrs %0, cntvct_el0" : "=r" (ret)); + asm volatile ("mrs %0, cntvct_el0" : "=r" (ret_new)); + while (ret != ret_new && timeout--) { + ret = ret_new; + asm volatile ("mrs %0, cntvct_el0" : "=r" (ret_new)); + } + BUG_ON(!timeout && (ret != ret_new)); + return ret * 64; +} + +/* Spin for a few cycles without bothering the bus */ +static inline void cpu_spin(int cycles) +{ + uint64_t now = mfatb(); + + while (mfatb() < (now + cycles)) + ; +} + +/* Qman/Bman API inlines and macros; */ +#ifdef lower_32_bits +#undef lower_32_bits +#endif +#define lower_32_bits(x) ((u32)(x)) + +#ifdef upper_32_bits +#undef upper_32_bits +#endif +#define upper_32_bits(x) ((u32)(((x) >> 16) >> 16)) + +/* + * Swap bytes of a 48-bit value. + */ +static inline uint64_t +__bswap_48(uint64_t x) +{ + return ((x & 0x0000000000ffULL) << 40) | + ((x & 0x00000000ff00ULL) << 24) | + ((x & 0x000000ff0000ULL) << 8) | + ((x & 0x0000ff000000ULL) >> 8) | + ((x & 0x00ff00000000ULL) >> 24) | + ((x & 0xff0000000000ULL) >> 40); +} + +/* + * Swap bytes of a 40-bit value. + */ +static inline uint64_t +__bswap_40(uint64_t x) +{ + return ((x & 0x00000000ffULL) << 32) | + ((x & 0x000000ff00ULL) << 16) | + ((x & 0x0000ff0000ULL)) | + ((x & 0x00ff000000ULL) >> 16) | + ((x & 0xff00000000ULL) >> 32); +} + +/* + * Swap bytes of a 24-bit value. + */ +static inline uint32_t +__bswap_24(uint32_t x) +{ + return ((x & 0x0000ffULL) << 16) | + ((x & 0x00ff00ULL)) | + ((x & 0xff0000ULL) >> 16); +} + +#define be64_to_cpu(x) rte_be_to_cpu_64(x) +#define be32_to_cpu(x) rte_be_to_cpu_32(x) +#define be16_to_cpu(x) rte_be_to_cpu_16(x) + +#define cpu_to_be64(x) rte_cpu_to_be_64(x) +#define cpu_to_be32(x) rte_cpu_to_be_32(x) +#define cpu_to_be16(x) rte_cpu_to_be_16(x) + +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + +#define cpu_to_be48(x) __bswap_48(x) +#define be48_to_cpu(x) __bswap_48(x) + +#define cpu_to_be40(x) __bswap_40(x) +#define be40_to_cpu(x) __bswap_40(x) + +#define cpu_to_be24(x) __bswap_24(x) +#define be24_to_cpu(x) __bswap_24(x) + +#else /* RTE_BIG_ENDIAN */ + +#define cpu_to_be48(x) (x) +#define be48_to_cpu(x) (x) + +#define cpu_to_be40(x) (x) +#define be40_to_cpu(x) (x) + +#define cpu_to_be24(x) (x) +#define be24_to_cpu(x) (x) + +#endif /* RTE_BIG_ENDIAN */ + +/* When copying aligned words or shorts, try to avoid memcpy() */ +/* memcpy() stuff - when you know alignments in advance */ +#define CONFIG_TRY_BETTER_MEMCPY + +#ifdef CONFIG_TRY_BETTER_MEMCPY +static inline void copy_words(void *dest, const void *src, size_t sz) +{ + u32 *__dest = dest; + const u32 *__src = src; + size_t __sz = sz >> 2; + + BUG_ON((unsigned long)dest & 0x3); + BUG_ON((unsigned long)src & 0x3); + BUG_ON(sz & 0x3); + while (__sz--) + *(__dest++) = *(__src++); +} + +static inline void copy_shorts(void *dest, const void *src, size_t sz) +{ + u16 *__dest = dest; + const u16 *__src = src; + size_t __sz = sz >> 1; + + BUG_ON((unsigned long)dest & 0x1); + BUG_ON((unsigned long)src & 0x1); + BUG_ON(sz & 0x1); + while (__sz--) + *(__dest++) = *(__src++); +} + +static inline void copy_bytes(void *dest, const void *src, size_t sz) +{ + u8 *__dest = dest; + const u8 *__src = src; + + while (sz--) + *(__dest++) = *(__src++); +} +#else +#define copy_words memcpy +#define copy_shorts memcpy +#define copy_bytes memcpy +#endif + +/* Allocator stuff */ +#define kmalloc(sz, t) malloc(sz) +#define vmalloc(sz) malloc(sz) +#define kfree(p) { if (p) free(p); } +static inline void *kzalloc(size_t sz, gfp_t __foo __rte_unused) +{ + void *ptr = malloc(sz); + + if (ptr) + memset(ptr, 0, sz); + return ptr; +} + +static inline unsigned long get_zeroed_page(gfp_t __foo __rte_unused) +{ + void *p; + + if (posix_memalign(&p, 4096, 4096)) + return 0; + memset(p, 0, 4096); + return (unsigned long)p; +} + +/* Spinlock stuff */ +#define spinlock_t rte_spinlock_t +#define __SPIN_LOCK_UNLOCKED(x) RTE_SPINLOCK_INITIALIZER +#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) +#define spin_lock_init(x) rte_spinlock_init(x) +#define spin_lock_destroy(x) +#define spin_lock(x) rte_spinlock_lock(x) +#define spin_unlock(x) rte_spinlock_unlock(x) +#define spin_lock_irq(x) spin_lock(x) +#define spin_unlock_irq(x) spin_unlock(x) +#define spin_lock_irqsave(x, f) spin_lock_irq(x) +#define spin_unlock_irqrestore(x, f) spin_unlock_irq(x) + +#define atomic_t rte_atomic32_t +#define atomic_read(v) rte_atomic32_read(v) +#define atomic_set(v, i) rte_atomic32_set(v, i) + +#define atomic_inc(v) rte_atomic32_add(v, 1) +#define atomic_dec(v) rte_atomic32_sub(v, 1) + +#define atomic_inc_and_test(v) rte_atomic32_inc_and_test(v) +#define atomic_dec_and_test(v) rte_atomic32_dec_and_test(v) + +#define atomic_inc_return(v) rte_atomic32_add_return(v, 1) +#define atomic_dec_return(v) rte_atomic32_sub_return(v, 1) +#define atomic_sub_and_test(i, v) (rte_atomic32_sub_return(v, i) == 0) + +#include +#include + +#endif /* __COMPAT_H */ diff --git a/drivers/bus/dpaa/include/dpaa_bits.h b/drivers/bus/dpaa/include/dpaa_bits.h new file mode 100644 index 0000000..e29019b --- /dev/null +++ b/drivers/bus/dpaa/include/dpaa_bits.h @@ -0,0 +1,65 @@ +/*- + * BSD LICENSE + * + * Copyright 2017 NXP. All rights reserved. + * + * 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 NXP 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 __DPAA_BITS_H +#define __DPAA_BITS_H + +/* Bitfield stuff. */ +#define BITS_PER_ULONG (sizeof(unsigned long) << 3) +#define SHIFT_PER_ULONG (((1 << 5) == BITS_PER_ULONG) ? 5 : 6) +#define BITS_MASK(idx) (1UL << ((idx) & (BITS_PER_ULONG - 1))) +#define BITS_IDX(idx) ((idx) >> SHIFT_PER_ULONG) + +static inline void dpaa_set_bits(unsigned long mask, + volatile unsigned long *p) +{ + *p |= mask; +} + +static inline void dpaa_set_bit(int idx, volatile unsigned long *bits) +{ + dpaa_set_bits(BITS_MASK(idx), bits + BITS_IDX(idx)); +} + +static inline void dpaa_clear_bits(unsigned long mask, + volatile unsigned long *p) +{ + *p &= ~mask; +} + +static inline void dpaa_clear_bit(int idx, + volatile unsigned long *bits) +{ + dpaa_clear_bits(BITS_MASK(idx), bits + BITS_IDX(idx)); +} + +#endif /* __DPAA_BITS_H */ diff --git a/drivers/bus/dpaa/include/dpaa_list.h b/drivers/bus/dpaa/include/dpaa_list.h new file mode 100644 index 0000000..7ad0f14 --- /dev/null +++ b/drivers/bus/dpaa/include/dpaa_list.h @@ -0,0 +1,101 @@ +/*- + * BSD LICENSE + * + * Copyright 2017 NXP. All rights reserved. + * + * 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 NXP 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 __DPAA_LIST_H +#define __DPAA_LIST_H + +/****************/ +/* Linked-lists */ +/****************/ + +struct list_head { + struct list_head *prev; + struct list_head *next; +}; + +#define COMPAT_LIST_HEAD(n) \ +struct list_head n = { \ + .prev = &n, \ + .next = &n \ +} + +#define INIT_LIST_HEAD(p) \ +do { \ + struct list_head *__p298 = (p); \ + __p298->next = __p298; \ + __p298->prev = __p298->next; \ +} while (0) +#define list_entry(node, type, member) \ + (type *)((void *)node - offsetof(type, member)) +#define list_empty(p) \ +({ \ + const struct list_head *__p298 = (p); \ + ((__p298->next == __p298) && (__p298->prev == __p298)); \ +}) +#define list_add(p, l) \ +do { \ + struct list_head *__p298 = (p); \ + struct list_head *__l298 = (l); \ + __p298->next = __l298->next; \ + __p298->prev = __l298; \ + __l298->next->prev = __p298; \ + __l298->next = __p298; \ +} while (0) +#define list_add_tail(p, l) \ +do { \ + struct list_head *__p298 = (p); \ + struct list_head *__l298 = (l); \ + __p298->prev = __l298->prev; \ + __p298->next = __l298; \ + __l298->prev->next = __p298; \ + __l298->prev = __p298; \ +} while (0) +#define list_for_each(i, l) \ + for (i = (l)->next; i != (l); i = i->next) +#define list_for_each_safe(i, j, l) \ + for (i = (l)->next, j = i->next; i != (l); \ + i = j, j = i->next) +#define list_for_each_entry(i, l, name) \ + for (i = list_entry((l)->next, typeof(*i), name); &i->name != (l); \ + i = list_entry(i->name.next, typeof(*i), name)) +#define list_for_each_entry_safe(i, j, l, name) \ + for (i = list_entry((l)->next, typeof(*i), name), \ + j = list_entry(i->name.next, typeof(*j), name); \ + &i->name != (l); \ + i = j, j = list_entry(j->name.next, typeof(*j), name)) +#define list_del(i) \ +do { \ + (i)->next->prev = (i)->prev; \ + (i)->prev->next = (i)->next; \ +} while (0) + +#endif /* __DPAA_LIST_H */ -- 2.7.4