aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vt/vt_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/vt/vt_core.c')
-rw-r--r--sys/dev/vt/vt_core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index d4baa65f06c9..884050f4f0c5 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -595,7 +595,13 @@ vt_window_switch(struct vt_window *vw)
VT_LOCK(vd);
if (curvw == vw) {
- /* Nothing to do. */
+ /*
+ * Nothing to do, except ensure the driver has the opportunity to
+ * switch to console mode when panicking, making sure the panic
+ * is readable (even when a GUI was using ttyv0).
+ */
+ if ((kdb_active || panicstr) && vd->vd_driver->vd_postswitch)
+ vd->vd_driver->vd_postswitch(vd);
VT_UNLOCK(vd);
return (0);
}