path: root/sys/sys/kdb.h
diff options
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/sys/kdb.h
parent228d330b1a327345e2e1a7dbb9c6122b19604547 (diff)
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: svn path=/head/; revision=178766
Diffstat (limited to 'sys/sys/kdb.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/kdb.h b/sys/sys/kdb.h
index 0f989f5cac40..c162852c0acf 100644
--- a/sys/sys/kdb.h
+++ b/sys/sys/kdb.h
@@ -69,6 +69,8 @@ int kdb_dbbe_select(const char *);
void kdb_enter(const char *, const char *);
void kdb_init(void);
void * kdb_jmpbuf(jmp_buf);
+void kdb_panic(const char *);
+void kdb_reboot(void);
void kdb_reenter(void);
struct pcb *kdb_thr_ctx(struct thread *);
struct thread *kdb_thr_first(void);
@@ -105,4 +107,9 @@ extern const char * volatile kdb_why;
#define KDB_WHY_POWERPC "powerpc" /* Unhandled powerpc intr. */
#define KDB_WHY_UNIONFS "unionfs" /* Unionfs bug. */
+/* Return values for kdb_alt_break */
+#define KDB_REQ_DEBUGGER 1 /* User requested Debugger */
+#define KDB_REQ_PANIC 2 /* User requested a panic */
+#define KDB_REQ_REBOOT 3 /* User requested a clean reboot */
#endif /* !_SYS_KDB_H_ */