From patchwork Wed Jan 22 01:58:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bobby Eshleman X-Patchwork-Id: 11345001 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4AFCA1820 for ; Wed, 22 Jan 2020 05:15:08 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2757324656 for ; Wed, 22 Jan 2020 05:15:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vRhChwmd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2757324656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iu8LA-00058x-Oo; Wed, 22 Jan 2020 05:14:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iu5L2-0006AZ-6Y for xen-devel@lists.xenproject.org; Wed, 22 Jan 2020 02:01:48 +0000 X-Inumbo-ID: 07f5bfb4-3cbb-11ea-9fd7-bc764e2007e4 Received: from mail-yb1-xb42.google.com (unknown [2607:f8b0:4864:20::b42]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 07f5bfb4-3cbb-11ea-9fd7-bc764e2007e4; Wed, 22 Jan 2020 02:00:57 +0000 (UTC) Received: by mail-yb1-xb42.google.com with SMTP id c13so2411060ybq.5 for ; Tue, 21 Jan 2020 18:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x5jb/2WzDnuDfw2/mvmF1tHxD3Rvz+Oa9YbEJ6xgMRo=; b=vRhChwmdZf2+tdeDJpo952146AWpso0TS6UWiVqtz5JGHPIGM9eX1X5txNgHzBkp5z NvImyvNbGeYNKJu1wR7g3tEHbhgAe4jaDOQYhjQswUwUxDcWxJdU1vpN17UpmOeBmAmQ vI29uHSsP5SeXydH73p/bPdUMz5cXoITjIB1lcqovcBVHF9wIacDle/n5B4U7roKCugI ym8Jdn35BNJgFPxg60vg9FfMncnMQ7+f3e9zRQ7kC3SDezrRGYAO/vv7KY9J1Vf2WMiU 0vh2kfO1CzZqGo0w7aD6wDzqUFS34U6QTfIdFO5shiyuPv/6RoWzYET3XDGfTaZ/DpF6 MerQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x5jb/2WzDnuDfw2/mvmF1tHxD3Rvz+Oa9YbEJ6xgMRo=; b=D00yCpuTHrZOjqDBQam6wW3gJjBSKCsk7cF3gsgezxVmE5F7ccMUwkxO2HkSXbWeoM H15T3rhlAt0aWkkWuIAn5iiF3Es3Uk/NiF9ENYOLWYuyC6vZ6gkKiW3kIUKbNm7bTkcD 0L+GoN06V7Ikz/6ejVFzT6kKNKoyvhn78Vui8rWbnBHc5s0Pi8A2xhXA2fbIFYBr/VIm 08KzaGWZ2G15eXoIafDWXAIQLp+LfDUIcRgnWU/tDBwEsvuDkm7dAUGXuyKrJhhHpEyt ZQvnuTRwaCwj42gejIYrYRhVxQEgf6QFSgg3TtRL8GFV2reulUHL5RM1GI1oUYNYMzId zB7w== X-Gm-Message-State: APjAAAVzhDQRMFbna4LWyfOB4/dTehA5eWPg/8327keiZE43S9g2QST9 xl6OXoU3E8qUpqsPCjn65kMc5z12wDolXQ== X-Google-Smtp-Source: APXvYqzl8pvTk3rKGnFIV1fUksSKrcPVFou62T03N7ZGlafAzvFmhlz9sfXDxmnVvb0r2zP1+IoI6w== X-Received: by 2002:a5b:144:: with SMTP id c4mr6313288ybp.371.1579658457239; Tue, 21 Jan 2020 18:00:57 -0800 (PST) Received: from bobbye-pc.knology.net ([216.186.244.35]) by smtp.gmail.com with ESMTPSA id q185sm17504248ywh.61.2020.01.21.18.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:00:56 -0800 (PST) From: Bobby Eshleman To: xen-devel@lists.xenproject.org Date: Tue, 21 Jan 2020 19:58:55 -0600 Message-Id: <86b8f52b7c77aa4a64fd4aae0f598ea80d6c662a.1579615303.git.bobbyeshleman@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 22 Jan 2020 05:14:01 +0000 Subject: [Xen-devel] [RFC XEN PATCH 16/23] riscv: Add irq.c X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Bobby Eshleman , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Bobby Eshleman , Dan Robertson , Alistair Francis Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Alistair Francis Signed-off-by: Alistair Francis --- xen/arch/riscv/irq.c | 107 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 xen/arch/riscv/irq.c diff --git a/xen/arch/riscv/irq.c b/xen/arch/riscv/irq.c new file mode 100644 index 0000000000..d1b0b578de --- /dev/null +++ b/xen/arch/riscv/irq.c @@ -0,0 +1,107 @@ +/* + * RISC-V Interrupt support + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include + +const unsigned int nr_irqs = NR_IRQS; + +static void ack_none(struct irq_desc *irq) +{ + printk("unexpected IRQ trap at irq %02x\n", irq->irq); +} + +static void end_none(struct irq_desc *irq) +{ + /* TODO */ +} + +hw_irq_controller no_irq_type = { + .typename = "none", + .startup = irq_startup_none, + .shutdown = irq_shutdown_none, + .enable = irq_enable_none, + .disable = irq_disable_none, + .ack = ack_none, + .end = end_none +}; + +static irq_desc_t irq_desc[NR_IRQS]; +static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc); + +int arch_init_one_irq_desc(struct irq_desc *desc) +{ + return 0; +} + +struct pirq *alloc_pirq_struct(struct domain *d) +{ + /* TODO */ + + return NULL; +} + +irq_desc_t *__irq_to_desc(int irq) +{ + if ( irq < NR_LOCAL_IRQS ) + return &this_cpu(local_irq_desc)[irq]; + + return &irq_desc[irq-NR_LOCAL_IRQS]; +} + +int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share) +{ + BUG(); +} + +void pirq_guest_unbind(struct domain *d, struct pirq *pirq) +{ + BUG(); +} + +void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask) +{ + BUG(); +} + +void smp_send_state_dump(unsigned int cpu) +{ + /* TODO */ +} + +void arch_move_irqs(struct vcpu *v) +{ + /* TODO */ +} + +int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new) +{ + int rc = 0; + unsigned long flags; + struct irq_desc *desc; + + desc = irq_to_desc(irq); + + spin_lock_irqsave(&desc->lock, flags); + + /* TODO */ + + spin_unlock_irqrestore(&desc->lock, flags); + + return rc; +}