summaryrefslogtreecommitdiff
path: root/sys/altq
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>2004-06-24 19:35:28 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>2004-06-24 19:35:28 +0000
commitc6cc17e855e1d9fe177fba41d00de6e89fdc852e (patch)
treebdc6bde04c820ca59fe49d60185cf6ac40b44e30 /sys/altq
parent128dd71ffeec48b94e085c757b3626553d619e7c (diff)
This moves access to wall and uptime variables in MI code,
encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
Diffstat (limited to 'sys/altq')
-rw-r--r--sys/altq/altq_subr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/altq/altq_subr.c b/sys/altq/altq_subr.c
index 88785dca41c..8e339d6f762 100644
--- a/sys/altq/altq_subr.c
+++ b/sys/altq/altq_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: altq_subr.c,v 1.17 2004/04/27 02:56:20 kjc Exp $ */
+/* $OpenBSD: altq_subr.c,v 1.18 2004/06/24 19:35:22 tholo Exp $ */
/* $KAME: altq_subr.c,v 1.11 2002/01/11 08:11:49 kjc Exp $ */
/*
@@ -767,6 +767,7 @@ init_machclk(void)
* accessible, just use it.
*/
#if defined(__i386__) && (defined(I586_CPU) || defined(I686_CPU))
+ /* XXX - this will break down with variable cpu frequency. */
machclk_freq = pentium_mhz * 1000000;
#endif
#if defined(__alpha__)
@@ -842,8 +843,8 @@ read_machclk(void)
} else {
struct timeval tv;
- microtime(&tv);
- val = (((u_int64_t)(tv.tv_sec - boottime.tv_sec) * 1000000
+ microuptime(&tv);
+ val = (((u_int64_t)(tv.tv_sec) * 1000000
+ tv.tv_usec) << MACHCLK_SHIFT);
}
return (val);