Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/broadcom Fix delay.
details: https://anonhg.NetBSD.org/src/rev/1f3ff4b74027
branches: trunk
changeset: 782809:1f3ff4b74027
user: skrll <skrll%NetBSD.org@localhost>
date: Wed Nov 21 08:47:13 2012 +0000
description:
Fix delay.
diffstat:
sys/arch/arm/broadcom/bcm2835_tmr.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diffs (43 lines):
diff -r a59c6b1a7c55 -r 1f3ff4b74027 sys/arch/arm/broadcom/bcm2835_tmr.c
--- a/sys/arch/arm/broadcom/bcm2835_tmr.c Wed Nov 21 08:03:18 2012 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_tmr.c Wed Nov 21 08:47:13 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_tmr.c,v 1.1 2012/07/26 06:21:57 skrll Exp $ */
+/* $NetBSD: bcm2835_tmr.c,v 1.2 2012/11/21 08:47:13 skrll Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_tmr.c,v 1.1 2012/07/26 06:21:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_tmr.c,v 1.2 2012/11/21 08:47:13 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -159,22 +159,19 @@
uint32_t delta, usecs;
KASSERT(sc != NULL);
- int nhloops = 0;
last = bus_space_read_4(sc->sc_iot, sc->sc_ioh, BCM2835_STIMER_CLO);
delta = usecs = 0;
while (n > usecs) {
- if (nhloops++ > 0x100000) Debugger();
curr = bus_space_read_4(sc->sc_iot, sc->sc_ioh,
BCM2835_STIMER_CLO);
- /* XXXNH !?!?!?!?!?!?! - use CHI? */
/* Check to see if the timer has wrapped around. */
if (curr < last)
- delta += (last + (counts_per_hz - curr));
+ delta += curr + (UINT32_MAX - last);
else
- delta += (last - curr);
+ delta += curr - last;
last = curr;
Home |
Main Index |
Thread Index |
Old Index