[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.22 v2 1/4] riscv/irq: define a per-arch irq_to_desc()





On 6/29/26 11:45 AM, Roger Pau Monne wrote:
RISCV declares irq_desc as a static array, opposed to x86 that uses a
pointer allocated at boot time.  This creates issues when attempting to add
an extern declaration for irq_desc, as asm/irq.h is included by xen/irq.h where
the definition of struct irq_desc resides, and an empty forward declaration
doesn't make the compiler happy because it doesn't know the type
data-storage.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
  xen/arch/riscv/include/asm/irq.h | 4 ++++
  xen/arch/riscv/irq.c             | 5 +++++
  2 files changed, 9 insertions(+)

diff --git a/xen/arch/riscv/include/asm/irq.h b/xen/arch/riscv/include/asm/irq.h
index f633636dc308..b3e03117ac97 100644
--- a/xen/arch/riscv/include/asm/irq.h
+++ b/xen/arch/riscv/include/asm/irq.h
@@ -35,6 +35,10 @@ struct arch_irq_desc {
      unsigned int type;
  };
+struct irq_desc;
+struct irq_desc *irq_to_desc(unsigned int irq);
+#define irq_to_desc irq_to_desc
+
  struct cpu_user_regs;
  struct dt_device_node;
diff --git a/xen/arch/riscv/irq.c b/xen/arch/riscv/irq.c
index 25d329500212..353e9246f15b 100644
--- a/xen/arch/riscv/irq.c
+++ b/xen/arch/riscv/irq.c
@@ -19,6 +19,11 @@
static irq_desc_t irq_desc[NR_IRQS]; +struct irq_desc *irq_to_desc(unsigned int irq)
+{
+    return &irq_desc[irq];
+}
+
  static bool irq_validate_new_type(unsigned int curr, unsigned int new)
  {
      return curr == IRQ_TYPE_INVALID || curr == new;

Changes looks good to me.

There are similar changes in my dom0less enablement config for RISC-V but considering that likely this patch will be in staging faster then my patch series:
 Reviewed-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
 Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>

Thanks.

~ Oleksii



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.