From 8f796dca97febb2b0e668cd3613331a54c6a74c7 Mon Sep 17 00:00:00 2001 From: kan Date: Thu, 5 Feb 2004 01:56:43 +0000 Subject: 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. --- sys/i386/isa/pcvt/pcvt_drv.c | 1 + sys/i386/isa/pcvt/pcvt_ext.c | 8 ++++---- sys/i386/isa/pcvt/pcvt_hdr.h | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'sys/i386/isa') diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c index 9462c34..38c1ced 100644 --- a/sys/i386/isa/pcvt/pcvt_drv.c +++ b/sys/i386/isa/pcvt/pcvt_drv.c @@ -673,6 +673,7 @@ pcvt_cn_init(struct consdev *cp) int i; pcvt_is_console = 1; + pcvt_consptr = cp; /* * Don't reset the keyboard via `kbdio' just yet. diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c index ea02437f..4a1e6a0 100644 --- a/sys/i386/isa/pcvt/pcvt_ext.c +++ b/sys/i386/isa/pcvt/pcvt_ext.c @@ -2385,7 +2385,7 @@ vgapage(int new_screen) * process mode. */ if(pcvt_is_console) - cons_unavail = 0; + cnavaiable(pcvt_consptr, TRUE); } } return 0; @@ -2470,7 +2470,7 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct thread *td) * process mode. */ if(pcvt_is_console) - cons_unavail = (newmode.mode == VT_PROCESS); + cnavailable(pcvt_consptr, (newmode.mode != VT_PROCESS)); splx(opri); return 0; @@ -2549,7 +2549,7 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct thread *td) /* XXX */ if(pcvt_is_console) - cons_unavail = 0; + cnavailable(pcvt_consptr, TRUE); } return 0; } @@ -2563,7 +2563,7 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct thread *td) /* XXX */ if(pcvt_is_console) - cons_unavail = 1; + cnavailable(pcvt_consptr, FALSE); return 0; } diff --git a/sys/i386/isa/pcvt/pcvt_hdr.h b/sys/i386/isa/pcvt/pcvt_hdr.h index de8678f..fedb925 100644 --- a/sys/i386/isa/pcvt/pcvt_hdr.h +++ b/sys/i386/isa/pcvt/pcvt_hdr.h @@ -763,6 +763,7 @@ u_char keyboard_is_initialized = 0; /* for ddb sanity */ u_char kbd_polling = 0; /* keyboard is being polled */ u_char reset_keyboard = 0; /* OK to reset keyboard */ keyboard_t *kbd = NULL; +struct consdev *pcvt_consptr = NULL; #if PCVT_SHOWKEYS u_char keyboard_show = 0; /* normal display */ @@ -899,6 +900,7 @@ extern u_char keyboard_is_initialized; extern u_char kbd_polling; extern u_char reset_keyboard; extern keyboard_t *kbd; +extern struct consdev *pcvt_consptr; #if PCVT_SHOWKEYS extern u_char keyboard_show; -- cgit v1.1