aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_intr.c12
-rw-r--r--sys/riscv/riscv/plic.c3
2 files changed, 10 insertions, 5 deletions
diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c
index eda100164711..791a73957af5 100644
--- a/sys/kern/subr_intr.c
+++ b/sys/kern/subr_intr.c
@@ -128,7 +128,11 @@ static struct intr_irqsrc *irq_sources[NIRQ];
u_int irq_next_free;
#ifdef SMP
-static boolean_t irq_assign_cpu = FALSE;
+#ifdef EARLY_AP_STARTUP
+static bool irq_assign_cpu = true;
+#else
+static bool irq_assign_cpu = false;
+#endif
#endif
/*
@@ -1191,6 +1195,7 @@ intr_irq_next_cpu(u_int last_cpu, cpuset_t *cpumask)
return (last_cpu);
}
+#ifndef EARLY_AP_STARTUP
/*
* Distribute all the interrupt sources among the available
* CPUs once the AP's have been launched.
@@ -1205,7 +1210,7 @@ intr_irq_shuffle(void *arg __unused)
return;
mtx_lock(&isrc_table_lock);
- irq_assign_cpu = TRUE;
+ irq_assign_cpu = true;
for (i = 0; i < NIRQ; i++) {
isrc = irq_sources[i];
if (isrc == NULL || isrc->isrc_handlers == 0 ||
@@ -1231,6 +1236,7 @@ intr_irq_shuffle(void *arg __unused)
mtx_unlock(&isrc_table_lock);
}
SYSINIT(intr_irq_shuffle, SI_SUB_SMP, SI_ORDER_SECOND, intr_irq_shuffle, NULL);
+#endif /* !EARLY_AP_STARTUP */
#else
u_int
@@ -1239,7 +1245,7 @@ intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask)
return (PCPU_GET(cpuid));
}
-#endif
+#endif /* SMP */
/*
* Allocate memory for new intr_map_data structure.
diff --git a/sys/riscv/riscv/plic.c b/sys/riscv/riscv/plic.c
index 1e99b2d068ab..029525938161 100644
--- a/sys/riscv/riscv/plic.c
+++ b/sys/riscv/riscv/plic.c
@@ -408,8 +408,7 @@ plic_setup_intr(device_t dev, struct intr_irqsrc *isrc,
sc = device_get_softc(dev);
src = (struct plic_irqsrc *)isrc;
- /* Bind to the boot CPU for now. */
- CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu);
+ CPU_ZERO(&isrc->isrc_cpu);
plic_bind_intr(dev, isrc);
return (0);