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.
This commit is contained in:
pooka 2013-05-02 21:45:28 +00:00
parent 54f4ed2e2a
commit 5606f9bf46
4 changed files with 15 additions and 13 deletions

View File

@ -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 @@ rumpuser_iovwrite(int fd, const struct rumpuser_iovec *ruiov, size_t iovlen,
}
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 @@ rumpuser_clock_gettime(enum rumpclock rclk, uint64_t *sec, uint64_t *nsec)
}
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;

View File

@ -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 @@ int rumpuser_iovwrite(int, const struct rumpuser_iovec *, size_t,
*/
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

View File

@ -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 @@ static void
doclock(void *noarg)
{
struct timespec thetick, curclock;
uint64_t sec, nsec;
int64_t sec;
long nsec;
int error;
extern int hz;

View File

@ -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 @@ rump_init(void)
{
char buf[256];
struct timespec ts;
uint64_t sec, nsec;
int64_t sec;
long nsec;
struct lwp *l;
int i, numcpu;