summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-08-19 06:10:10 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-08-19 06:10:10 +0000
commit0819e631467e41e786518a62bd988d40dae14fbe (patch)
tree1a0ecd9cb33cad6b9a5b48dc63cfd043eab59066 /sys
parente03f6d610ee7156cfd3111929b6574e3b516b167 (diff)
generic soft interrupts for softclock.
From NetBSD.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_clock.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index f9e89160967..3e3c0b7efc3 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_clock.c,v 1.27 2000/08/23 20:36:18 art Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.28 2001/08/19 06:10:09 art Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
@@ -296,13 +296,34 @@ int shifthz;
volatile struct timeval time;
volatile struct timeval mono_time;
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+void *softclock_si;
+void generic_softclock(void *);
+
+void
+generic_softclock(void *ignore)
+{
+ /*
+ * XXX - dont' commit, just a dummy wrapper until we learn everyone
+ * deal with a changed proto for softclock().
+ */
+ softclock();
+}
+#endif
+
/*
* Initialize clock frequencies and start both clocks running.
*/
void
initclocks()
{
- register int i;
+ int i;
+
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ softclock_si = softintr_establish(IPL_SOFTCLOCK, generic_softclock, NULL);
+ if (softclock_si == NULL)
+ panic("initclocks: unable to register softclock intr");
+#endif
/*
* Set divisors to 1 (normal case) and let the machine-specific
@@ -678,10 +699,15 @@ hardclock(frame)
* Save the overhead of a software interrupt;
* it will happen as soon as we return, so do it now.
*/
- (void)spllowersoftclock();
+ spllowersoftclock();
softclock();
- } else
+ } else {
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ softintr_schedule(softclock_si);
+#else
setsoftclock();
+#endif
+ }
}
}