Module Name: src Committed By: chs Date: Mon Mar 25 01:34:59 UTC 2013
Modified Files: src/sys/arch/x86/x86: intr.c Log Message: 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.74 -r1.75 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.74 src/sys/arch/x86/x86/intr.c:1.75 --- src/sys/arch/x86/x86/intr.c:1.74 Fri Jun 15 13:57:59 2012 +++ src/sys/arch/x86/x86/intr.c Mon Mar 25 01:34:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.74 2012/06/15 13:57:59 yamt Exp $ */ +/* $NetBSD: intr.c,v 1.75 2013/03/25 01:34:59 chs 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.74 2012/06/15 13:57:59 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.75 2013/03/25 01:34:59 chs 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