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 Add a KASSERT to make sure the counter i...
details: https://anonhg.NetBSD.org/src/rev/161f8082adc6
branches: trunk
changeset: 329823:161f8082adc6
user: matt <matt%NetBSD.org@localhost>
date: Wed Jun 11 05:50:46 2014 +0000
description:
Add a KASSERT to make sure the counter is running.
diffstat:
sys/arch/arm/cortex/gtmr.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diffs (65 lines):
diff -r 917a64b89ef5 -r 161f8082adc6 sys/arch/arm/cortex/gtmr.c
--- a/sys/arch/arm/cortex/gtmr.c Wed Jun 11 05:43:39 2014 +0000
+++ b/sys/arch/arm/cortex/gtmr.c Wed Jun 11 05:50:46 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gtmr.c,v 1.7 2014/04/13 02:22:21 matt Exp $ */
+/* $NetBSD: gtmr.c,v 1.8 2014/06/11 05:50:46 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.7 2014/04/13 02:22:21 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.8 2014/06/11 05:50:46 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -140,6 +140,11 @@
"cp15 CNT_FRQ (%u) differs from supplied frequency\n",
cnt_frq);
}
+
+ gtmr_timecounter.tc_name = device_xname(sc->sc_dev);
+ gtmr_timecounter.tc_frequency = sc->sc_freq;
+
+ tc_init(>mr_timecounter);
}
void
@@ -150,10 +155,14 @@
KASSERT(ci == curcpu());
int s = splsched();
+
/*
* enable timer and stop masking the timer.
*/
armreg_cntv_ctl_write(ARM_CNTCTL_ENABLE);
+#if 0
+ printf("%s: cntctl=%#x\n", __func__, armreg_cntv_ctl_read());
+#endif
/*
* Get now and update the compare timer.
@@ -166,6 +175,7 @@
armreg_cntv_cval_read() - ci->ci_lastintr);
#endif
splx(s);
+ KASSERT(armreg_cntv_ct_read() != 0);
#if 0
printf("%s: %s: ctl %#x cmp %#"PRIx64" now %#"PRIx64"\n",
__func__, ci->ci_data.cpu_name, armreg_cntv_ctl_read(),
@@ -210,11 +220,6 @@
sc->sc_autoinc = sc->sc_freq / hz;
gtmr_init_cpu_clock(curcpu());
-
- gtmr_timecounter.tc_name = device_xname(sc->sc_dev);
- gtmr_timecounter.tc_frequency = sc->sc_freq;
-
- tc_init(>mr_timecounter);
}
void
Home |
Main Index |
Thread Index |
Old Index