Subject: timecounter patch....
To: None <port-news68k@netbsd.org>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: port-news68k
Date: 09/08/2006 18:26:05
This is a multi-part message in MIME format.
--------------080508040109040804080309
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

The news68k port doesn't look at any hardware timer for microtime, so
this trivial diff makes it compatible with timecounters.  Please test
and commit. :-)  Or ask me to commit. :-)

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191


--------------080508040109040804080309
Content-Type: text/x-patch;
 name="news68k.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="news68k.diff"

Index: sys/arch/news68k/include/types.h
===================================================================
RCS file: /cvsroot/src/sys/arch/news68k/include/types.h,v
retrieving revision 1.6
diff -d -p -u -r1.6 types.h
--- sys/arch/news68k/include/types.h	4 Sep 2006 20:32:57 -0000	1.6
+++ sys/arch/news68k/include/types.h	9 Sep 2006 01:23:15 -0000
@@ -3,3 +3,4 @@
 #include <m68k/types.h>
 
 #define	__HAVE_GENERIC_TODR
+#define	__HAVE_TIMECOUNTER
Index: sys/arch/news68k/news68k/clock.c
===================================================================
RCS file: /cvsroot/src/sys/arch/news68k/news68k/clock.c,v
retrieving revision 1.16
diff -d -p -u -r1.16 clock.c
--- sys/arch/news68k/news68k/clock.c	4 Sep 2006 20:32:57 -0000	1.16
+++ sys/arch/news68k/news68k/clock.c	9 Sep 2006 01:23:15 -0000
@@ -98,36 +98,3 @@ setstatclockrate(int newhz)
 
 	/* nothing to do */
 }
-
-/*
- * Return the best possible estimate of the time in the timeval
- * to which tvp points.  We do this by returning the current time
- * plus the amount of time since the last clock interrupt (clock.c:clkread).
- *
- * Check that this time is no less than any previously-reported time,
- * which could happen around the time of a clock adjustment.  Just for fun,
- * we guarantee that the time will be greater than the value obtained by a
- * previous call.
- */
-
-void
-microtime(struct timeval *tvp)
-{
-	int s = splhigh();
-	static struct timeval lasttime;
-
-	*tvp = time;
-	tvp->tv_usec++;
-	while (tvp->tv_usec >= 1000000) {
-		tvp->tv_sec++;
-		tvp->tv_usec -= 1000000;
-	}
-	if (tvp->tv_sec == lasttime.tv_sec &&
-	    tvp->tv_usec <= lasttime.tv_usec &&
-	    (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) {
-		tvp->tv_sec++;
-		tvp->tv_usec -= 1000000;
-	}
-	lasttime = *tvp;
-	splx(s);
-}

--------------080508040109040804080309--