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/sgi | |
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/sgi')
-rw-r--r-- | sys/arch/sgi/localbus/macebus.c | 6 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/genassym.cf | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/sys/arch/sgi/localbus/macebus.c b/sys/arch/sgi/localbus/macebus.c index f02bafba377..4e981dac5ef 100644 --- a/sys/arch/sgi/localbus/macebus.c +++ b/sys/arch/sgi/localbus/macebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macebus.c,v 1.26 2007/07/09 21:40:24 jasper Exp $ */ +/* $OpenBSD: macebus.c,v 1.27 2007/10/10 15:53:52 art Exp $ */ /* * Copyright (c) 2000-2004 Opsycon AB (www.opsycon.se) @@ -780,7 +780,6 @@ macebus_iointr(intrmask_t hwpend, struct trap_frame *cf) intrmask_t macebus_aux(intrmask_t hwpend, struct trap_frame *cf) { - extern char idle[], e_idle[]; u_int64_t mask; mask = bus_space_read_8(&macebus_tag, mace_h, MACE_ISA_MISC_REG); @@ -791,7 +790,8 @@ macebus_aux(intrmask_t hwpend, struct trap_frame *cf) /* RED - User Mode */ if (cf->sr & SR_KSU_USER) { mask &= ~MACE_ISA_MISC_RLED_OFF; - } else if (cf->pc >= (long)idle && cf->pc < (long)e_idle) { + } else if (curproc == NULL || + curproc == curcpu()->ci_schedstate.spc_idleproc) { mask &= ~MACE_ISA_MISC_GLED_OFF; } else { mask &= ~(MACE_ISA_MISC_RLED_OFF | MACE_ISA_MISC_GLED_OFF); diff --git a/sys/arch/sgi/sgi/genassym.cf b/sys/arch/sgi/sgi/genassym.cf index a57571199d8..2e5ac9202f8 100644 --- a/sys/arch/sgi/sgi/genassym.cf +++ b/sys/arch/sgi/sgi/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.9 2007/06/18 20:25:55 miod Exp $ +# $OpenBSD: genassym.cf,v 1.10 2007/10/10 15:53:52 art Exp $ # # Copyright (c) 1997 Per Fogelstrom / Opsycon AB # @@ -38,9 +38,7 @@ include <machine/cpu.h> export SONPROC struct proc -member p_forw -member p_back -member p_priority +#member p_priority member p_stat member p_addr #member P_UPTE p_md.md_upte |