Add a #define for nanouptime() in the !__HAVE_TIMECOUNTERS case.

This commit is contained in:
dsl 2007-05-13 10:58:50 +00:00
parent 1c85a3efd8
commit 88e6c5604d
2 changed files with 6 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_time.c,v 1.120 2007/05/13 10:34:25 dsl Exp $ */
/* $NetBSD: kern_time.c,v 1.121 2007/05/13 10:58:51 dsl Exp $ */
/*-
* Copyright (c) 2000, 2004, 2005 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.120 2007/05/13 10:34:25 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.121 2007/05/13 10:58:51 dsl Exp $");
#include <sys/param.h>
#include <sys/resourcevar.h>
@ -215,18 +215,7 @@ sys_clock_gettime(struct lwp *l, void *v, register_t *retval)
nanotime(&ats);
break;
case CLOCK_MONOTONIC:
#ifdef __HAVE_TIMECOUNTER
nanouptime(&ats);
#else /* !__HAVE_TIMECOUNTER */
{
int s;
/* XXX "hz" granularity */
s = splclock();
TIMEVAL_TO_TIMESPEC(&mono_time,&ats);
splx(s);
}
#endif /* !__HAVE_TIMECOUNTER */
break;
default:
return (EINVAL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: timevar.h,v 1.9 2007/05/13 10:34:25 dsl Exp $ */
/* $NetBSD: timevar.h,v 1.10 2007/05/13 10:58:50 dsl Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation.
@ -206,6 +206,9 @@ extern volatile struct timeval time;
#define time_second time.tv_sec
#define time_uptime mono_time.tv_sec
#define tc_getfrequency() hz
#define nanouptime(ats) do { int _s = splclock(); \
TIMEVAL_TO_TIMESPEC(&mono_time, ats); \
splx(_s); } while (0)
#endif /* !__HAVE_TIMECOUNTER */
#endif /* !_SYS_TIMEVAR_H_ */