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 gtmr_intr: If the ISTATUS bit is 0, time...



details:   https://anonhg.NetBSD.org/src/rev/dcb676f5637e
branches:  trunk
changeset: 826509:dcb676f5637e
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Sep 09 13:14:30 2017 +0000

description:
gtmr_intr: If the ISTATUS bit is 0, timer condition is not met. In this
case, just return 0.

diffstat:

 sys/arch/arm/cortex/gtmr.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 00411b213f82 -r dcb676f5637e sys/arch/arm/cortex/gtmr.c
--- a/sys/arch/arm/cortex/gtmr.c        Sat Sep 09 12:28:19 2017 +0000
+++ b/sys/arch/arm/cortex/gtmr.c        Sat Sep 09 13:14:30 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gtmr.c,v 1.19 2017/08/24 13:06:23 jmcneill Exp $       */
+/*     $NetBSD: gtmr.c,v 1.20 2017/09/09 13:14:30 jmcneill Exp $       */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.19 2017/08/24 13:06:23 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.20 2017/09/09 13:14:30 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -292,6 +292,10 @@
 
        arm_isb();
 
+       const uint32_t ctl = armreg_cntv_ctl_read();
+       if ((ctl & ARM_CNTCTL_ISTATUS) == 0)
+               return 0;
+
        const uint64_t now = armreg_cntv_ct_read();
        uint64_t delta = now - ci->ci_lastintr;
 



Home | Main Index | Thread Index | Old Index