summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-05-12 20:47:45 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-05-12 20:47:45 +0000
commit3a4304c449c71167e6c769651f26a34b9f0cb362 (patch)
tree7d8ecefd82e71cc2088fcb7f26db13da519851ec /sys
parent87cfef69c99a774a31b93383e2224039ac7a2b0d (diff)
Tell wsdisplay(4) to switch back to the console screen upon entering ddb(4).
This gives users a decent chance to see panic messages and interact with ddb(4) when they're running X on hardware for which we have a KMS driver. Currently that means inteldrm(4). ok jsg@, guenther@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/db_interface.c11
-rw-r--r--sys/arch/i386/i386/db_interface.c11
2 files changed, 20 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/db_interface.c b/sys/arch/amd64/amd64/db_interface.c
index a6d95bc986d..4b277f23d80 100644
--- a/sys/arch/amd64/amd64/db_interface.c
+++ b/sys/arch/amd64/amd64/db_interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.c,v 1.16 2010/04/01 19:47:59 kettenis Exp $ */
+/* $OpenBSD: db_interface.c,v 1.17 2013/05/12 20:47:44 kettenis Exp $ */
/* $NetBSD: db_interface.c,v 1.1 2003/04/26 18:39:27 fvdl Exp $ */
/*
@@ -62,6 +62,11 @@
#include <dev/acpi/acpidebug.h>
#endif /* NACPI > 0 */
+#include "wsdisplay.h"
+#if NWSDISPLAY > 0
+#include <dev/wscons/wsdisplayvar.h>
+#endif
+
extern label_t *db_recover;
extern char *trap_type[];
extern int trap_types;
@@ -107,6 +112,10 @@ kdb_trap(int type, int code, db_regs_t *regs)
{
int s;
+#if NWSDISPLAY > 0
+ wsdisplay_switchtoconsole();
+#endif
+
switch (type) {
case T_BPTFLT: /* breakpoint */
case T_TRCTRAP: /* single_step */
diff --git a/sys/arch/i386/i386/db_interface.c b/sys/arch/i386/i386/db_interface.c
index 97ed71f8295..85c1ff59e52 100644
--- a/sys/arch/i386/i386/db_interface.c
+++ b/sys/arch/i386/i386/db_interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.c,v 1.27 2011/04/04 22:37:30 miod Exp $ */
+/* $OpenBSD: db_interface.c,v 1.28 2013/05/12 20:47:44 kettenis Exp $ */
/* $NetBSD: db_interface.c,v 1.22 1996/05/03 19:42:00 christos Exp $ */
/*
@@ -57,6 +57,11 @@
#include <dev/acpi/acpidebug.h>
#endif /* NACPI > 0 */
+#include "wsdisplay.h"
+#if NWSDISPLAY > 0
+#include <dev/wscons/wsdisplayvar.h>
+#endif
+
extern label_t *db_recover;
extern char *trap_type[];
extern int trap_types;
@@ -101,6 +106,10 @@ kdb_trap(int type, int code, db_regs_t *regs)
{
int s;
+#if NWSDISPLAY > 0
+ wsdisplay_switchtoconsole();
+#endif
+
switch (type) {
case T_BPTFLT: /* breakpoint */
case T_TRCTRAP: /* single_step */