From 2c305bdb3cb1584f703cf5fcca5d22c3b087af36 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 6 Nov 1994 01:33:03 +0000 Subject: [PATCH] Nuke the losing version of microtime. The assembler version now works for all reasonable HZ's. HZ > 1000 doesn't work because of sloppy conversions in hzto() (division by (tick / 1000) == 0). This was fixed in 1.1.5. Eliminate some extern declarations by including the appropriate header files that now contain appropriate declarations. --- sys/amd64/amd64/machdep.c | 32 ++++++-------------------------- sys/i386/i386/machdep.c | 32 ++++++-------------------------- 2 files changed, 12 insertions(+), 52 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 532bad2d2a33..8dc1ac53fa88 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.84 1994/11/01 06:04:12 ache Exp $ + * $Id: machdep.c,v 1.85 1994/11/03 14:57:54 jkh Exp $ */ #include "npx.h" @@ -83,17 +83,21 @@ extern vm_offset_t avail_start, avail_end; +#include "ether.h" + #include +#include #include #include +#include #include #include #include #include #include +#include #include -#include static void identifycpu(void); static void initcpu(void); @@ -135,7 +139,6 @@ extern int freebufspace; int msgbufmapped = 0; /* set when safe to use msgbuf */ int _udatasel, _ucodesel; -extern int adjkerntz, disable_rtc_set; /* from clock.c */ /* * Machine-dependent startup code @@ -415,8 +418,6 @@ identifycpu() printf("-class CPU)"); #ifdef I586_CPU if(cpu_class == CPUCLASS_586) { - extern void calibrate_cyclecounter(); - extern int pentium_mhz; calibrate_cyclecounter(); printf(" %d MHz", pentium_mhz); } @@ -844,27 +845,6 @@ dumpsys() } } -#ifdef HZ -/* - * If HZ is defined we use this code, otherwise the code in - * /sys/i386/i386/microtime.s is used. The othercode only works - * for HZ=100. - */ -microtime(tvp) - register struct timeval *tvp; -{ - int s = splhigh(); - - *tvp = time; - tvp->tv_usec += tick; - while (tvp->tv_usec > 1000000) { - tvp->tv_sec++; - tvp->tv_usec -= 1000000; - } - splx(s); -} -#endif /* HZ */ - static void initcpu() { diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 532bad2d2a33..8dc1ac53fa88 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.84 1994/11/01 06:04:12 ache Exp $ + * $Id: machdep.c,v 1.85 1994/11/03 14:57:54 jkh Exp $ */ #include "npx.h" @@ -83,17 +83,21 @@ extern vm_offset_t avail_start, avail_end; +#include "ether.h" + #include +#include #include #include +#include #include #include #include #include #include +#include #include -#include static void identifycpu(void); static void initcpu(void); @@ -135,7 +139,6 @@ extern int freebufspace; int msgbufmapped = 0; /* set when safe to use msgbuf */ int _udatasel, _ucodesel; -extern int adjkerntz, disable_rtc_set; /* from clock.c */ /* * Machine-dependent startup code @@ -415,8 +418,6 @@ identifycpu() printf("-class CPU)"); #ifdef I586_CPU if(cpu_class == CPUCLASS_586) { - extern void calibrate_cyclecounter(); - extern int pentium_mhz; calibrate_cyclecounter(); printf(" %d MHz", pentium_mhz); } @@ -844,27 +845,6 @@ dumpsys() } } -#ifdef HZ -/* - * If HZ is defined we use this code, otherwise the code in - * /sys/i386/i386/microtime.s is used. The othercode only works - * for HZ=100. - */ -microtime(tvp) - register struct timeval *tvp; -{ - int s = splhigh(); - - *tvp = time; - tvp->tv_usec += tick; - while (tvp->tv_usec > 1000000) { - tvp->tv_sec++; - tvp->tv_usec -= 1000000; - } - splx(s); -} -#endif /* HZ */ - static void initcpu() {