diff options
author | Raphael Graf <rapha@cvs.openbsd.org> | 2014-06-20 14:08:12 +0000 |
---|---|---|
committer | Raphael Graf <rapha@cvs.openbsd.org> | 2014-06-20 14:08:12 +0000 |
commit | 9079a185b244560082bc7c1e2ca97812aa7a9d7a (patch) | |
tree | 2f0684e54e0a50608c7a02af61bb049f9c93698e /sys/arch/armv7 | |
parent | a06047e4dc9eba84eb4f43bd1a55d0909307cd1c (diff) |
Fix a wrong comparison in the interrupt handler.
ok syl@
Diffstat (limited to 'sys/arch/armv7')
-rw-r--r-- | sys/arch/armv7/omap/dmtimer.c | 6 | ||||
-rw-r--r-- | sys/arch/armv7/omap/gptimer.c | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/arch/armv7/omap/dmtimer.c b/sys/arch/armv7/omap/dmtimer.c index b8fbe794854..3da781f1ca1 100644 --- a/sys/arch/armv7/omap/dmtimer.c +++ b/sys/arch/armv7/omap/dmtimer.c @@ -253,7 +253,7 @@ dmtimer_intr(void *frame) stat_count.ec_count++; statclock(frame); } - if ((now - sc->sc_nexttickevent) < (now - sc->sc_nextstatevent)) + if ((sc->sc_nexttickevent - now) < (sc->sc_nextstatevent - now)) nextevent = sc->sc_nexttickevent; else nextevent = sc->sc_nextstatevent; @@ -261,10 +261,8 @@ dmtimer_intr(void *frame) duration = nextevent - bus_space_read_4(sc->sc_iot, sc->sc_ioh[1], DM_TCRR); - if (duration <= 0) { - printf("%s: negative duration!\n", __func__); + if (duration <= 0) duration = 1; /* trigger immediately. */ - } if (duration > sc->sc_ticks_per_intr + 1) { printf("%s: time lost!\n", __func__); diff --git a/sys/arch/armv7/omap/gptimer.c b/sys/arch/armv7/omap/gptimer.c index a750cf51c5f..e5fd9965ded 100644 --- a/sys/arch/armv7/omap/gptimer.c +++ b/sys/arch/armv7/omap/gptimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gptimer.c,v 1.3 2014/05/08 21:17:01 miod Exp $ */ +/* $OpenBSD: gptimer.c,v 1.4 2014/06/20 14:08:11 rapha Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * @@ -233,7 +233,7 @@ gptimer_intr(void *frame) stat_count.ec_count++; statclock(frame); } - if ((now - nexttickevent) < (now - nextstatevent)) + if ((nexttickevent - now) < (nextstatevent - now)) nextevent = nexttickevent; else nextevent = nextstatevent; |