diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2007-10-10 15:53:54 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2007-10-10 15:53:54 +0000 |
commit | e51062c8cca21a333603b567563e3b84f74ddac0 (patch) | |
tree | dccf12b7d5ef806260203fe60b2bcaf94260c651 /sys/arch/mvme88k | |
parent | 34c540de32da6090afdcdd6fee481f9a2df345fd (diff) |
Make context switching much more MI:
- Move the functionality of choosing a process from cpu_switch into
a much simpler function: cpu_switchto. Instead of having the locore
code walk the run queues, let the MI code choose the process we
want to run and only implement the context switching itself in MD
code.
- Let MD context switching run without worrying about spls or locks.
- Instead of having the idle loop implemented with special contexts
in MD code, implement one idle proc for each cpu. make the idle
loop MI with MD hooks.
- Change the proc lists from the old style vax queues to TAILQs.
- Change the sleep queue from vax queues to TAILQs. This makes
wakeup() go from O(n^2) to O(n)
there will be some MD fallout, but it will be fixed shortly.
There's also a few cleanups to be done after this.
deraadt@, kettenis@ ok
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/mvme88k/locore.S | 10 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 11 |
2 files changed, 6 insertions, 15 deletions
diff --git a/sys/arch/mvme88k/mvme88k/locore.S b/sys/arch/mvme88k/mvme88k/locore.S index 980804454bc..355d0dae81a 100644 --- a/sys/arch/mvme88k/mvme88k/locore.S +++ b/sys/arch/mvme88k/mvme88k/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.49 2006/05/08 14:03:35 miod Exp $ */ +/* $OpenBSD: locore.S,v 1.50 2007/10/10 15:53:52 art Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -346,14 +346,6 @@ GLOBAL(secondary_start) bsr.n _C_LABEL(secondary_main) addu r31, r3, USIZE /* switch to idle stack */ - /* - * At this point, the CPU has been correctly initialized and has - * identified itself on the console. - * All it needs now is to jump to the idle loop and wait for work to - * be offered. - */ - br _ASM_LABEL(cpu_switch_idle) - #endif /* MULTIPROCESSOR */ /* diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index c743056aafa..6c94e8288aa 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.192 2007/06/06 17:15:12 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.193 2007/10/10 15:53:52 art Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -719,19 +719,18 @@ void secondary_main() { struct cpu_info *ci = curcpu(); + int s; cpu_configuration_print(0); + sched_init_cpu(ci); ncpus++; __cpu_simple_unlock(&cpu_mutex); microuptime(&ci->ci_schedstate.spc_runtime); ci->ci_curproc = NULL; - /* - * Upon return, the secondary cpu bootstrap code in locore will - * enter the idle loop, waiting for some food to process on this - * processor. - */ + SCHED_LOCK(s); + cpu_switchto(NULL, sched_chooseproc()); } #endif /* MULTIPROCESSOR */ |