summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_core.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2008-05-04 23:29:38 +0000
committerpeter <peter@FreeBSD.org>2008-05-04 23:29:38 +0000
commit5a3c5f632b4461dbf60ab538e16453104b937231 (patch)
treedec162871c2e0c2defef809d28858069fac12065 /sys/dev/uart/uart_core.c
parent40ba3f0b054237aea1c061c7ae1d4a9b1b5dd800 (diff)
downloadFreeBSD-src-5a3c5f632b4461dbf60ab538e16453104b937231.zip
FreeBSD-src-5a3c5f632b4461dbf60ab538e16453104b937231.tar.gz
Expand kdb_alt_break a little, most commonly used with the option
ALT_BREAK_TO_DEBUGGER. In addition to "Enter ~ ctrl-B" (to enter the debugger), there is now "Enter ~ ctrl-P" (force panic) and "Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons). We've used variations of this at work. The force panic sequence is best used with KDB_UNATTENDED for when you just want it to dump and get on with it. The reboot request is a safer way of getting into single user than a power cycle. eg: you've hosed the ability to log in (pam, rtld, etc). It gives init the reboot signal, which causes an orderly reboot. I've taken my best guess at what the !x86 and non-sio code changes should be. This also makes sio release its spinlock before calling KDB/DDB.
Diffstat (limited to 'sys/dev/uart/uart_core.c')
-rw-r--r--sys/dev/uart/uart_core.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c
index b4730418..3b0d64c 100644
--- a/sys/dev/uart/uart_core.c
+++ b/sys/dev/uart/uart_core.c
@@ -175,9 +175,23 @@ uart_intr_rxready(void *arg)
#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER)
if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) {
while (rxp != sc->sc_rxput) {
- if (kdb_alt_break(sc->sc_rxbuf[rxp++], &sc->sc_altbrk))
- kdb_enter(KDB_WHY_BREAK,
- "Break sequence on console");
+ int kdb_brk;
+
+ if ((kdb_brk = kdb_alt_break(sc->sc_rxbuf[rxp++],
+ &sc->sc_altbrk)) != 0) {
+ switch (kdb_brk) {
+ case KDB_REQ_DEBUGGER:
+ kdb_enter(KDB_WHY_BREAK,
+ "Break sequence on console");
+ break;
+ case KDB_REQ_PANIC:
+ kdb_panic("Panic sequence on console");
+ break;
+ case KDB_REQ_REBOOT:
+ kdb_reboot();
+ break;
+ }
+ }
if (rxp == sc->sc_rxbufsz)
rxp = 0;
}
OpenPOWER on IntegriCloud