From 035c9340ad4d5916b1591cc413a8db2df271058a Mon Sep 17 00:00:00 2001 From: gallatin Date: Wed, 13 Oct 1999 19:18:29 +0000 Subject: [PATCH] Divide the Alpha's hz of 1024 by 8 to obain a stathz of 128. This fixes "nice" on the alpha. obtained from: NetBSD reviewed by: dfr --- sys/alpha/alpha/clock.c | 1 + sys/alpha/alpha/interrupt.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/alpha/alpha/clock.c b/sys/alpha/alpha/clock.c index bd51ddd0c436..57f539d941a5 100644 --- a/sys/alpha/alpha/clock.c +++ b/sys/alpha/alpha/clock.c @@ -187,6 +187,7 @@ cpu_initclocks() alpha_timecounter.tc_frequency = freq; init_timecounter(&alpha_timecounter); + stathz = 128; platform.clockintr = (void (*) __P((void *))) handleclock; /* diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index 0de813302338..093440522679 100644 --- a/sys/alpha/alpha/interrupt.c +++ b/sys/alpha/alpha/interrupt.c @@ -67,6 +67,8 @@ dummy_perf(unsigned long vector, struct trapframe *framep) void (*perf_irq)(unsigned long, struct trapframe *) = dummy_perf; +static u_int schedclk2; + void interrupt(a0, a1, a2, framep) unsigned long a0, a1, a2; @@ -95,8 +97,12 @@ interrupt(a0, a1, a2, framep) #else intrcnt[INTRCNT_CLOCK]++; #endif - if (platform.clockintr) + if (platform.clockintr){ (*platform.clockintr)(framep); + /* divide hz (1024) by 8 to get stathz (128) */ + if((++schedclk2 & 0x7) == 0) + statclock((struct clockframe *)framep); + } break; case ALPHA_INTR_ERROR: /* Machine Check or Correctable Error */