Module Name:    src
Committed By:   matt
Date:           Thu Sep 27 00:23:27 UTC 2012

Modified Files:
        src/sys/arch/arm/cortex: a9tmr.c a9tmr_var.h

Log Message:
Don't bother dealing with "extra" ticks, just count them.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/cortex/a9tmr.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/cortex/a9tmr_var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/cortex/a9tmr.c
diff -u src/sys/arch/arm/cortex/a9tmr.c:1.2 src/sys/arch/arm/cortex/a9tmr.c:1.3
--- src/sys/arch/arm/cortex/a9tmr.c:1.2	Fri Sep 14 03:52:19 2012
+++ src/sys/arch/arm/cortex/a9tmr.c	Thu Sep 27 00:23:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9tmr.c,v 1.2 2012/09/14 03:52:19 matt Exp $	*/
+/*	$NetBSD: a9tmr.c,v 1.3 2012/09/27 00:23:27 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.2 2012/09/14 03:52:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.3 2012/09/27 00:23:27 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -134,6 +134,9 @@ a9tmr_attach(device_t parent, device_t s
 	sc->sc_memt = mpcaa->mpcaa_memt;
 	sc->sc_memh = mpcaa->mpcaa_memh;
 
+	evcnt_attach_dynamic(&sc->sc_ev_missing_ticks, EVCNT_TYPE_MISC, NULL,
+	    device_xname(self), "missing interrupts");
+
 	bus_space_subregion(sc->sc_memt, sc->sc_memh, 
 	    TMR_GLOBAL_BASE, TMR_GLOBAL_BASE, &sc->sc_global_memh);
 	bus_space_subregion(sc->sc_memt, sc->sc_memh, 
@@ -298,6 +301,7 @@ clockhandler(void *arg)
 
 	hardclock(cf);
 
+#if 0
 	/*
 	 * Try to make up up to a seconds amount of missed clock interrupts
 	 */
@@ -307,6 +311,10 @@ clockhandler(void *arg)
 	     delta -= sc->sc_autoinc, ticks--) {
 		hardclock(cf);
 	}
+#else
+	if (delta > sc->sc_autoinc)
+		sc->sc_ev_missing_ticks.ev_count += delta / sc->sc_autoinc;
+#endif
 
 	return 1;
 }

Index: src/sys/arch/arm/cortex/a9tmr_var.h
diff -u src/sys/arch/arm/cortex/a9tmr_var.h:1.1 src/sys/arch/arm/cortex/a9tmr_var.h:1.2
--- src/sys/arch/arm/cortex/a9tmr_var.h:1.1	Sat Sep  1 00:03:14 2012
+++ src/sys/arch/arm/cortex/a9tmr_var.h	Thu Sep 27 00:23:27 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: a9tmr_var.h,v 1.1 2012/09/01 00:03:14 matt Exp $ */
+/* $NetBSD: a9tmr_var.h,v 1.2 2012/09/27 00:23:27 matt Exp $ */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,6 +38,7 @@ struct a9tmr_softc {
 	bus_space_handle_t sc_global_memh;
 	bus_space_handle_t sc_private_memh;
 	bus_space_handle_t sc_wdog_memh;
+	struct evcnt sc_ev_missing_ticks;
 	u_long sc_freq;
 	u_long sc_autoinc;
 	void *sc_global_ih;

Reply via email to