Module Name:    src
Committed By:   tsutsui
Date:           Sun Jun 12 03:21:21 UTC 2011

Modified Files:
        src/sys/arch/emips/emips: autoconf.c interrupt.c machdep.c mainbus.c
        src/sys/arch/emips/include: intr.h

Log Message:
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().


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/emips/autoconf.c \
    src/sys/arch/emips/emips/machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/emips/interrupt.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/emips/mainbus.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/include/intr.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/emips/emips/autoconf.c
diff -u src/sys/arch/emips/emips/autoconf.c:1.4 src/sys/arch/emips/emips/autoconf.c:1.5
--- src/sys/arch/emips/emips/autoconf.c:1.4	Sun Jun 12 03:14:03 2011
+++ src/sys/arch/emips/emips/autoconf.c	Sun Jun 12 03:21:21 2011
@@ -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);
Index: src/sys/arch/emips/emips/machdep.c
diff -u src/sys/arch/emips/emips/machdep.c:1.4 src/sys/arch/emips/emips/machdep.c:1.5
--- src/sys/arch/emips/emips/machdep.c:1.4	Tue Feb 22 08:20:20 2011
+++ src/sys/arch/emips/emips/machdep.c	Sun Jun 12 03:21:21 2011
@@ -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);
 

Index: src/sys/arch/emips/emips/interrupt.c
diff -u src/sys/arch/emips/emips/interrupt.c:1.3 src/sys/arch/emips/emips/interrupt.c:1.4
--- src/sys/arch/emips/emips/interrupt.c:1.3	Thu Mar 10 17:22:51 2011
+++ src/sys/arch/emips/emips/interrupt.c	Sun Jun 12 03:21:21 2011
@@ -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 = TIMER_DEFAULT_ADDRESS;
-		tlb.tlb_lo0 = TIMER_DEFAULT_ADDRESS | 0xf02;
-		tlb_write_indexed(5, &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);
 }
 
 /*

Index: src/sys/arch/emips/emips/mainbus.c
diff -u src/sys/arch/emips/emips/mainbus.c:1.2 src/sys/arch/emips/emips/mainbus.c:1.3
--- src/sys/arch/emips/emips/mainbus.c:1.2	Sun Jun  5 17:03:16 2011
+++ src/sys/arch/emips/emips/mainbus.c	Sun Jun 12 03:21:21 2011
@@ -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);

Index: src/sys/arch/emips/include/intr.h
diff -u src/sys/arch/emips/include/intr.h:1.2 src/sys/arch/emips/include/intr.h:1.3
--- src/sys/arch/emips/include/intr.h:1.2	Tue Feb 22 08:20:20 2011
+++ src/sys/arch/emips/include/intr.h	Sun Jun 12 03:21:21 2011
@@ -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 */
 

Reply via email to