From patchwork Wed Aug 23 14:11:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 27779 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 8A5639113; Wed, 23 Aug 2017 16:02:50 +0200 (CEST) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0062.outbound.protection.outlook.com [104.47.33.62]) by dpdk.org (Postfix) with ESMTP id 8AE0990F8 for ; Wed, 23 Aug 2017 16:02:47 +0200 (CEST) Received: from MWHPR03CA0001.namprd03.prod.outlook.com (10.175.133.139) by CO2PR03MB2264.namprd03.prod.outlook.com (10.166.92.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Wed, 23 Aug 2017 14:02:45 +0000 Received: from BN1BFFO11FD032.protection.gbl (2a01:111:f400:7c10::1:125) by MWHPR03CA0001.outlook.office365.com (2603:10b6:300:117::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Wed, 23 Aug 2017 14:02:45 +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 BN1BFFO11FD032.mail.protection.outlook.com (10.58.144.95) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Wed, 23 Aug 2017 14:02:45 +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 v7NE2Q2s004389; Wed, 23 Aug 2017 07:02:42 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 23 Aug 2017 19:41:41 +0530 Message-ID: <20170823141213.25476-9-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170823141213.25476-1-shreyansh.jain@nxp.com> References: <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> <20170823141213.25476-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131479705656957543; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(53936002)(2906002)(36756003)(8656003)(2351001)(104016004)(305945005)(105606002)(47776003)(106466001)(33646002)(50466002)(68736007)(110136004)(54906002)(48376002)(626005)(5003940100001)(85426001)(86362001)(76176999)(189998001)(50986999)(97736004)(77096006)(8936002)(4326008)(50226002)(5660300001)(356003)(1076002)(81156014)(2950100002)(498600001)(6916009)(81166006)(8676002)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2264; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD032; 1:kcTjmcATLK7YROB7hteDRU3JpYNHRUseLlY0tcIM4TLzO8zN02SwG225hMT8O6KDZtXvf2SeEkOO9bNREqHSl4nJaaAqa1Bb3ky9At7EhKqXJ6/3gcM3G1Xp2t1/8kE0 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 63c3fdb1-d816-41bf-1a67-08d4ea2fa152 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603185)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CO2PR03MB2264; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2264; 3:FqB40ACQSI5niDKHH0u7E5Tr4EnyTYUjf0MbyZZHU0st6seTx6CpQ3OTbVFAYYkolz5uRTLzoTcPSUkNpcElawMaxKlTQpI8ntTZnoz6tWMdV9WQsXsRcxWu7ll2QwB4UG4MjeJiwZ42g25w6yBWjK82917S6cR9EZqn4KrqVyiwNFHkCrgrArHPAqBdwwzBbWdP7n4MLmlx+p/uOIR3Nt80Yc/tYgxeFgRLha5sd33D0Xe65b14q17qJVy6t3wmg8FAda769JYAyTgGw3flEnMWwIG2NwQs6oNCMoqSShXmBzbUHd38Wh9NfL+2TrwtnONFbR9bVKvSP4e+ltDg85zcUNUgtfZ682uJg3tHU6o=; 25:9v28tQWlgj+J5EfRZHQOY28yEE5XXRJz8WGVEgIcqGuCdll9i2GPLLlVjEg0u7OaobA5rFF+qdwotK6HfQpKxwo0JgNXz5PNBjVZB+YmeWjZXmpO2tW1KQpsx3oPr43HTmPawki0I0u8BFzfEgjYXEFkmnDc9K9xDOc+gk94ILulh3IvK1cU03fVmSRFhB57SfXjQ7zbzv8XifwK8g+xsvSFyCee00Pn/eiZofnul2hqsVkMBXkFZbkJC/4hG9KWDHTc7nDhGjY9PKsUP8hai+O5QKiBTBNwOsUZ8vSo9qjYB2sJJXwyHx/RKGYmG3bsudi92tIJfkUgGWSl9+ypfw== X-MS-TrafficTypeDiagnostic: CO2PR03MB2264: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2264; 31:vL+zlyz9bNpC4B/PhFVgP5Q17Ik/CzRMt2W6hpi9kWyADz7qpxyLR7ZWW2ssyvDroDkonqVZ4qMWohTlc7ayOBLDcesBVpDdThYM7+a2px4XqbJhFcCHKa2WU0QbIaF1Z7HgcLDf2UoBwhCcBEgaBYyoQSAvrlsTbt2TNW1V8B72HXKINCE3e5gdLOJTUB7pMYcISUFNAgkF2qZDeqjUlQc17Eq/WOtSsm05jiGgh9Y=; 4:YCU7JaW030FrDBEO6h+eWn4c4grrf37VTKvXU9wjZfnPMtYCkvcTK1l0sX4MGivCOc9Y8wk+nsshKpMEUMIf79neH4FLG3nD9QcS0AmeFYlZf/H8brj+I1qNoYBCz8A4amxLp5MnDTnJei61KpcPmQEi81zDM5GHwnj4YTh238igE/e6S4mlVc4YvJDh+Uj+ZWcMgHIyCKv0ZwQ3yegN9fNB543KiqBU3XgEIcMRqx5pt8LYvUOXcZ6ejE0uQnMdZGhd5tcrewyLyP4Z3h0beJGm0R3zl2+ZOBQDkcZEDlo= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(5005006)(13016025)(8121501046)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2264; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2264; X-Forefront-PRVS: 040866B734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2264; 23:5Ah7l0y2BodtCouAxeBjbGiiTQfo/ojET9tVYIz9d?= dKTsmNWtm2Zw8hyrG8JqFQv27TgcbbHfAMiIyiroM500TVs5uIRaCoCJpyf2/Nb3xrnZE9Of6JDvYSRXolDJebkM0qxajkZWt17xAqiFYmUN28HEtd3Ynumka8bHRNG929ZO7PgjCHtiJJZ3fioWvdlUrOoXe7e67s0Q17xmIGTsP7eESQSusODozcacpAcoLFCY5Ekbwnd6gkMoOTnnG+UkNEn++Kh8ZR9rj+kKgZyhwH/wAA2DJ3uIrd/VbOCpLyZvcRYoIu3zx/ByA66p7TQof2GulGe/+o5nIEWnbuu+3xqHt8M4dC5APjfDT1eTeKZ4+K/CWVNXGf2y20ZW5ryA2UexCIKoziBU2ZKZzoCZgxAWX/GfJvsXhCAQ2y/T+3l4ZnB3fEyn+uDSwR3dp7aFCwWkzvYPuMa94Zh3qzRuRspne9RmkBpfynnamYWmiLcGsM8I9yYsqeNhR8kb7AGcAAJeObGXH/EYpS3ABwS7i1iqFSEmJXJJwG/ZYDspnzOJsV8ENR8xqCdAZLmDZOkcDBgKTarZHqqZ/HKS8Uw8uj0O5Vbd7Oywy6P7tJ9nwyCOt0h+qQr26q1OXk4I65fKGf0+ak+WF5ekPa5oaNcpzhkUqSDsPvpudVURDxwFNqqpiNHJ/dbV/R8jPrMJISh/KRndPVgfFzKIp7tm1LMrkE85WZVMsuV57mwpqXFd24rdApNZydi3eycwx/gKMnUW12/LlJnEvAb+nkAv7lniH+viZNtT0XBjYGys6Eq/TnSek9ZwIalX3jbkWmXPiq1Wi5P1qQHdpDMSTTgDRv8xyWwQCdTMBIZixcACv0AMXKQ7gqoMAaBcXHFRMz+o1H2RpTWWxlkU2UqtCpf1sGwnjPJn7ad/oRnDYhuE6qZK74oKoAdIJ8onQRyh6OIYZ+Kz/jSOjHaUS1fAW8k37s53tWihhlD4RRF7csgQT78kaOENf4m4EEe1rtnWF9t4Nq0izlrmEsXlOk9Zog+sRDlFZw3uvyT078F7Q7YjrmcXxvB9xg4av2KZbllBgzg1zrpeXg1QgYux1FedEpg8xM8ulO1Wi5HI9ISpIRq76Ro7t4Hvi98H8zGDJa0w4+ZQfIy X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2264; 6:J8w+ZMHJaaEdTwQN3iExtzPGX6oUCYk6u3UGO5xhGUmo63MzA1/Zvjv0/TN7ETbhUD9+QnWOKjJ2uLZdy4ZLcnUPqHV/hvvivHR21aXzqzpW2cH2QBBLBLro3nKE8W2Exq7kkpB+GfnSMrDkyL2b+UWKqjYGsnVyTnRz0zpkXMRZaQ8rnnNkMAz5uNT4aXfCnJDxLNlR8t6INnKM7PY9R2coyPniYydxPyFX/2+P11TWWUpPQI3XX0LpAZAID8+IZVX/hJsWq/i61iynFmkzPT6u1asLuhJESRRAGYGYf3sP4GBxAFgThYJk3SHl6/76Ejl9x/BVJmmDW0TrYxCNXw==; 5:rbJEHT0tx3LCddajY1u7pjMe08MGOvACRUYC3Or3voksPVIRmG6UFZifaWx9mRzVAvhPPTVrUX/hWUQJjABqhQ9QMalojgCYB63APLtVEi1aSefjfvnRDdfXZ5c5rbRy/PtWx2Fkr8BtP+FySgpywQ==; 24:Kl4e3fjX82/62tEeZxYzY4zxLUaC7dzMEy7TkMUqiyWMy7gUCYYErxieOWQK4b7NlN9rumsIhcSBIKwftMFwZ7JvUspIgr/B1BtSZkyXnYs=; 7:CCqC4wo/t13CdN5GzOR4vIca8Ot2qJ1+bnJY2ulwjcAqxNzDjyKcD3cmJkGMMvUZMn1kMyf7ln0mKx3dP5gDjxr34cFAnXFyp+ThF77sMl7070U45bBvoGXE3Rbo+Y8EKIPZTx6mjNBQnbbzAK2TXzGpP/hmLtSezBzm0tdW9P1iswoSXyMrfNNk6j+IUn/iip4bhSS7nIgw1h3PXCE4wR6+JyvImvhocd7uFFPFmbg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 14:02:45.3681 (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: CO2PR03MB2264 Subject: [dpdk-dev] [PATCH v3 08/40] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 b0083c9..ad6f8c0 100644 --- a/drivers/bus/dpaa/Makefile +++ b/drivers/bus/dpaa/Makefile @@ -69,6 +69,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 */