diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-10-28 19:48:48 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-10-28 19:48:48 +0000 |
commit | 56a6cd1df018f60440a8b302bf802605808e12bb (patch) | |
tree | 89c612b451ffa86a310bd91af6a975a69fa14a6e /sys/arch | |
parent | a389bb2ad2091df438d54a02ed7440c02599b1f5 (diff) |
This is a horrible kluge: invoke sched_init_cpu for seconday processors
before they are started (and not skipping gaps for machine setups with
holes in cpu slots). Since we start secondary cpus very late in the boot
process, and sched_init_cpu() has to be invoked before proc0 execve's init,
I don't think there is a better way to do this.
This lets MVME188 systems with more than one processor boot multiuser.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mvme88k/mvme88k/autoconf.c | 22 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 3 |
2 files changed, 22 insertions, 3 deletions
diff --git a/sys/arch/mvme88k/mvme88k/autoconf.c b/sys/arch/mvme88k/mvme88k/autoconf.c index 83a31073a0e..6d737a3e65c 100644 --- a/sys/arch/mvme88k/mvme88k/autoconf.c +++ b/sys/arch/mvme88k/mvme88k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.40 2007/10/13 12:55:21 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.41 2007/10/28 19:48:47 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -72,6 +72,26 @@ struct device *bootdv; /* set by device drivers (if found) */ void cpu_configure() { +#ifdef MULTIPROCESSOR + /* + * XXX This is gross. We can not invoke sched_init_cpu after + * XXX init has been forked. But since we start secondary + * XXX processors very late in the boot process, it is not + * XXX possible to do this from the secondary processors + * XXX themselves. + * XXX Instead, do this now, even though this may cause + * XXX idle procs to be allocated for missing or unreliable + * XXX processors. + */ + cpuid_t cpu; + for (cpu = 0; cpu < max_cpus; cpu++) { + if (cpu == curcpu()->ci_cpuid) + continue; + + sched_init_cpu(&m88k_cpus[cpu]); + } +#endif + if (config_rootfound("mainbus", "mainbus") == 0) panic("no mainbus found"); diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index b9d6fe5610c..2b97d66c08b 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.196 2007/10/28 19:45:52 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.197 2007/10/28 19:48:47 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -724,7 +724,6 @@ secondary_main() int s; cpu_configuration_print(0); - sched_init_cpu(ci); ncpus++; __cpu_simple_unlock(&cpu_boot_mutex); |