Page MenuHomeFreeBSD

D21661.diff
No OneTemporary

D21661.diff

Index: head/sys/riscv/conf/GENERIC
===================================================================
--- head/sys/riscv/conf/GENERIC
+++ head/sys/riscv/conf/GENERIC
@@ -71,6 +71,7 @@
options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default
options RCTL # Resource limits
options SMP
+options EARLY_AP_STARTUP
options INTRNG
# RISC-V SBI console
Index: head/sys/riscv/riscv/clock.c
===================================================================
--- head/sys/riscv/riscv/clock.c
+++ head/sys/riscv/riscv/clock.c
@@ -37,10 +37,34 @@
#include <sys/types.h>
#include <sys/systm.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/sched.h>
+#include <sys/smp.h>
void
cpu_initclocks(void)
{
+#ifdef EARLY_AP_STARTUP
+ struct thread *td;
+ int i;
+ td = curthread;
cpu_initclocks_bsp();
+ CPU_FOREACH(i) {
+ if (i == 0)
+ continue;
+ thread_lock(td);
+ sched_bind(td, i);
+ thread_unlock(td);
+ cpu_initclocks_ap();
+ }
+ thread_lock(td);
+ if (sched_is_bound(td))
+ sched_unbind(td);
+ thread_unlock(td);
+#else
+ cpu_initclocks_bsp();
+#endif
}
Index: head/sys/riscv/riscv/mp_machdep.c
===================================================================
--- head/sys/riscv/riscv/mp_machdep.c
+++ head/sys/riscv/riscv/mp_machdep.c
@@ -257,8 +257,10 @@
/* Enable software interrupts */
riscv_unmask_ipi();
+#ifndef EARLY_AP_STARTUP
/* Start per-CPU event timers. */
cpu_initclocks_ap();
+#endif
/* Enable external (PLIC) interrupts */
csr_set(sie, SIE_SEIE);

File Metadata

Mime Type
text/plain
Expires
Sun, May 24, 6:01 AM (14 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33464603
Default Alt Text
D21661.diff (1 KB)

Event Timeline