Module Name:    src
Committed By:   riz
Date:           Sun Mar 31 20:34:27 UTC 2013

Modified Files:
        src/sys/arch/x86/x86 [netbsd-6]: intr.c

Log Message:
Pull up following revision(s) (requested by chs in ticket #856):
        sys/arch/x86/x86/intr.c: revision 1.75
only use db_printf() if we're actually called from DDB.
this prevents the boot-time one from pausing the boot process.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.72.8.1 src/sys/arch/x86/x86/intr.c

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/x86/x86/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.72 src/sys/arch/x86/x86/intr.c:1.72.8.1
--- src/sys/arch/x86/x86/intr.c:1.72	Mon Aug  1 10:42:24 2011
+++ src/sys/arch/x86/x86/intr.c	Sun Mar 31 20:34:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $	*/
+/*	$NetBSD: intr.c,v 1.72.8.1 2013/03/31 20:34:27 riz Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.72.8.1 2013/03/31 20:34:27 riz Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -1063,10 +1063,6 @@ cpu_intr_init(struct cpu_info *ci)
 
 #if defined(INTRDEBUG) || defined(DDB)
 
-#ifdef DDB
-#define printf db_printf
-#endif
-
 void
 intr_printconfig(void)
 {
@@ -1075,30 +1071,45 @@ intr_printconfig(void)
 	struct intrsource *isp;
 	struct cpu_info *ci;
 	CPU_INFO_ITERATOR cii;
+	void (*pr)(const char *, ...);
+
+	pr = printf;
+#ifdef DDB
+	extern int db_active;
+	if (db_active) {
+		pr = db_printf;
+	}
+#endif
 
 	for (CPU_INFO_FOREACH(cii, ci)) {
-		printf("%s: interrupt masks:\n", device_xname(ci->ci_dev));
+		(*pr)("%s: interrupt masks:\n", device_xname(ci->ci_dev));
 		for (i = 0; i < NIPL; i++)
-			printf("IPL %d mask %lx unmask %lx\n", i,
+			(*pr)("IPL %d mask %lx unmask %lx\n", i,
 			    (u_long)ci->ci_imask[i], (u_long)ci->ci_iunmask[i]);
 		for (i = 0; i < MAX_INTR_SOURCES; i++) {
 			isp = ci->ci_isources[i];
 			if (isp == NULL)
 				continue;
-			printf("%s source %d is pin %d from pic %s maxlevel %d\n",
+			(*pr)("%s source %d is pin %d from pic %s type %d maxlevel %d\n",
 			    device_xname(ci->ci_dev), i, isp->is_pin,
-			    isp->is_pic->pic_name, isp->is_maxlevel);
+			    isp->is_pic->pic_name, isp->is_type, isp->is_maxlevel);
 			for (ih = isp->is_handlers; ih != NULL;
 			     ih = ih->ih_next)
-				printf("\thandler %p level %d\n",
+				(*pr)("\thandler %p level %d\n",
 				    ih->ih_fun, ih->ih_level);
+#if NIOAPIC > 0
+			if (isp->is_pic->pic_type == PIC_IOAPIC) {
+				struct ioapic_softc *sc;
+				sc = isp->is_pic->pic_ioapic;
+				(*pr)("\tioapic redir 0x%x\n",
+				    sc->sc_pins[isp->is_pin].ip_map->redir);
+			}
+#endif
 
 		}
 	}
 }
-#ifdef DDB
-#undef printf
-#endif
+
 #endif
 
 void

Reply via email to