lib: sbi_irqchip: Set the IRQ handler when registering a chip

In addition to saving some code size, this moves the decision about
setting the top-level external interrupt handler to the irqchip core,
not the specific driver, which would be needed to support chained
interrupt handlers.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Samuel Holland
2024-11-04 20:10:10 -08:00
committed by Anup Patel
parent 678f5909a3
commit 111772353f
3 changed files with 7 additions and 19 deletions

View File

@@ -347,6 +347,7 @@ int imsic_data_check(struct imsic_data *imsic)
static struct sbi_irqchip_device imsic_device = {
.warm_init = imsic_warm_irqchip_init,
.irq_handle = imsic_external_irqfn,
};
int imsic_cold_irqchip_init(struct imsic_data *imsic)
@@ -376,9 +377,6 @@ int imsic_cold_irqchip_init(struct imsic_data *imsic)
return SBI_ENOMEM;
}
/* Setup external interrupt function for IMSIC */
sbi_irqchip_set_irqfn(imsic_external_irqfn);
/* Add IMSIC regions to the root domain */
for (i = 0; i < IMSIC_MAX_REGS && imsic->regs[i].size; i++) {
rc = sbi_domain_root_add_memrange(imsic->regs[i].addr,