summaryrefslogtreecommitdiff
path: root/sys/dev/clockctl.c
diff options
context:
space:
mode:
authorkardel <kardel@NetBSD.org>2006-06-07 22:33:33 +0000
committerkardel <kardel@NetBSD.org>2006-06-07 22:33:33 +0000
commitde4337ab213f1d688efc566f2a531d4797702afa (patch)
tree739490982edd162b0226b01f0ec9df8b3ec4efc9 /sys/dev/clockctl.c
parentd3390a5a9b73b51a142a58fa60ac0deddb555c02 (diff)
merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone time.tv_sec -> time_second - struct timeval mono_time is gone mono_time.tv_sec -> time_uptime - access to time via {get,}{micro,nano,bin}time() get* versions are fast but less precise - support NTP nanokernel implementation (NTP API 4) - further reading: Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
Diffstat (limited to 'sys/dev/clockctl.c')
-rw-r--r--sys/dev/clockctl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/clockctl.c b/sys/dev/clockctl.c
index a95000cb64f..a2f4281b2ac 100644
--- a/sys/dev/clockctl.c
+++ b/sys/dev/clockctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: clockctl.c,v 1.16 2006/03/09 23:44:43 christos Exp $ */
+/* $NetBSD: clockctl.c,v 1.17 2006/06/07 22:33:34 kardel Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.16 2006/03/09 23:44:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.17 2006/06/07 22:33:34 kardel Exp $");
#include "opt_ntp.h"
@@ -119,8 +119,12 @@ clockctlioctl(dev, cmd, data, flags, l)
if (error)
return (error);
- error = ntp_adjtime1(&ntv, args, &retval);
- (void)copyout(&retval, &args->retval, sizeof(retval));
+ ntp_adjtime1(&ntv);
+
+ error = copyout(&ntv, args->tp, sizeof(ntv));
+ if (error == 0)
+ (void)copyout(&retval, &args->retval, sizeof(retval));
+
return (error);
}
#endif /* NTP */