diff options
author | avg <avg@FreeBSD.org> | 2011-12-17 15:11:22 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2011-12-17 15:11:22 +0000 |
commit | d062f5e7d808af770ca939a38c47ac94d6846449 (patch) | |
tree | f97bd7f4e266f0d1fe17b6436a6567e54ea0a72e | |
parent | f6def40e18a13286043257337db12d9d78aa545e (diff) | |
download | FreeBSD-src-d062f5e7d808af770ca939a38c47ac94d6846449.zip FreeBSD-src-d062f5e7d808af770ca939a38c47ac94d6846449.tar.gz |
introduce cngrab/cnungrab stub calls in some places where they make sense
MFC after: 2 months
-rw-r--r-- | sys/kern/kern_cons.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_shutdown.c | 3 | ||||
-rw-r--r-- | sys/kern/subr_kdb.c | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index 75dc881..b5df465 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -427,8 +427,10 @@ cnputc(int c) if (console_pausing && c == '\n' && !kdb_active) { for (cp = console_pausestr; *cp != '\0'; cp++) cnputc(*cp); + cngrab(); if (cngetc() == '.') console_pausing = 0; + cnungrab(); cnputc('\r'); for (cp = console_pausestr; *cp != '\0'; cp++) cnputc(' '); diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 1a7b744..2999826 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -443,6 +443,8 @@ kern_reboot(int howto) print_uptime(); + cngrab(); + /* * Ok, now do things that assume all filesystem activity has * been completed. @@ -613,6 +615,7 @@ panic(const char *fmt, ...) if (newpanic) { (void)vsnprintf(buf, sizeof(buf), fmt, ap); panicstr = buf; + cngrab(); printf("panic: %s\n", buf); } else { printf("panic: "); diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index 3c9d29b..9ca34b1 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> +#include <sys/cons.h> #include <sys/kdb.h> #include <sys/kernel.h> #include <sys/malloc.h> @@ -622,6 +623,8 @@ kdb_trap(int type, int code, struct trapframe *tf) makectx(tf, &kdb_pcb); kdb_thr_select(curthread); + cngrab(); + for (;;) { handled = be->dbbe_trap(type, code); if (be == kdb_dbbe) @@ -632,6 +635,8 @@ kdb_trap(int type, int code, struct trapframe *tf) printf("Switching to %s back-end\n", be->dbbe_name); } + cnungrab(); + kdb_active--; #ifdef SMP |