Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/emips No need to initialize interrupt evcnt(9) so e...



details:   https://anonhg.NetBSD.org/src/rev/efc0eb0d1975
branches:  trunk
changeset: 765953:efc0eb0d1975
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Jun 12 03:21:21 2011 +0000

description:
No need to initialize interrupt evcnt(9) so earlier, so remove phase arg
from intr_init() and initialize all stuff in cpu_configure(9) as other ports
rather than in mach_init() and mbattach().

diffstat:

 sys/arch/emips/emips/autoconf.c  |   7 +++++--
 sys/arch/emips/emips/interrupt.c |  35 +++++++++++++++--------------------
 sys/arch/emips/emips/machdep.c   |   7 ++-----
 sys/arch/emips/emips/mainbus.c   |   7 ++-----
 sys/arch/emips/include/intr.h    |   4 ++--
 5 files changed, 26 insertions(+), 34 deletions(-)

diffs (167 lines):

diff -r 8e7f63871f13 -r efc0eb0d1975 sys/arch/emips/emips/autoconf.c
--- a/sys/arch/emips/emips/autoconf.c   Sun Jun 12 03:14:03 2011 +0000
+++ b/sys/arch/emips/emips/autoconf.c   Sun Jun 12 03:21:21 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $     */
+/*     $NetBSD: autoconf.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $     */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -64,6 +64,9 @@
        /* Kick off autoconfiguration. */
        (void)splhigh();
 
+       /* Interrupt initialization. */
+       intr_init();
+
        evcnt_attach_static(&emips_clock_evcnt);
        evcnt_attach_static(&emips_fpu_evcnt);
        evcnt_attach_static(&emips_memerr_evcnt);
diff -r 8e7f63871f13 -r efc0eb0d1975 sys/arch/emips/emips/interrupt.c
--- a/sys/arch/emips/emips/interrupt.c  Sun Jun 12 03:14:03 2011 +0000
+++ b/sys/arch/emips/emips/interrupt.c  Sun Jun 12 03:21:21 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interrupt.c,v 1.3 2011/03/10 17:22:51 tsutsui Exp $    */
+/*     $NetBSD: interrupt.c,v 1.4 2011/06/12 03:21:21 tsutsui Exp $    */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.3 2011/03/10 17:22:51 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.4 2011/06/12 03:21:21 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -67,33 +67,28 @@
 };
 
 void
-intr_init(int phase)
+intr_init(void)
 {
        int i;
 
-       if (phase == 0) {
-               for (i = 0; i < MAX_DEV_NCOOKIES; i++) {
-                       evcnt_attach_dynamic(&intrtab[i].ih_count,
-                           EVCNT_TYPE_INTR, NULL, "emips", intrnames[i]);
-               }
-               return;
+       for (i = 0; i < MAX_DEV_NCOOKIES; i++) {
+               evcnt_attach_dynamic(&intrtab[i].ih_count,
+                   EVCNT_TYPE_INTR, NULL, "emips", intrnames[i]);
        }
 
-       if (phase == 1) {
-               /* I am trying to make this standard so its here. Bah. */
-               struct tlbmask tlb;
+       /* I am trying to make this standard so its here. Bah. */
+       struct tlbmask tlb;
 
-    /* This is ugly but efficient. Sigh. */
+       /* This is ugly but efficient. Sigh. */
 #define TheAic ((struct _Aic *)INTERRUPT_CONTROLLER_DEFAULT_ADDRESS)
 
-               tlb.tlb_hi = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS;
-               tlb.tlb_lo0 = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS | 0xf02;
-               tlb_write_indexed(4, &tlb);
+       tlb.tlb_hi = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS;
+       tlb.tlb_lo0 = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS | 0xf02;
+       tlb_write_indexed(4, &tlb);
 
-               tlb.tlb_hi = TIMER_DEFAULT_ADDRESS;
-               tlb.tlb_lo0 = TIMER_DEFAULT_ADDRESS | 0xf02;
-               tlb_write_indexed(5, &tlb);
-       }
+       tlb.tlb_hi = TIMER_DEFAULT_ADDRESS;
+       tlb.tlb_lo0 = TIMER_DEFAULT_ADDRESS | 0xf02;
+       tlb_write_indexed(5, &tlb);
 }
 
 /*
diff -r 8e7f63871f13 -r efc0eb0d1975 sys/arch/emips/emips/machdep.c
--- a/sys/arch/emips/emips/machdep.c    Sun Jun 12 03:14:03 2011 +0000
+++ b/sys/arch/emips/emips/machdep.c    Sun Jun 12 03:21:21 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.4 2011/02/22 08:20:20 matt Exp $ */
+/*     $NetBSD: machdep.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.4 2011/02/22 08:20:20 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -288,9 +288,6 @@
        /* Machine specific initialization. */
        (*sysinit[systype].init)();
 
-       /* Interrupt initialization, phase 0 */
-       intr_init(0);
-
        /* Find out how much memory is available. */
        physmem = (*platform.memsize)(kernend);
 
diff -r 8e7f63871f13 -r efc0eb0d1975 sys/arch/emips/emips/mainbus.c
--- a/sys/arch/emips/emips/mainbus.c    Sun Jun 12 03:14:03 2011 +0000
+++ b/sys/arch/emips/emips/mainbus.c    Sun Jun 12 03:21:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mainbus.c,v 1.2 2011/06/05 17:03:16 matt Exp $ */
+/* $NetBSD: mainbus.c,v 1.3 2011/06/12 03:21:21 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.2 2011/06/05 17:03:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2011/06/12 03:21:21 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -69,9 +69,6 @@
 
        printf("\n");
 
-       /* Interrupt initialization, phase 1 */
-       intr_init(1);
-
        ma.ma_name = "cpu";
        ma.ma_slot = 0;
        config_found(self, &ma, mbprint);
diff -r 8e7f63871f13 -r efc0eb0d1975 sys/arch/emips/include/intr.h
--- a/sys/arch/emips/include/intr.h     Sun Jun 12 03:14:03 2011 +0000
+++ b/sys/arch/emips/include/intr.h     Sun Jun 12 03:21:21 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.2 2011/02/22 08:20:20 matt Exp $    */
+/*     $NetBSD: intr.h,v 1.3 2011/06/12 03:21:21 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -70,7 +70,7 @@
        void *ih_arg;
 };
 
-void intr_init(int);
+void intr_init(void);
 #endif /* !_LOCORE */
 #endif /* _KERNEL */
 



Home | Main Index | Thread Index | Old Index