diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c --- a/sys/arm/arm/gic.c +++ b/sys/arm/arm/gic.c @@ -200,7 +200,7 @@ #ifdef SMP static void -arm_gic_init_secondary(device_t dev, enum root_type root_type) +arm_gic_init_secondary(device_t dev, enum intr_root_type root_type) { struct arm_gic_softc *sc = device_get_softc(dev); u_int irq, cpu; diff --git a/sys/arm/broadcom/bcm2835/bcm2836.c b/sys/arm/broadcom/bcm2835/bcm2836.c --- a/sys/arm/broadcom/bcm2835/bcm2836.c +++ b/sys/arm/broadcom/bcm2835/bcm2836.c @@ -538,7 +538,7 @@ } static void -bcm_lintc_init_secondary(device_t dev, enum root_type root_type) +bcm_lintc_init_secondary(device_t dev, enum intr_root_type root_type) { u_int cpu; struct bcm_lintc_softc *sc; diff --git a/sys/arm/include/intr.h b/sys/arm/include/intr.h --- a/sys/arm/include/intr.h +++ b/sys/arm/include/intr.h @@ -43,10 +43,10 @@ #include #endif -enum root_type { - INTR_ROOT_IRQ = 0, +enum intr_root_type { + INTR_ROOT_IRQ, - INTR_ROOT_COUNT /* MUST BE LAST */ + INTR_ROOT_COUNT }; #ifndef NIRQ diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -233,7 +233,7 @@ save_registers 1 KMSAN_ENTER mov x0, sp - mov x1, #INTR_ROOT_IRQ + mov w1, #INTR_ROOT_IRQ bl intr_irq_handler KMSAN_LEAVE restore_registers 1 @@ -244,7 +244,7 @@ save_registers 1 KMSAN_ENTER mov x0, sp - mov x1, #INTR_ROOT_FIQ + mov w1, #INTR_ROOT_FIQ bl intr_irq_handler KMSAN_LEAVE restore_registers 1 @@ -279,7 +279,7 @@ save_registers 0 KMSAN_ENTER mov x0, sp - mov x1, #INTR_ROOT_IRQ + mov w1, #INTR_ROOT_IRQ bl intr_irq_handler do_ast KMSAN_LEAVE @@ -291,7 +291,7 @@ save_registers 0 KMSAN_ENTER mov x0, sp - mov x1, #INTR_ROOT_FIQ + mov w1, #INTR_ROOT_FIQ bl intr_irq_handler do_ast KMSAN_LEAVE diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -1093,7 +1093,7 @@ #ifdef SMP static void -gic_v3_init_secondary(device_t dev, enum root_type root_type) +gic_v3_init_secondary(device_t dev, enum intr_root_type root_type) { struct gic_v3_setup_periph_args pargs; device_t child; diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -1293,7 +1293,7 @@ #ifdef SMP static void -gicv3_its_init_secondary(device_t dev, enum root_type root_type) +gicv3_its_init_secondary(device_t dev, enum intr_root_type root_type) { struct gicv3_its_softc *sc; diff --git a/sys/arm64/include/intr.h b/sys/arm64/include/intr.h --- a/sys/arm64/include/intr.h +++ b/sys/arm64/include/intr.h @@ -31,11 +31,11 @@ #include #endif -enum root_type { - INTR_ROOT_IRQ = 0, - INTR_ROOT_FIQ = 1, +enum intr_root_type { + INTR_ROOT_IRQ, + INTR_ROOT_FIQ, - INTR_ROOT_COUNT /* MUST BE LAST */ + INTR_ROOT_COUNT }; #ifndef NIRQ diff --git a/sys/kern/pic_if.m b/sys/kern/pic_if.m --- a/sys/kern/pic_if.m +++ b/sys/kern/pic_if.m @@ -74,7 +74,7 @@ } static void - null_pic_init_secondary(device_t dev, enum root_type root_type) + null_pic_init_secondary(device_t dev, enum intr_root_type root_type) { } @@ -156,8 +156,8 @@ }; METHOD void init_secondary { - device_t dev; - enum root_type root_type; + device_t dev; + enum intr_root_type root_type; } DEFAULT null_pic_init_secondary; METHOD void ipi_send { diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -328,14 +328,14 @@ * from the assembler, where CPU interrupt is served. */ void -intr_irq_handler(struct trapframe *tf, u_register_t root_type) +intr_irq_handler(struct trapframe *tf, enum intr_root_type root_type) { struct trapframe * oldframe; struct thread * td; struct intr_irq_root *root; - KASSERT((uintmax_t)root_type < INTR_ROOT_COUNT, - ("%s: invalid interrupt root %ju", __func__, (uintmax_t)root_type)); + KASSERT(root_type >= 0 && root_type < INTR_ROOT_COUNT, + ("%s: invalid interrupt root type %d", __func__, root_type)); root = &intr_irq_roots[root_type]; KASSERT(root->filter != NULL, ("%s: no filter", __func__)); @@ -486,10 +486,10 @@ } device_t -intr_irq_root_device(enum root_type root_type) +intr_irq_root_device(enum intr_root_type root_type) { - KASSERT((uintmax_t)root_type < INTR_ROOT_COUNT, - ("%s: invalid interrupt root %ju", __func__, (uintmax_t)root_type)); + KASSERT(root_type >= 0 && root_type < INTR_ROOT_COUNT, + ("%s: invalid interrupt root type %d", __func__, root_type)); return (intr_irq_roots[root_type].dev); } @@ -891,7 +891,7 @@ */ int intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, - void *arg, enum root_type root_type) + void *arg, enum intr_root_type root_type) { struct intr_pic *pic; struct intr_irq_root *root; @@ -916,8 +916,8 @@ * Note that we further suppose that there is not threaded interrupt * routine (handler) on the root. See intr_irq_handler(). */ - KASSERT((uintmax_t)root_type < INTR_ROOT_COUNT, - ("%s: invalid interrupt root %ju", __func__, (uintmax_t)root_type)); + KASSERT(root_type >= 0 && root_type < INTR_ROOT_COUNT, + ("%s: invalid interrupt root type %d", __func__, root_type)); root = &intr_irq_roots[root_type]; if (root->dev != NULL) { device_printf(dev, "another root already set\n"); @@ -1571,7 +1571,7 @@ intr_pic_init_secondary(void) { device_t dev; - enum root_type root_type; + enum intr_root_type root_type; /* * QQQ: Only root PICs are aware of other CPUs ??? diff --git a/sys/riscv/include/intr.h b/sys/riscv/include/intr.h --- a/sys/riscv/include/intr.h +++ b/sys/riscv/include/intr.h @@ -35,10 +35,10 @@ #ifndef _MACHINE_INTR_MACHDEP_H_ #define _MACHINE_INTR_MACHDEP_H_ -enum root_type { - INTR_ROOT_IRQ = 0, +enum intr_root_type { + INTR_ROOT_IRQ, - INTR_ROOT_COUNT /* MUST BE LAST */ + INTR_ROOT_COUNT }; #ifndef NIRQ diff --git a/sys/riscv/riscv/intc.c b/sys/riscv/riscv/intc.c --- a/sys/riscv/riscv/intc.c +++ b/sys/riscv/riscv/intc.c @@ -241,7 +241,7 @@ #ifdef SMP static void -intc_init_secondary(device_t dev, enum root_type root_type) +intc_init_secondary(device_t dev, enum intr_root_type root_type) { struct intc_softc *sc; struct intr_irqsrc *isrc; diff --git a/sys/sys/intr.h b/sys/sys/intr.h --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -113,12 +113,12 @@ struct intr_pic *intr_pic_register(device_t, intptr_t); int intr_pic_deregister(device_t, intptr_t); int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, - enum root_type); + enum intr_root_type); int intr_pic_add_handler(device_t, struct intr_pic *, intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t); bool intr_is_per_cpu(struct resource *); -device_t intr_irq_root_device(enum root_type); +device_t intr_irq_root_device(enum intr_root_type); /* Intr interface for BUS. */ @@ -167,6 +167,6 @@ #endif /* Main interrupt handler called from asm on many archs. */ -void intr_irq_handler(struct trapframe *tf, u_register_t root_type); +void intr_irq_handler(struct trapframe *tf, enum intr_root_type root_type); #endif /* _SYS_INTR_H */