Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Introduced nanotime() which is going to be used by some ...



details:   https://anonhg.NetBSD.org/src/rev/70b37eddbfb4
branches:  trunk
changeset: 584286:70b37eddbfb4
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Sep 12 16:21:31 2005 +0000

description:
Introduced nanotime() which is going to be used by some fs code yet to
be committed. This should really be an MD routine and microtime should
be implemented from it, not the opposite (which is what we have now).

diffstat:

 sys/kern/kern_clock.c |  17 +++++++++++++++--
 sys/sys/time.h        |   5 +++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diffs (54 lines):

diff -r cb4450a44a84 -r 70b37eddbfb4 sys/kern/kern_clock.c
--- a/sys/kern/kern_clock.c     Mon Sep 12 16:16:23 2005 +0000
+++ b/sys/kern/kern_clock.c     Mon Sep 12 16:21:31 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_clock.c,v 1.94 2005/03/02 11:05:34 mycroft Exp $  */
+/*     $NetBSD: kern_clock.c,v 1.95 2005/09/12 16:21:31 christos Exp $ */
 
 /*-
  * Copyright (c) 2000, 2004 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.94 2005/03/02 11:05:34 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.95 2005/09/12 16:21:31 christos Exp $");
 
 #include "opt_ntp.h"
 #include "opt_multiprocessor.h"
@@ -1431,3 +1431,16 @@
 }
 #endif /* PPS_SYNC */
 #endif /* NTP  */
+
+/*
+ * XXX: Until all md code has it.
+ */
+struct timespec *
+nanotime(struct timespec *ts)
+{
+       struct timeval tv;
+
+       microtime(&tv);
+       TIMEVAL_TO_TIMESPEC(&tv, ts);
+       return ts;
+}
diff -r cb4450a44a84 -r 70b37eddbfb4 sys/sys/time.h
--- a/sys/sys/time.h    Mon Sep 12 16:16:23 2005 +0000
+++ b/sys/sys/time.h    Mon Sep 12 16:21:31 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: time.h,v 1.49 2005/07/23 19:43:01 cube Exp $   */
+/*     $NetBSD: time.h,v 1.50 2005/09/12 16:21:31 christos Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -212,7 +212,8 @@
 int    itimerfix(struct timeval *tv);
 int    itimerdecr(struct ptimer *, int);
 void   itimerfire(struct ptimer *);
-void   microtime(struct timeval *tv);
+void   microtime(struct timeval *);
+struct timespec        *nanotime(struct timespec *);
 int    settime(struct timeval *);
 int    ratecheck(struct timeval *, const struct timeval *);
 int    ppsratecheck(struct timeval *, int *, int);



Home | Main Index | Thread Index | Old Index