From aadb433981b086bfb4e082757fed1154582d5497 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Sun, 11 Feb 2024 12:00:57 +0000 Subject: smp: Create AP processor set and put all APs inside it This has the effect of running with one cpu only with smp, but has the ability to enable APs in userspace with the right processor set RPCs. Message-ID: <20240211120051.1889789-1-damien@zamaudio.com> --- kern/machine.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'kern/machine.c') diff --git a/kern/machine.c b/kern/machine.c index 87fbc4d1..f757d146 100644 --- a/kern/machine.c +++ b/kern/machine.c @@ -84,6 +84,9 @@ void cpu_up(int cpu) processor = cpu_to_processor(cpu); pset_lock(&default_pset); +#if MACH_HOST + pset_lock(slave_pset); +#endif s = splsched(); processor_lock(processor); #if NCPUS > 1 @@ -92,10 +95,18 @@ void cpu_up(int cpu) ms = &machine_slot[cpu]; ms->running = TRUE; machine_info.avail_cpus++; - pset_add_processor(&default_pset, processor); +#if MACH_HOST + if (cpu != 0) + pset_add_processor(slave_pset, processor); + else +#endif + pset_add_processor(&default_pset, processor); processor->state = PROCESSOR_RUNNING; processor_unlock(processor); splx(s); +#if MACH_HOST + pset_unlock(slave_pset); +#endif pset_unlock(&default_pset); } -- cgit v1.2.3