summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1998-08-03 09:18:58 +0000
committeryokota <yokota@FreeBSD.org>1998-08-03 09:18:58 +0000
commitfb540ba98427a433d62a0ceb666a95a750b2af07 (patch)
tree48db0bad1dc2e9433051808870c283aab0fc1e31 /sys/dev/syscons
parent513eb689bc0fd059b1bf339249f3ee2b3f23c134 (diff)
downloadFreeBSD-src-fb540ba98427a433d62a0ceb666a95a750b2af07.zip
FreeBSD-src-fb540ba98427a433d62a0ceb666a95a750b2af07.tar.gz
- When the system is shut down, switch to the vty0 if possible.
- Don't try to ring bell when system is going down. Beacuse the clock code is about to be stopped, the timeout routine won't be called anymore.
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/syscons.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index b996d39..25c0aa4 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.269 1998/08/03 09:15:36 yokota Exp $
+ * $Id: syscons.c,v 1.270 1998/08/03 09:17:06 yokota Exp $
*/
#include "sc.h"
@@ -146,6 +146,7 @@ static int sc_port = IO_KBD;
static KBDC sc_kbdc = NULL;
static char init_done = COLD;
static u_short sc_buffer[ROW*COL];
+static char shutdown_in_progress = FALSE;
static char font_loading_in_progress = FALSE;
static char switch_in_progress = FALSE;
static char write_in_progress = FALSE;
@@ -244,6 +245,7 @@ static int sckbdprobe(int unit, int flags);
static void scstart(struct tty *tp);
static void scmousestart(struct tty *tp);
static void scinit(void);
+static void scshutdown(int howto, void *arg);
static void map_mode_table(char *map[], char *table, int max);
static u_char map_mode_num(u_char mode);
static char *get_mode_param(scr_stat *scp, u_char mode);
@@ -813,6 +815,8 @@ scattach(struct isa_device *dev)
apm_hook_establish(APM_HOOK_RESUME , &scp->r_hook);
#endif
+ at_shutdown(scshutdown, NULL, SHUTDOWN_PRE_SYNC);
+
cdevsw_add(&cdev, &scdevsw, NULL);
#ifdef DEVFS
@@ -2380,7 +2384,7 @@ scrn_timer(void *arg)
/* should we stop the screen saver? */
getmicrouptime(&tv);
- if (panicstr)
+ if (panicstr || shutdown_in_progress)
scrn_time_stamp = tv;
if (tv.tv_sec <= scrn_time_stamp.tv_sec + scrn_blank_time)
if (scrn_blanked > 0)
@@ -3424,6 +3428,16 @@ scinit(void)
}
static void
+scshutdown(int howto, void *arg)
+{
+ getmicrouptime(&scrn_time_stamp);
+ if (!cold && cur_console->smode.mode == VT_AUTO
+ && console[0]->smode.mode == VT_AUTO)
+ switch_scr(cur_console, 0);
+ shutdown_in_progress = TRUE;
+}
+
+static void
map_mode_table(char *map[], char *table, int max)
{
int i;
@@ -5135,7 +5149,7 @@ load_palette(char *palette)
static void
do_bell(scr_stat *scp, int pitch, int duration)
{
- if (cold)
+ if (cold || shutdown_in_progress)
return;
if (scp != cur_console && (flags & QUIET_BELL))
OpenPOWER on IntegriCloud