diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-01-03 17:59:33 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-01-03 17:59:33 +0000 |
commit | d9282dc964cb8afe064d9454467d83e4cc011900 (patch) | |
tree | 560d1af3c7f912757775ec8d7e8a9f44ebe65902 /sys/arch/arm/xscale/pxa2x0.c | |
parent | b6068a5c1566025ae04c45e5fd0ae1f7c53ea5e9 (diff) |
Move zaurus to __HAVE_TIMECOUNTER.
ok deraadt@
Diffstat (limited to 'sys/arch/arm/xscale/pxa2x0.c')
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0.c b/sys/arch/arm/xscale/pxa2x0.c index a3fed5406d9..5fdd3a4b607 100644 --- a/sys/arch/arm/xscale/pxa2x0.c +++ b/sys/arch/arm/xscale/pxa2x0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0.c,v 1.11 2005/11/11 23:59:58 deraadt Exp $ */ +/* $OpenBSD: pxa2x0.c,v 1.12 2008/01/03 17:59:32 kettenis Exp $ */ /* $NetBSD: pxa2x0.c,v 1.5 2003/12/12 16:42:44 thorpej Exp $ */ /* @@ -108,6 +108,7 @@ __KERNEL_RCSID(0, "$NetBSD: pxa2x0.c,v 1.5 2003/12/12 16:42:44 thorpej Exp $"); #include <sys/device.h> #include <sys/kernel.h> #include <sys/reboot.h> +#include <sys/timetc.h> #include <machine/cpu.h> #include <machine/bus.h> @@ -437,15 +438,19 @@ void resettodr(void) { struct pxaip_softc *sc = pxaip_sc; + struct timeval tv; + + microtime(&tv); bus_space_write_4(sc->sc_bust, sc->sc_bush_rtc, RTC_RCNR, - (u_int32_t)time.tv_sec); + (u_int32_t)tv.tv_sec); } void inittodr(time_t base) { struct pxaip_softc *sc = pxaip_sc; + struct timespec ts; u_int32_t rcnr; /* XXX decide if RCNR can be valid, based on the last reset @@ -454,11 +459,12 @@ inittodr(time_t base) /* XXX check how much RCNR differs from the filesystem date. */ if (rcnr > base) - time.tv_sec = rcnr; + ts.tv_sec = rcnr; else { printf("WARNING: using filesystem date -- CHECK AND RESET THE DATE!\n"); - time.tv_sec = base; + ts.tv_sec = base; } - time.tv_usec = 0; + ts.tv_nsec = 0; + tc_setclock(&ts); } |