Date: Sat, 27 Nov 2010 20:43:30 GMT From: Matt Jacob <mjacob@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 186345 for review Message-ID: <201011272043.oARKhU8C099770@skunkworks.freebsd.org>
index | next in thread | raw e-mail
http://p4web.freebsd.org/@@186345?ac=10 Change 186345 by mjacob@mjacob-sandbox on 2010/11/27 20:43:28 Put in sysctl to suppress serial console output. Affected files ... .. //depot/projects/mjacob-dev/sys/dev/uart/uart_tty.c#2 edit .. //depot/projects/mjacob-dev/sys/kern/kern_shutdown.c#2 edit .. //depot/projects/mjacob-dev/sys/kern/subr_kdb.c#2 edit Differences ... ==== //depot/projects/mjacob-dev/sys/dev/uart/uart_tty.c#2 (text+ko) ==== @@ -40,6 +40,7 @@ #include <machine/bus.h> #include <sys/rman.h> #include <sys/tty.h> +#include <sys/sysctl.h> #include <machine/resource.h> #include <machine/stdarg.h> @@ -107,10 +108,15 @@ uart_term(cp->cn_arg); } +int sio_suppressed = 0; +SYSCTL_INT(_machdep, OID_AUTO, sio_suppressed, CTLFLAG_RW, &sio_suppressed, 0, ""); + static void uart_cnputc(struct consdev *cp, int c) { - + if (sio_suppressed) { + return; + } uart_putc(cp->cn_arg, c); } ==== //depot/projects/mjacob-dev/sys/kern/kern_shutdown.c#2 (text+ko) ==== @@ -512,6 +512,8 @@ /* NOTREACHED */ /* assuming reset worked */ } +extern int sio_suppressed; + /* * Panic is called on unresolvable fatal errors. It prints "panic: mesg", * and then reboots. If we are called twice, then we avoid trying to sync @@ -528,6 +530,7 @@ va_list ap; static char buf[256]; + sio_suppressed = 0; critical_enter(); #ifdef SMP /* ==== //depot/projects/mjacob-dev/sys/kern/subr_kdb.c#2 (text+ko) ==== @@ -287,6 +287,7 @@ return (brk); } +extern int sio_suppressed; /* * Print a backtrace of the calling thread. The backtrace is generated by * the selected debugger, provided it supports backtraces. If no debugger @@ -297,6 +298,8 @@ void kdb_backtrace(void) { + int osup = sio_suppressed; + sio_suppressed = 0; if (kdb_dbbe != NULL && kdb_dbbe->dbbe_trace != NULL) { printf("KDB: stack backtrace:\n"); @@ -311,6 +314,7 @@ stack_print_ddb(&st); } #endif + sio_suppressed = osup; } /* @@ -343,6 +347,8 @@ void kdb_enter(const char *why, const char *msg) { + int osup = sio_suppressed; + sio_suppressed = 0; if (kdb_dbbe != NULL && kdb_active == 0) { if (msg != NULL) @@ -351,6 +357,7 @@ breakpoint(); kdb_why = KDB_WHY_UNSET; } + sio_suppressed = osup; } /* @@ -518,6 +525,8 @@ int did_stop_cpus; #endif int handled; + int osup = sio_suppressed; + sio_suppressed = 0; if (kdb_dbbe == NULL || kdb_dbbe->dbbe_trap == NULL) return (0); @@ -554,5 +563,6 @@ intr_restore(intr); + sio_suppressed = osup; return (handled); }help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011272043.oARKhU8C099770>
