Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/xen/xen use nanoseconds since boot counter for dela...
details: https://anonhg.NetBSD.org/src/rev/797b447ab224
branches: trunk
changeset: 565678:797b447ab224
user: cl <cl%NetBSD.org@localhost>
date: Sat Apr 17 21:49:55 2004 +0000
description:
use nanoseconds since boot counter for delay routine
diffstat:
sys/arch/xen/xen/clock.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diffs (48 lines):
diff -r 494bb1a87677 -r 797b447ab224 sys/arch/xen/xen/clock.c
--- a/sys/arch/xen/xen/clock.c Sat Apr 17 18:55:35 2004 +0000
+++ b/sys/arch/xen/xen/clock.c Sat Apr 17 21:49:55 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.3 2004/04/17 12:50:45 cl Exp $ */
+/* $NetBSD: clock.c,v 1.4 2004/04/17 21:49:55 cl Exp $ */
/*
*
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.3 2004/04/17 12:50:45 cl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.4 2004/04/17 21:49:55 cl Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -54,7 +54,7 @@
/* These are peridically updated in shared_info, and then copied here. */
static unsigned long shadow_tsc_stamp;
-static uint64_t shadow_system_time;
+static u_int64_t shadow_system_time;
static unsigned long shadow_time_version;
static struct timeval shadow_tv;
@@ -152,17 +152,12 @@
void
xen_delay(int n)
{
- long last;
+ u_int64_t when;
get_time_values_from_xen();
- last = shadow_tv.tv_usec;
- while (n > 0) {
+ when = shadow_system_time + n * 1000;
+ while (shadow_system_time < when)
get_time_values_from_xen();
- while (last != shadow_tv.tv_usec) {
- last++;
- n--;
- }
- }
}
void
Home |
Main Index |
Thread Index |
Old Index