summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2004-02-05 01:56:43 +0000
committerkan <kan@FreeBSD.org>2004-02-05 01:56:43 +0000
commit8f796dca97febb2b0e668cd3613331a54c6a74c7 (patch)
treeb0e2cc0cdb632a2786c857eb38a7809fd634eacd /sys/dev/syscons
parent9a226ff388c34edb12ae278cd6e5f3357fe6796a (diff)
downloadFreeBSD-src-8f796dca97febb2b0e668cd3613331a54c6a74c7.zip
FreeBSD-src-8f796dca97febb2b0e668cd3613331a54c6a74c7.tar.gz
Eliminate global cons_unavailable flag and replace it by the status
bit maintained on a per-device basis. Single variable is inadequate on machines running with multiple consoles enabled.
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/syscons.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index b054b41..0115954 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -97,6 +97,7 @@ static int sc_console_unit = -1;
static int sc_saver_keyb_only = 1;
static scr_stat *sc_console;
static struct tty *sc_console_tty;
+static struct consdev *sc_consptr;
static void *kernel_console_ts;
static char init_done = COLD;
@@ -526,7 +527,7 @@ scclose(dev_t dev, int flag, int mode, struct thread *td)
DPRINTF(5, ("sc%d: scclose(), ", scp->sc->unit));
s = spltty();
if ((scp == scp->sc->cur_scp) && (scp->sc->unit == sc_console_unit))
- cons_unavail = FALSE;
+ cnavailable(sc_consptr, TRUE);
if (finish_vt_rel(scp, TRUE, &s) == 0) /* force release */
DPRINTF(5, ("reset WAIT_REL, "));
if (finish_vt_acq(scp) == 0) /* force acknowledge */
@@ -927,7 +928,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
scp->pid = 0;
DPRINTF(5, ("VT_AUTO, "));
if ((scp == sc->cur_scp) && (sc->unit == sc_console_unit))
- cons_unavail = FALSE;
+ cnavailable(sc_consptr, TRUE);
/* were we in the middle of the vty switching process? */
if (finish_vt_rel(scp, TRUE, &s) == 0)
DPRINTF(5, ("reset WAIT_REL, "));
@@ -945,7 +946,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
scp->proc = td->td_proc;
scp->pid = scp->proc->p_pid;
if ((scp == sc->cur_scp) && (sc->unit == sc_console_unit))
- cons_unavail = TRUE;
+ cnavailable(sc_consptr, FALSE);
}
splx(s);
DPRINTF(5, ("\n"));
@@ -1419,6 +1420,7 @@ sccninit(struct consdev *cp)
scinit(unit, flags | SC_KERNEL_CONSOLE);
sc_console_unit = unit;
sc_console = SC_STAT(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]);
+ sc_consptr = cp;
#endif /* !__alpha__ */
#if __alpha__
@@ -1474,6 +1476,7 @@ sccnattach(void)
scinit(unit, flags | SC_KERNEL_CONSOLE);
sc_console_unit = unit;
+ sc_consptr = &consdev;
sc_console = SC_STAT(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]);
sprintf(consdev.cn_name, "ttyv%r", 0);
cnadd(&consdev);
@@ -2356,7 +2359,7 @@ sc_switch_scr(sc_softc_t *sc, u_int next_scr)
sc->switch_in_progress = 0;
if (sc->unit == sc_console_unit)
- cons_unavail = FALSE;
+ cnavailable(sc_consptr, TRUE);
splx(s);
DPRINTF(5, ("switch done\n"));
@@ -2378,7 +2381,7 @@ do_switch_scr(sc_softc_t *sc, int s)
if (!signal_vt_acq(sc->cur_scp)) {
sc->switch_in_progress = 0;
if (sc->unit == sc_console_unit)
- cons_unavail = FALSE;
+ cnavailable(sc_consptr, TRUE);
}
return s;
@@ -2420,7 +2423,7 @@ signal_vt_acq(scr_stat *scp)
if (scp->smode.mode != VT_PROCESS)
return FALSE;
if (scp->sc->unit == sc_console_unit)
- cons_unavail = TRUE;
+ cnavailable(sc_consptr, FALSE);
scp->status |= SWITCH_WAIT_ACQ;
PROC_LOCK(scp->proc);
psignal(scp->proc, scp->smode.acqsig);
OpenPOWER on IntegriCloud