summaryrefslogtreecommitdiff
path: root/sys/arch/sh/include/cpu.h
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-10-10 15:53:54 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-10-10 15:53:54 +0000
commite51062c8cca21a333603b567563e3b84f74ddac0 (patch)
treedccf12b7d5ef806260203fe60b2bcaf94260c651 /sys/arch/sh/include/cpu.h
parent34c540de32da6090afdcdd6fee481f9a2df345fd (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/sh/include/cpu.h')
-rw-r--r--sys/arch/sh/include/cpu.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/sh/include/cpu.h b/sys/arch/sh/include/cpu.h
index b29d7247ce0..8b43e78767b 100644
--- a/sys/arch/sh/include/cpu.h
+++ b/sys/arch/sh/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.10 2007/06/06 17:15:12 deraadt Exp $ */
+/* $OpenBSD: cpu.h,v 1.11 2007/10/10 15:53:52 art Exp $ */
/* $NetBSD: cpu.h,v 1.41 2006/01/21 04:24:12 uwe Exp $ */
/*-
@@ -125,6 +125,11 @@ extern int want_resched; /* need_resched() was called */
* We need a machine-independent name for this.
*/
#define DELAY(x) delay(x)
+
+#define cpu_idle_enter() do { /* nothing */ } while (0)
+#define cpu_idle_cycle() __asm volatile("sleep")
+#define cpu_idle_leave() do { /* nothing */ } while (0)
+
#endif /* _KERNEL */
/*