svn commit: r228767 - head/sys/dev/syscons

Andriy Gapon avg at FreeBSD.org
Wed Dec 21 12:21:22 UTC 2011


Author: avg
Date: Wed Dec 21 12:21:22 2011
New Revision: 228767
URL: http://svn.freebsd.org/changeset/base/228767

Log:
  sc_cngrab: switch to console vty when possible
  
  In the future we may want to perform the switch even if the console is
  currently in the graphics mode by trying to reset the video adapter first
  (e.g. by executing vesa/vga bios post).  That would probably require
  some sort of a one-way flag as returning the control of the console back
  to the interrupted application most likely would result in a mess.
  
  Reviewed by:	emaste
  MFC after:	2 months

Modified:
  head/sys/dev/syscons/syscons.c

Modified: head/sys/dev/syscons/syscons.c
==============================================================================
--- head/sys/dev/syscons/syscons.c	Wed Dec 21 12:07:14 2011	(r228766)
+++ head/sys/dev/syscons/syscons.c	Wed Dec 21 12:21:22 2011	(r228767)
@@ -1615,7 +1615,14 @@ sc_cngrab(struct consdev *cp)
 {
     scr_stat *scp;
 
+    if (!cold &&
+	sc_console->sc->cur_scp->index != sc_console->index &&
+	sc_console->sc->cur_scp->smode.mode == VT_AUTO &&
+	sc_console->smode.mode == VT_AUTO)
+	    sc_switch_scr(sc_console->sc, sc_console->index);
+
     scp = sc_console->sc->cur_scp;
+
     if (scp->sc->kbd == NULL)
 	return;
 


More information about the svn-src-head mailing list