Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Adjust evbmips_iointr to pass a clockframe pointer and u...



details:   https://anonhg.NetBSD.org/src/rev/63d03bfd9419
branches:  trunk
changeset: 817579:63d03bfd9419
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Aug 26 15:45:47 2016 +0000

description:
Adjust evbmips_iointr to pass a clockframe pointer and use it for
pwmclock @ voyager.

Suggested by matt@

Hi macallan!

diffstat:

 sys/arch/algor/algor/algor_intr.c         |   8 ++++----
 sys/arch/evbmips/alchemy/mach_intr.c      |   8 ++++----
 sys/arch/evbmips/atheros/mach_intr.c      |   8 ++++----
 sys/arch/evbmips/cavium/mach_intr.c       |   8 ++++----
 sys/arch/evbmips/evbmips/interrupt.c      |  16 ++++++++--------
 sys/arch/evbmips/gdium/gdium_intr.c       |   6 +++---
 sys/arch/evbmips/include/intr.h           |   6 ++++--
 sys/arch/evbmips/ingenic/clock.c          |  11 +++++------
 sys/arch/evbmips/ingenic/intr.c           |  15 +++++++--------
 sys/arch/evbmips/loongson/loongson_intr.c |  13 ++++++++-----
 sys/arch/evbmips/malta/malta_intr.c       |   6 +++---
 sys/arch/mips/adm5120/adm5120_intr.c      |   6 +++---
 sys/arch/mips/ralink/ralink_intr.c        |   6 +++---
 sys/arch/mips/rmi/rmixl_intr.c            |   8 ++++----
 sys/dev/pci/voyager/pwmclock.c            |  13 +++++++------
 15 files changed, 71 insertions(+), 67 deletions(-)

diffs (truncated from 540 to 300 lines):

diff -r 700f87a1111f -r 63d03bfd9419 sys/arch/algor/algor/algor_intr.c
--- a/sys/arch/algor/algor/algor_intr.c Fri Aug 26 15:41:02 2016 +0000
+++ b/sys/arch/algor/algor/algor_intr.c Fri Aug 26 15:45:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: algor_intr.c,v 1.1 2011/07/09 16:03:00 matt Exp $      */
+/*     $NetBSD: algor_intr.c,v 1.2 2016/08/26 15:45:47 skrll Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: algor_intr.c,v 1.1 2011/07/09 16:03:00 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: algor_intr.c,v 1.2 2016/08/26 15:45:47 skrll Exp $");
 
 #define        __INTR_PRIVATE
 #include "opt_algor_p4032.h"
@@ -102,9 +102,9 @@
 
 #ifdef evbmips
 void
-evbmips_iointr(int ipl, vaddr_t pc, uint32_t pending)
+evbmips_iointr(int ipl, uint32_t pending, struct clockframe *cf)
 {
-       (*algor_iointr)(ipl, pc, pending);
+       (*algor_iointr)(ipl, cf->pc, pending);
 }
 
 void *
diff -r 700f87a1111f -r 63d03bfd9419 sys/arch/evbmips/alchemy/mach_intr.c
--- a/sys/arch/evbmips/alchemy/mach_intr.c      Fri Aug 26 15:41:02 2016 +0000
+++ b/sys/arch/evbmips/alchemy/mach_intr.c      Fri Aug 26 15:45:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_intr.c,v 1.6 2011/07/10 00:03:52 matt Exp $       */
+/*     $NetBSD: mach_intr.c,v 1.7 2016/08/26 15:45:47 skrll Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_intr.c,v 1.6 2011/07/10 00:03:52 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_intr.c,v 1.7 2016/08/26 15:45:47 skrll Exp $");
 
 #include "opt_ddb.h"
 
@@ -61,8 +61,8 @@
 }
 
 void
-evbmips_iointr(int ipl, uint32_t pc, uint32_t ipending)
+evbmips_iointr(int ipl, uint32_t ipending, struct clockframe *cf)
 {
 
-       au_iointr(ipl, pc, ipending);
+       au_iointr(ipl, cf->pc, ipending);
 }
diff -r 700f87a1111f -r 63d03bfd9419 sys/arch/evbmips/atheros/mach_intr.c
--- a/sys/arch/evbmips/atheros/mach_intr.c      Fri Aug 26 15:41:02 2016 +0000
+++ b/sys/arch/evbmips/atheros/mach_intr.c      Fri Aug 26 15:45:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_intr.c,v 1.6 2011/07/10 00:03:53 matt Exp $       */
+/*     $NetBSD: mach_intr.c,v 1.7 2016/08/26 15:45:47 skrll Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_intr.c,v 1.6 2011/07/10 00:03:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_intr.c,v 1.7 2016/08/26 15:45:47 skrll Exp $");
 
 #include "opt_ddb.h"
 
@@ -55,8 +55,8 @@
 }
 
 void
-evbmips_iointr(int ipl, vaddr_t pc, uint32_t ipending)
+evbmips_iointr(int ipl, uint32_t ipending, struct clockframe *cf)
 {
 
-       (*platformsw->apsw_intrsw->aisw_iointr)(ipl, pc, ipending);
+       (*platformsw->apsw_intrsw->aisw_iointr)(ipl, cf->pc, ipending);
 }
diff -r 700f87a1111f -r 63d03bfd9419 sys/arch/evbmips/cavium/mach_intr.c
--- a/sys/arch/evbmips/cavium/mach_intr.c       Fri Aug 26 15:41:02 2016 +0000
+++ b/sys/arch/evbmips/cavium/mach_intr.c       Fri Aug 26 15:45:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_intr.c,v 1.2 2015/06/01 22:55:12 matt Exp $       */
+/*     $NetBSD: mach_intr.c,v 1.3 2016/08/26 15:45:47 skrll Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_intr.c,v 1.2 2015/06/01 22:55:12 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_intr.c,v 1.3 2016/08/26 15:45:47 skrll Exp $");
 
 #include "opt_ddb.h"
 
@@ -61,8 +61,8 @@
 }
 
 void
-evbmips_iointr(int ipl, vaddr_t pc, uint32_t ipending)
+evbmips_iointr(int ipl, uint32_t ipending, struct clockframe *cf)
 {
 
-       octeon_iointr(ipl, pc, ipending);
+       octeon_iointr(ipl, cf->pc, ipending);
 }
diff -r 700f87a1111f -r 63d03bfd9419 sys/arch/evbmips/evbmips/interrupt.c
--- a/sys/arch/evbmips/evbmips/interrupt.c      Fri Aug 26 15:41:02 2016 +0000
+++ b/sys/arch/evbmips/evbmips/interrupt.c      Fri Aug 26 15:45:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interrupt.c,v 1.23 2016/08/26 07:07:29 skrll Exp $     */
+/*     $NetBSD: interrupt.c,v 1.24 2016/08/26 15:45:47 skrll Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.23 2016/08/26 07:07:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.24 2016/08/26 15:45:47 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -72,14 +72,14 @@
                    "%s: cpl (%d) != ipl (%d)", __func__, ci->ci_cpl, ipl);
                KASSERT(pending != 0);
 
+               struct clockframe cf = {
+                       .pc = pc,
+                       .sr = status,
+                       .intr = (ci->ci_idepth > 1)
+               };
 
 #ifdef MIPS3_ENABLE_CLOCK_INTR
                if (pending & MIPS_INT_MASK_5) {
-                       struct clockframe cf;
-
-                       cf.pc = pc;
-                       cf.sr = status;
-                       cf.intr = (ci->ci_idepth > 1);
 
                        KASSERTMSG(ipl == IPL_SCHED,
                            "%s: ipl (%d) != IPL_SCHED (%d)",
@@ -92,7 +92,7 @@
 
                if (pending != 0) {
                        /* Process I/O and error interrupts. */
-                       evbmips_iointr(ipl, pc, pending);
+                       evbmips_iointr(ipl, pending, &cf);
                }
                KASSERT(biglock_count == ci->ci_biglock_count);
                KASSERT(blcnt == curlwp->l_blcnt);
diff -r 700f87a1111f -r 63d03bfd9419 sys/arch/evbmips/gdium/gdium_intr.c
--- a/sys/arch/evbmips/gdium/gdium_intr.c       Fri Aug 26 15:41:02 2016 +0000
+++ b/sys/arch/evbmips/gdium/gdium_intr.c       Fri Aug 26 15:45:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdium_intr.c,v 1.7 2014/03/29 19:28:28 christos Exp $  */
+/*     $NetBSD: gdium_intr.c,v 1.8 2016/08/26 15:45:47 skrll Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdium_intr.c,v 1.7 2014/03/29 19:28:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdium_intr.c,v 1.8 2016/08/26 15:45:47 skrll Exp $");
 
 #define __INTR_PRIVATE
 
@@ -297,7 +297,7 @@
 }
 
 void
-evbmips_iointr(int ipl, vaddr_t pc, uint32_t ipending)
+evbmips_iointr(int ipl, uint32_t ipending, struct clockframe *cf)
 {
        struct evbmips_intrhand *ih;
        int level;
diff -r 700f87a1111f -r 63d03bfd9419 sys/arch/evbmips/include/intr.h
--- a/sys/arch/evbmips/include/intr.h   Fri Aug 26 15:41:02 2016 +0000
+++ b/sys/arch/evbmips/include/intr.h   Fri Aug 26 15:45:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.19 2011/07/09 16:03:01 matt Exp $   */
+/*     $NetBSD: intr.h,v 1.20 2016/08/26 15:45:47 skrll Exp $  */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -46,9 +46,11 @@
        int ih_ipl;
 };
 
+struct clockframe;
+
 void   intr_init(void);
 void   evbmips_intr_init(void);
-void   evbmips_iointr(int, vaddr_t, uint32_t);
+void   evbmips_iointr(int, uint32_t, struct clockframe *);
 void   *evbmips_intr_establish(int, int (*)(void *), void *);
 void   evbmips_intr_disestablish(void *);
 
diff -r 700f87a1111f -r 63d03bfd9419 sys/arch/evbmips/ingenic/clock.c
--- a/sys/arch/evbmips/ingenic/clock.c  Fri Aug 26 15:41:02 2016 +0000
+++ b/sys/arch/evbmips/ingenic/clock.c  Fri Aug 26 15:45:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.7 2016/01/29 01:54:14 macallan Exp $ */
+/*     $NetBSD: clock.c,v 1.8 2016/08/26 15:45:48 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.7 2016/01/29 01:54:14 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.8 2016/08/26 15:45:48 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -44,7 +44,7 @@
 
 extern void ingenic_puts(const char *);
 
-void ingenic_clockintr(uint32_t);
+void ingenic_clockintr(struct clockframe *);
 
 static u_int
 ingenic_count_read(struct timecounter *tc)
@@ -191,9 +191,8 @@
 #endif
 
 void
-ingenic_clockintr(uint32_t id)
+ingenic_clockintr(struct clockframe *cf)
 {
-       extern struct clockframe cf;
        int s = splsched();
        struct cpu_info * const ci = curcpu();
 #ifdef USE_OST
@@ -239,6 +238,6 @@
         */
        MTC0(1 << IPI_CLOCK, 20, 1);
 #endif
-       hardclock(&cf);
+       hardclock(cf);
        splx(s);
 }
diff -r 700f87a1111f -r 63d03bfd9419 sys/arch/evbmips/ingenic/intr.c
--- a/sys/arch/evbmips/ingenic/intr.c   Fri Aug 26 15:41:02 2016 +0000
+++ b/sys/arch/evbmips/ingenic/intr.c   Fri Aug 26 15:45:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.10 2016/01/29 01:54:14 macallan Exp $ */
+/*     $NetBSD: intr.c,v 1.11 2016/08/26 15:45:48 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.10 2016/01/29 01:54:14 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.11 2016/08/26 15:45:48 skrll Exp $");
 
 #define __INTR_PRIVATE
 
@@ -54,9 +54,8 @@
 #define DPRINTF while (0) printf
 #endif
 
-extern void ingenic_clockintr(uint32_t);
+extern void ingenic_clockintr(struct clockframe *);
 extern void ingenic_puts(const char *);
-extern struct clockframe cf;
 /*
  * This is a mask of bits to clear in the SR when we go to a
  * given hardware interrupt priority level.
@@ -139,7 +138,7 @@
 }
 
 void
-evbmips_iointr(int ipl, vaddr_t pc, uint32_t ipending)
+evbmips_iointr(int ipl, uint32_t ipending, struct clockframe *cf)
 {
        uint32_t id;
 #ifdef INGENIC_INTR_DEBUG
@@ -192,7 +191,7 @@
                                tag = MFC0(CP0_CORE_MBOX, 1);
                                ingenic_puts("1");



Home | Main Index | Thread Index | Old Index