mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
riscv/irq: define a per-arch irq_to_desc()
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@citrix.com> Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
This commit is contained in:
1 parent
3b717f57dc
commit
b9b4c6a7ab
2 files changed
+9
No files matched your search
@@ -35,6 +35,9 @@ struct arch_irq_desc {
|
||||
unsigned int type;
|
||||
};
|
||||
|
||||
struct irq_desc *irq_to_desc(unsigned int irq);
|
||||
#define irq_to_desc irq_to_desc
|
||||
|
||||
struct cpu_user_regs;
|
||||
struct dt_device_node;
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
|
||||
static irq_desc_t irq_desc[NR_IRQS];
|
||||
|
||||
struct irq_desc *irq_to_desc(unsigned int irq)
|
||||
{
|
||||
ASSERT(irq < ARRAY_SIZE(irq_desc));
|
||||
return &irq_desc[irq];
|
||||
}
|
||||
|
||||
static bool irq_validate_new_type(unsigned int curr, unsigned int new)
|
||||
{
|
||||
return curr == IRQ_TYPE_INVALID || curr == new;
|
||||
|
||||