summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1999-09-25 16:23:50 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1999-09-25 16:23:50 +0000
commitfb3f26c01f0125d32fdf1c68af24842428cb6975 (patch)
tree3be328c99f53ef94a10c2d3a02cc7960face52cb
parente7e12aa3180043370c0487396f88eea45b3842cb (diff)
alpha-specific part of ross@netbsd's NetBSD scheduler fix.
-rw-r--r--sys/arch/alpha/alpha/clock.c5
-rw-r--r--sys/arch/alpha/alpha/interrupt.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/sys/arch/alpha/alpha/clock.c b/sys/arch/alpha/alpha/clock.c
index 9af2971e8a1..84e5e8ee106 100644
--- a/sys/arch/alpha/alpha/clock.c
+++ b/sys/arch/alpha/alpha/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.8 1998/03/01 13:42:19 niklas Exp $ */
+/* $OpenBSD: clock.c,v 1.9 1999/09/25 16:23:49 pjanzen Exp $ */
/* $NetBSD: clock.c,v 1.14 1996/11/23 06:31:57 cgd Exp $ */
/*
@@ -60,6 +60,8 @@
#define LEAPYEAR(year) (((year) % 4) == 0)
+extern int schedhz;
+
struct device *clockdev;
const struct clockfns *clockfns;
int clockinitted;
@@ -131,6 +133,7 @@ cpu_initclocks()
* isn't set at that time.
*/
set_clockintr();
+ schedhz = 16;
/*
* Get the clock started.
diff --git a/sys/arch/alpha/alpha/interrupt.c b/sys/arch/alpha/alpha/interrupt.c
index dc8170b6e9b..b1df45d638d 100644
--- a/sys/arch/alpha/alpha/interrupt.c
+++ b/sys/arch/alpha/alpha/interrupt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interrupt.c,v 1.7 1999/01/11 05:10:59 millert Exp $ */
+/* $OpenBSD: interrupt.c,v 1.8 1999/09/25 16:23:49 pjanzen Exp $ */
/* $NetBSD: interrupt.c,v 1.14 1996/11/13 22:20:54 cgd Exp $ */
/*
@@ -32,6 +32,7 @@
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/vmmeter.h>
+#include <sys/sched.h>
#include <machine/autoconf.h>
#include <machine/reg.h>
@@ -43,6 +44,10 @@
#include <machine/intrcnt.h>
#endif
+extern int schedhz;
+
+static u_int schedclk2;
+
struct logout {
#define LOGOUT_RETRY 0x1000000000000000 /* Retry bit. */
#define LOGOUT_LENGTH 0xffff /* Length mask. */
@@ -68,10 +73,15 @@ interrupt(a0, a1, a2, framep)
u_long a0, a1, a2;
struct trapframe *framep;
{
+ struct proc *p;
if (a0 == 1) { /* clock interrupt */
cnt.v_intr++;
(*clockintr)(framep, a1);
+ if((++schedclk2 & 0x3f) == 0
+ && (p = curproc) != NULL
+ && schedhz)
+ schedclock(p);
} else if (a0 == 3) { /* I/O device interrupt */
cnt.v_intr++;
(*iointr)(framep, a1);