aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/dcons
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2008-05-04 23:29:38 +0000
committerPeter Wemm <peter@FreeBSD.org>2008-05-04 23:29:38 +0000
commit43d7128c1450d36af259094b7cf39c0c4d17908c (patch)
treedec162871c2e0c2defef809d28858069fac12065 /sys/dev/dcons
parent228d330b1a327345e2e1a7dbb9c6122b19604547 (diff)
downloadsrc-43d7128c1450d36af259094b7cf39c0c4d17908c.tar.gz
src-43d7128c1450d36af259094b7cf39c0c4d17908c.zip
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.
Notes
Notes: svn path=/head/; revision=178766
Diffstat (limited to 'sys/dev/dcons')
-rw-r--r--sys/dev/dcons/dcons_os.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/sys/dev/dcons/dcons_os.c b/sys/dev/dcons/dcons_os.c
index 7eb89aadbae8..5715343e721c 100644
--- a/sys/dev/dcons/dcons_os.c
+++ b/sys/dev/dcons/dcons_os.c
@@ -198,22 +198,36 @@ extern struct gdb_dbgport *gdb_cur;
static int
dcons_check_break(struct dcons_softc *dc, int c)
{
+#if __FreeBSD_version >= 502122
+ int kdb_brk;
+#endif
if (c < 0)
return (c);
#if __FreeBSD_version >= 502122
- if (kdb_alt_break(c, &dc->brk_state)) {
- if ((dc->flags & DC_GDB) != 0) {
+ if ((kdb_brk = kdb_alt_break(c, &dc->brk_state)) != 0) {
+ switch (kdb_brk) {
+ case KDB_REQ_DEBUGGER:
+
+ if ((dc->flags & DC_GDB) != 0) {
#ifdef GDB
- if (gdb_cur == &dcons_gdb_dbgport) {
- kdb_dbbe_select("gdb");
- kdb_enter(KDB_WHY_BREAK,
- "Break sequence on dcons gdb port");
- }
+ if (gdb_cur == &dcons_gdb_dbgport) {
+ kdb_dbbe_select("gdb");
+ kdb_enter(KDB_WHY_BREAK,
+ "Break sequence on dcons gdb port");
+ }
#endif
- } else
- kdb_enter(KDB_WHY_BREAK,
- "Break sequence on dcons console port");
+ } else
+ kdb_enter(KDB_WHY_BREAK,
+ "Break sequence on dcons console port");
+ break;
+ case KDB_REQ_PANIC:
+ kdb_panic("Panic sequence on dcons console port");
+ break;
+ case KDB_REQ_BREAK:
+ kdb_reboot();
+ break;
+ }
}
#else
switch (dc->brk_state) {