From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0057.outbound.protection.outlook.com [104.47.32.57]) by dpdk.org (Postfix) with ESMTP id 20DF67CB5 for ; Fri, 16 Jun 2017 07:32:45 +0200 (CEST) Received: from CY1PR03CA0011.namprd03.prod.outlook.com (10.174.128.21) by CY1PR0301MB1194.namprd03.prod.outlook.com (10.160.165.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Fri, 16 Jun 2017 05:32:43 +0000 Received: from BN1BFFO11FD025.protection.gbl (2a01:111:f400:7c10::1:169) by CY1PR03CA0011.outlook.office365.com (2603:10b6:600::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14 via Frontend Transport; Fri, 16 Jun 2017 05:32:43 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) 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.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD025.mail.protection.outlook.com (10.58.144.88) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1157.12 via Frontend Transport; Fri, 16 Jun 2017 05:32:43 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v5G5WNF8001003; Thu, 15 Jun 2017 22:32:41 -0700 From: Shreyansh Jain To: CC: , Date: Fri, 16 Jun 2017 11:10:39 +0530 Message-ID: <1497591668-3320-10-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> References: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131420647635135545; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39410400002)(39450400003)(39840400002)(39400400002)(39850400002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(104016004)(2950100002)(8656002)(6916009)(36756003)(305945005)(53936002)(189998001)(110136004)(38730400002)(77096006)(4326008)(85426001)(5003940100001)(86362001)(76176999)(50986999)(8676002)(356003)(81166006)(47776003)(106466001)(50466002)(498600001)(2351001)(50226002)(33646002)(54906002)(105606002)(5660300001)(48376002)(8936002)(2906002)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB1194; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1BFFO11FD025; 1:DqHW/fmpg899UACidgqzbf61rFE6vVtmEA06r2CuP?= =?us-ascii?Q?xXAOl2MoaeeWOXr0lIY+7zbC9/fcJvgeQJvCVIrBoU1umdG5yLec5VKBKd7F?= =?us-ascii?Q?6yYz3TaWWFzlRf6FwUWo1k3+v6qqWF1/j68nbAENCby77Gi+hCOWQon0Pnww?= =?us-ascii?Q?W1cqdQQI3ueIV6nJKuodgHwPDb1OlVzrLhtrnlUxsCuI2qcWjadCc83Te8Nd?= =?us-ascii?Q?wyXZEss1panRoQovZa9X91m9sEsUTOYrJjrjkBhPonylS0pijNvoim5PKvCg?= =?us-ascii?Q?0ceq2J79qCsNLuEItgPEdbP9UlwIDNQJpi9UNx8F4SmLaFgnweNIPKb9x36s?= =?us-ascii?Q?+M9nSCeG5LLDkBSjG6OcEvqFZCdfrGgJlFbWBj6QDpdtbv5WSTtqMICrfsh7?= =?us-ascii?Q?43nhmCvi5+xV1Kdm3sxUTLWKF5d9oIw5rsoQ8zb4QiN6sbI1RprowhYbWXv8?= =?us-ascii?Q?6ZgYFQ2VfXaL12L85nozkHWdgZL0gRfVo/6Ofi+GxAsZElYbu18C+drN+k7r?= =?us-ascii?Q?dDn34WOUa05AdOAPYeStAI2pleusFRQkqqlvLXgCh2ne+hYwbm19Nau2MhrA?= =?us-ascii?Q?NxYBAI43r5wgDieeueZR2bueTxwlBrpEmNzmOFOZDxnf4Zj9mBfaYCymEchZ?= =?us-ascii?Q?zdjg9bn6h7SiG+XL2R2F35Msluz1mZDfL/2a2shfxnPJjmZVM4te09NI27SN?= =?us-ascii?Q?WjZ+OPjzvQksHu+qszuFm5wKmv7izDx45hPbpa5v5kYpor38eahyaEcSFDsS?= =?us-ascii?Q?7ShylI9S42CcpYEL6BbxePSHVZ01VCyLI82U4oBJ+q4LQz387TEKPk/Il9Pd?= =?us-ascii?Q?H+rIFjIJgZQLl2fKnpv14AMfHQcFHAddVnhzy6+YXg1hdSQqhy8P87Hu2YGc?= =?us-ascii?Q?QgbQGIEWnnn456VY5/IOkUZ9ESpYhyTXxAT8y0H5dJSse9WDaYyY17b9/hPk?= =?us-ascii?Q?OM1RO/smTtDxxardbjszUD5U1HZZr9N8RC3OK9vOUefP5WGxXcF9Db5YtbBf?= =?us-ascii?Q?nMH36Tcq01mMFK8GvoR9rrtpn/psDAqwik7FtqWabERp45YBw2uqnRcUWSln?= =?us-ascii?Q?5j7eFoWzGJlonSkB2ea0VofuP9rqEbyMZ2EWpusSjQRvJ/4SA=3D=3D?= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0301MB1194: X-MS-Office365-Filtering-Correlation-Id: 733b4f33-dbdf-435b-ac39-08d4b4791ce8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:CY1PR0301MB1194; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1194; 3:plSzPAd2X9XxonTNKFjlSboLtgW0rTxttaOPBNYIrPF2jrh6HpKbodikm4YXoqji+jtIFL1wS2pKkL+3dwnuiBsuZhq12/RG4O2VcoZgPd9KYAMKIl8/aOanuhZdDcXiyE9xuZMUql/Ycy7Md4nrVEdPRqf+9LoxV0O8dkW2q/u9AzcwL4F9SW5sgDzzBawGF8JAgqQRwBLpirAyFeDIhNQUCeeeH4JC8hxxHLhWjFpRqpHhlXbF4ffoncFpHypllS9l0q9ri9/njLqXZpgZt82K+asBbc5S29Nd5v3RkbQNzv7bKBGm6/k1z3TyU8SWCzFY0+DB/SWKBzbZIZ+nyCIseGXE2tThyMIxPJNlaeMB6iudbvDLJKdBly4SdyhVXiGUX41JK2oCkXgirGeE+qkXWb7djsGCOWwaGtJ1sIoU4w745RICrRhy5aDNd2if; 25:jWEi1sFN3QjjB5F4D9jrUu8jPBs2be550BO9CQxCEIwB/3Aavx7bcO9Z3eNASOalfZ0ms+ICGtbOJhwgnDYu9YrkrKMU/N0GXPBJOrCTyXAZ3DNepVR9tOj6XNoHd1kBXFzgVI1sdAw0vqumRAToh9cr76SsL91JnpWYhK/Cmwa2n23z6XiY46VOGXBaw6JkWAHcW9EFH+L2OkXquuJl1t7QTpOVDom60sfgz4kb6IDL99kbnVzxYuCHvQ0qfFsvZtbuFY5pzZlT221KuFa3JEhWkpsLJxzi53Yvsmrj09CbogsK78XXp4G1l825gYVpCTDH7vZ6ThJJ2lw/6zkst1tp3S2tBj1xM8C3PasRZvOBdscnjrb1/t0NirUbiSy7Ak3HQQh7A8lo16TI1qSIIC0SJBu8caC8ChBDQ5jA8tpKBcHYJtxH0cVyr4Qr6qXph7h98IcRG3DczBj7EreDsUTEHWqDCIBKOa3pUfGOriA= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1194; 31:rSaAVxeBBXejoE9u7d3Ot7mVoN0aTZhsmJjWGmo97F4RBjzaxn61TJJZWy0fLlaNgoIalGv4jwe2xs8YNskF54m4fJmJvPG5aP/nGIP2cT4yRKc8RmiSRw/Q/vVdV1mXxs0ScCUKU/1aqCczfb75dD9zBc/hM24bzPPgUnsiUGwhCGqsw4+s372Y9Zki5qt8nlPc1sl85ekN0enEK/6Zw+vYnqM5iA8TiNE/G9bTfFcsqTttsJVKIIHDAdS8VNNg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123556025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123563025)(20161123559100)(20161123561025)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0301MB1194; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0301MB1194; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1194; 4:WJFtQXOLi1vwd7CmpmhWxV6g7Sj85ndxoLRxqdZX?= =?us-ascii?Q?TAhIF9ykzjKDjaNuTm2kS92qe1Kof5kqwMu12EkqPSs7jQ6dzoqozGfXk8KS?= =?us-ascii?Q?shw/7yNcyIRGZRhYg8x9DzFCls/RxwQS3HHsGm2lCoNd+haF7mdy7zd00A4t?= =?us-ascii?Q?Rn/bRabUxSc8Pj/asHOBh9HhCbxswN++6mXfdzOfsKmr4Jp0Fgz+uWsZUi19?= =?us-ascii?Q?C8GppX47beGIZlrA9u6YhE/o4liXHrgkN/4ajdgbH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y5QD6rJgh+WSnXuYJqg0O01Ixjlv2jBRpxI+1MsxyS7pbNY7Np?= =?us-ascii?Q?K0tHqo1qdibj6z5WukodccFAG1slT9IvP4Y6NEZnrfiNYZGBf4+wIuEgxXQq?= =?us-ascii?Q?0otBSYdYUWovG5OfgOTBrwZ5nNMJ0xaS7pq+F+n2?= X-Forefront-PRVS: 0340850FCD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1194; 23:3DfcGYqM9BY/GmNAzCP6GGFX9EUP5dxfx8lIe2o?= =?us-ascii?Q?1xTfPF5wioczNuxR2Ef486GCKfmKxjPaQ+XOxoX7+caH1Pmp5UmoayUo4oVf?= =?us-ascii?Q?U+o5GjSEWo3OwC3kUL9v16KHahZl/IjdUJ/3XL80Az933gugEvV5ss55V7Oo?= =?us-ascii?Q?6eZioUm8mDkU1ypnTXidlIfeIAzd0TRxx64dJgz/giwCXq46TnslqawcsT/8?= =?us-ascii?Q?R4VwVNIh2wUSVm0mwt7fGyiCF2yHmTRJcXjiljeniH+4pbLXLOfzXge1JB9J?= =?us-ascii?Q?9nuipoGoKL/Mmuyk+RYrY+N84p4IEJVtWEBumHDNSldWluCVHRWUI9t+Xp3u?= =?us-ascii?Q?+oy3OvEu4519iu6rKnT4dV8Ec4REW848I+zK1tLooS0tVHyKwCdeqbSJAAyB?= =?us-ascii?Q?VSeAQ9mpAhqQQitAyyGEWEBHd8SgBAE7jvUNOU71XT02mCjZFdsuYKBy6/6w?= =?us-ascii?Q?d8Gf+zuU+9SxHAMD7dWdWS7ZFELaYxMT79kTRH/RSgrU2Nq9z2PovmriI87k?= =?us-ascii?Q?h+RIM4+6KltqT1nXeSEc3nNJ/sdQuS1kx/VK05eWVtaGjShVagNbGA6g2Tvm?= =?us-ascii?Q?nIvxrcjgNt6sjN5VJ2MCpnRQdIxBaFtxSzWGVAi4Hi8zBFbSMHibp9qVt3dx?= =?us-ascii?Q?X6Y/r1X7aW9rnrASejmjBpNvoRUQwXuP+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uImkIacwLl2ohgdXa1K7o2xqxjKDRS/pMkljbmy5/K6x+ZH5eiyHwwSYvOMI1NCI7UEhVoHsujAbJAvBf/9GJfFHN1TpHZxPS8UqrEKV4jqsb6iIKwjok04B5UroFtOjKkcQVVpeD345OymWPZu5kAZE2DYaNa5OlTRdCpb0Lsx9ETq0UL850rNQIxs8XSE6q3pZGx2eFkWrdzoNAx3/v+BAQA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1194; 5:1vOXAdoRjkUH6xcT3GIfKUDHA1F8x0j9MV6WvjWc9nOsRcFBHEbJruCPnYq7v39g9Hf/D+lmLN6jCvTu2EqzYf3K8LCPAafz/Vtt/DknTba4r9N/6HmdAY5cxH3k67YN1HTccqTItvfhUAZU96h/qcUfQVqpKzNBaGWKPvR6vfmjbUvcLhKoutG4SaHNyPy31cCliyyI6FVHL//cjJZYHgED/iD/jDrkr0oVF8EAENGiZwUKK+ZGKgs6U1y1N5S4iexYTThpHQp5a46JLOfa+YC8LBfzm05KkatXSLnXJoQ3CR64eeogiJ07jSdJqBa31t3Nik9OLclWoiIZh0BKtYMzAbGxFyjTMWX9G3mYFaZskMHGxTtTSf9bl/fT/blqG0xTuJYswePjTxTps5CUuaA8Zk0aCj3xih5EqJQnGD2FTb+TLr2Bcl/y5woR9RUQwAcXDYz7U5eJapMgYQ7z6cuPxFVlVVzgfTK70dSNt+N+slT3pGERnQtqit+v5UQ0gL7Zx/LhcVuPpAwo6ftkow==; 24:bonbYh46MhXhNnbtIAtLZcGAJefGNQ2plQY1cBPslK8EsgCKAmVsn10cJhm903tY1TxwzHK/kp1WNnd+aVstwdZbshTKmo0/7v2LS8+WCws= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1194; 7:AfqKVzCjb64nJByWqiq1hvRSnM/rIcQdlv2KMuqvYj+R7nzrj7hjk7nPvvtOl9GWHBiLKCJe6WI8JFLn51dLhyqaHOtfI951F4IOxJOy8BH4V+JGjInQQPZ+6LEmjtvc114EJd6JZiKEtYofRDBchJBiSq2v4vSk6jIpQQhWCjXXIMSbgPQ/psdsLB+XlSC5cJweoatLMSkC02fwARaR0upxIdhPJd56KeDCfQbW+tz84HZwwYWrTEQqzcc83PdYjf2QLMKVrFnOLDBz1PgbuSnjTiEJ1P8hAEVPYml7HHlxL0j7SaTvfw/Nvn3rD7gWeUzb3zAM9bBRIo55Vy6XrQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 05:32:43.3263 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1194 Subject: [dpdk-dev] [PATCH 09/38] bus/dpaa: add layer for interrupt emulation using pthread 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: Fri, 16 Jun 2017 05:32:46 -0000 An interrupt manager is implemented by emulating over pthreads. Handlers are registered by QBMAN layer for being notified about any interrupt request from DPAA blocks in userspace. Signed-off-by: Roy Pledge Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- drivers/bus/dpaa/Makefile | 3 +- drivers/bus/dpaa/base/qbman/dpaa_sys.c | 136 +++++++++++++++++++++++++++++++++ drivers/bus/dpaa/base/qbman/dpaa_sys.h | 65 ++++++++++++++++ 3 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 drivers/bus/dpaa/base/qbman/dpaa_sys.c create mode 100644 drivers/bus/dpaa/base/qbman/dpaa_sys.h diff --git a/drivers/bus/dpaa/Makefile b/drivers/bus/dpaa/Makefile index 22218e2..193ffc1 100644 --- a/drivers/bus/dpaa/Makefile +++ b/drivers/bus/dpaa/Makefile @@ -70,6 +70,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \ base/fman/fman_hw.c \ base/fman/of.c \ base/fman/netcfg_layer.c \ - base/qbman/process.c + base/qbman/process.c \ + base/qbman/dpaa_sys.c include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/bus/dpaa/base/qbman/dpaa_sys.c b/drivers/bus/dpaa/base/qbman/dpaa_sys.c new file mode 100644 index 0000000..0017da5 --- /dev/null +++ b/drivers/bus/dpaa/base/qbman/dpaa_sys.c @@ -0,0 +1,136 @@ +/*- + * 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 2013-2016 Freescale Semiconductor Inc. + * Copyright 2017 NXP. + * + * 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. + */ + +#include +#include "dpaa_sys.h" + +struct process_interrupt { + int irq; + irqreturn_t (*isr)(int irq, void *arg); + unsigned long flags; + const char *name; + void *arg; + struct list_head node; +}; + +static COMPAT_LIST_HEAD(process_irq_list); +static pthread_mutex_t process_irq_lock = PTHREAD_MUTEX_INITIALIZER; + +static void process_interrupt_install(struct process_interrupt *irq) +{ + int ret; + /* Add the irq to the end of the list */ + ret = pthread_mutex_lock(&process_irq_lock); + assert(!ret); + list_add_tail(&irq->node, &process_irq_list); + ret = pthread_mutex_unlock(&process_irq_lock); + assert(!ret); +} + +static void process_interrupt_remove(struct process_interrupt *irq) +{ + int ret; + + ret = pthread_mutex_lock(&process_irq_lock); + assert(!ret); + list_del(&irq->node); + ret = pthread_mutex_unlock(&process_irq_lock); + assert(!ret); +} + +static struct process_interrupt *process_interrupt_find(int irq_num) +{ + int ret; + struct process_interrupt *i = NULL; + + ret = pthread_mutex_lock(&process_irq_lock); + assert(!ret); + list_for_each_entry(i, &process_irq_list, node) { + if (i->irq == irq_num) + goto done; + } +done: + ret = pthread_mutex_unlock(&process_irq_lock); + assert(!ret); + return i; +} + +/* This is the interface from the platform-agnostic driver code to (de)register + * interrupt handlers. We simply create/destroy corresponding structs. + */ +int qbman_request_irq(int irq, irqreturn_t (*isr)(int irq, void *arg), + unsigned long flags, const char *name, + void *arg __maybe_unused) +{ + struct process_interrupt *irq_node = + kmalloc(sizeof(*irq_node), GFP_KERNEL); + + if (!irq_node) + return -ENOMEM; + irq_node->irq = irq; + irq_node->isr = isr; + irq_node->flags = flags; + irq_node->name = name; + irq_node->arg = arg; + process_interrupt_install(irq_node); + return 0; +} + +int qbman_free_irq(int irq, __maybe_unused void *arg) +{ + struct process_interrupt *irq_node = process_interrupt_find(irq); + + if (!irq_node) + return -EINVAL; + process_interrupt_remove(irq_node); + kfree(irq_node); + return 0; +} + +/* This is the interface from the platform-specific driver code to obtain + * interrupt handlers that have been registered. + */ +void qbman_invoke_irq(int irq) +{ + struct process_interrupt *irq_node = process_interrupt_find(irq); + + if (irq_node) + irq_node->isr(irq, irq_node->arg); +} diff --git a/drivers/bus/dpaa/base/qbman/dpaa_sys.h b/drivers/bus/dpaa/base/qbman/dpaa_sys.h new file mode 100644 index 0000000..c53035a --- /dev/null +++ b/drivers/bus/dpaa/base/qbman/dpaa_sys.h @@ -0,0 +1,65 @@ +/*- + * 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 2008-2016 Freescale Semiconductor Inc. + * Copyright 2017 NXP. + * + * 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 __DPAA_SYS_H +#define __DPAA_SYS_H + +#include + +/* For 2-element tables related to cache-inhibited and cache-enabled mappings */ +#define DPAA_PORTAL_CE 0 +#define DPAA_PORTAL_CI 1 + +#ifdef RTE_LIBRTE_DPAA_CHECKING +#define DPAA_ASSERT(x) ASSERT(x) +#else +#define DPAA_ASSERT(x) do { } while (0) +#endif + +/* This is the interface from the platform-agnostic driver code to (de)register + * interrupt handlers. We simply create/destroy corresponding structs. + */ +int qbman_request_irq(int irq, irqreturn_t (*isr)(int irq, void *arg), + unsigned long flags, const char *name, void *arg); +int qbman_free_irq(int irq, void *arg); + +void qbman_invoke_irq(int irq); + +#endif /* __DPAA_SYS_H */ -- 2.7.4