Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Ok, maybe using int64 for nanoseconds in the (sec, nsec) tupl...
details: https://anonhg.NetBSD.org/src/rev/702875f61ad9
branches: trunk
changeset: 786591:702875f61ad9
user: pooka <pooka%NetBSD.org@localhost>
date: Thu May 02 21:45:28 2013 +0000
description:
Ok, maybe using int64 for nanoseconds in the (sec,nsec) tuple was
a bit too future-proof. I think long is enough there (let's just
hope nobody redefines "nano"). Also, make seconds signed just in
case someone wants their clock to be in 1901.
diffstat:
lib/librumpuser/rumpuser.c | 8 ++++----
sys/rump/include/rump/rumpuser.h | 6 +++---
sys/rump/librump/rumpkern/intr.c | 7 ++++---
sys/rump/librump/rumpkern/rump.c | 7 ++++---
4 files changed, 15 insertions(+), 13 deletions(-)
diffs (112 lines):
diff -r 3bd7250c54bb -r 702875f61ad9 lib/librumpuser/rumpuser.c
--- a/lib/librumpuser/rumpuser.c Thu May 02 21:40:57 2013 +0000
+++ b/lib/librumpuser/rumpuser.c Thu May 02 21:45:28 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser.c,v 1.49 2013/05/01 17:17:54 pooka Exp $ */
+/* $NetBSD: rumpuser.c,v 1.50 2013/05/02 21:45:29 pooka Exp $ */
/*
* Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved.
@@ -28,7 +28,7 @@
#include "rumpuser_port.h"
#if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.49 2013/05/01 17:17:54 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.50 2013/05/02 21:45:29 pooka Exp $");
#endif /* !lint */
#include <sys/ioctl.h>
@@ -395,7 +395,7 @@
}
int
-rumpuser_clock_gettime(enum rumpclock rclk, uint64_t *sec, uint64_t *nsec)
+rumpuser_clock_gettime(enum rumpclock rclk, int64_t *sec, long *nsec)
{
struct timespec ts;
clockid_t clk;
@@ -428,7 +428,7 @@
}
int
-rumpuser_clock_sleep(enum rumpclock clk, uint64_t sec, uint64_t nsec)
+rumpuser_clock_sleep(enum rumpclock clk, int64_t sec, long nsec)
{
struct timespec rqt, rmt;
int nlocks;
diff -r 3bd7250c54bb -r 702875f61ad9 sys/rump/include/rump/rumpuser.h
--- a/sys/rump/include/rump/rumpuser.h Thu May 02 21:40:57 2013 +0000
+++ b/sys/rump/include/rump/rumpuser.h Thu May 02 21:45:28 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser.h,v 1.102 2013/05/02 21:35:19 pooka Exp $ */
+/* $NetBSD: rumpuser.h,v 1.103 2013/05/02 21:45:28 pooka Exp $ */
/*
* Copyright (c) 2007-2013 Antti Kantee. All Rights Reserved.
@@ -114,8 +114,8 @@
*/
enum rumpclock { RUMPUSER_CLOCK_RELWALL, RUMPUSER_CLOCK_ABSMONO };
-int rumpuser_clock_gettime(enum rumpclock, uint64_t *, uint64_t *);
-int rumpuser_clock_sleep(enum rumpclock, uint64_t, uint64_t);
+int rumpuser_clock_gettime(enum rumpclock, int64_t *, long *);
+int rumpuser_clock_sleep(enum rumpclock, int64_t, long);
/*
* host information retrieval
diff -r 3bd7250c54bb -r 702875f61ad9 sys/rump/librump/rumpkern/intr.c
--- a/sys/rump/librump/rumpkern/intr.c Thu May 02 21:40:57 2013 +0000
+++ b/sys/rump/librump/rumpkern/intr.c Thu May 02 21:45:28 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.39 2013/04/30 16:03:44 pooka Exp $ */
+/* $NetBSD: intr.c,v 1.40 2013/05/02 21:45:28 pooka Exp $ */
/*
* Copyright (c) 2008-2010 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.39 2013/04/30 16:03:44 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.40 2013/05/02 21:45:28 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -100,7 +100,8 @@
doclock(void *noarg)
{
struct timespec thetick, curclock;
- uint64_t sec, nsec;
+ int64_t sec;
+ long nsec;
int error;
extern int hz;
diff -r 3bd7250c54bb -r 702875f61ad9 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c Thu May 02 21:40:57 2013 +0000
+++ b/sys/rump/librump/rumpkern/rump.c Thu May 02 21:45:28 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump.c,v 1.267 2013/05/02 19:15:01 pooka Exp $ */
+/* $NetBSD: rump.c,v 1.268 2013/05/02 21:45:28 pooka Exp $ */
/*
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.267 2013/05/02 19:15:01 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.268 2013/05/02 21:45:28 pooka Exp $");
#include <sys/systm.h>
#define ELFSIZE ARCH_ELFSIZE
@@ -235,7 +235,8 @@
{
char buf[256];
struct timespec ts;
- uint64_t sec, nsec;
+ int64_t sec;
+ long nsec;
struct lwp *l;
int i, numcpu;
Home |
Main Index |
Thread Index |
Old Index