Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/cortex Don't adjust interval if we are too far ...
details: https://anonhg.NetBSD.org/src/rev/6b18694f5c61
branches: trunk
changeset: 337347:6b18694f5c61
user: matt <matt%NetBSD.org@localhost>
date: Sun Apr 12 17:08:25 2015 +0000
description:
Don't adjust interval if we are too far into the next tick.
diffstat:
sys/arch/arm/cortex/gtmr.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diffs (37 lines):
diff -r ab881a3ad87b -r 6b18694f5c61 sys/arch/arm/cortex/gtmr.c
--- a/sys/arch/arm/cortex/gtmr.c Sun Apr 12 17:05:03 2015 +0000
+++ b/sys/arch/arm/cortex/gtmr.c Sun Apr 12 17:08:25 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gtmr.c,v 1.14 2015/03/27 11:12:08 skrll Exp $ */
+/* $NetBSD: gtmr.c,v 1.15 2015/04/12 17:08:25 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.14 2015/03/27 11:12:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.15 2015/04/12 17:08:25 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -306,12 +306,13 @@
ci->ci_data.cpu_name, delta, sc->sc_autoinc);
/*
- * If we got interrupted too soon (delta < sc->sc_autoinc) or
- * we missed a tick (delta >= 2 * sc->sc_autoinc), don't try to
- * adjust for jitter.
+ * If we got interrupted too soon (delta < sc->sc_autoinc)
+ * or we missed (or almost missed) a tick
+ * (delta >= 7 * sc->sc_autoinc / 4), don't try to adjust for jitter.
*/
- delta -= sc->sc_autoinc;
- if (delta >= sc->sc_autoinc) {
+ if (delta >= sc->sc_autoinc && delta <= 7 * sc->sc_autoinc / 4) {
+ delta -= sc->sc_autoinc;
+ } else {
delta = 0;
}
armreg_cntv_tval_write(sc->sc_autoinc - delta);
Home |
Main Index |
Thread Index |
Old Index