Remove PCVT kernel part and mop up.
authorSascha Wildner <swildner@dragonflybsd.org>
Sat, 7 May 2005 17:38:34 +0000 (17:38 +0000)
committerSascha Wildner <swildner@dragonflybsd.org>
Sat, 7 May 2005 17:38:34 +0000 (17:38 +0000)
39 files changed:
etc/MAKEDEV
etc/Makefile
etc/mtree/BSD.usr.dist
share/man/man4/Makefile
share/man/man4/atkbd.4
share/man/man4/pcvt.4 [deleted file]
share/man/man4/splash.4
share/man/man5/rc.conf.5
share/man/man7/hier.7
share/man/man8/man8.i386/MAKEDEV.8
share/mk/bsd.libnames.mk
share/termcap/termcap.src
sys/conf/files.amd64
sys/conf/files.i386
sys/conf/options.amd64
sys/conf/options.i386
sys/config/GENERIC
sys/config/LINT
sys/config/TINDERBOX
sys/dev/misc/kbd/atkbd.c
sys/dev/video/pcvt/i386/pcvt_conf.h [deleted file]
sys/dev/video/pcvt/i386/pcvt_drv.c [deleted file]
sys/dev/video/pcvt/i386/pcvt_ext.c [deleted file]
sys/dev/video/pcvt/i386/pcvt_hdr.h [deleted file]
sys/dev/video/pcvt/i386/pcvt_kbd.c [deleted file]
sys/dev/video/pcvt/i386/pcvt_kbd.h [deleted file]
sys/dev/video/pcvt/i386/pcvt_out.c [deleted file]
sys/dev/video/pcvt/i386/pcvt_sup.c [deleted file]
sys/dev/video/pcvt/i386/pcvt_tbl.h [deleted file]
sys/dev/video/pcvt/i386/pcvt_vtf.c [deleted file]
sys/i386/conf/GENERIC
sys/i386/conf/LINT
sys/i386/conf/TINDERBOX
sys/i386/i386/userconfig.c
sys/i386/include/pcvt_ioctl.h [deleted file]
sys/platform/pc32/i386/userconfig.c
sys/platform/pc32/include/pcvt_ioctl.h [deleted file]
tools/make_libdeps.sh
usr.sbin/moused/moused.8

index 10ba18c..360317b 100644 (file)
@@ -21,7 +21,7 @@
 #
 #      @(#)MAKEDEV     5.2 (Berkeley) 6/22/90
 # $FreeBSD: src/etc/MAKEDEV,v 1.243.2.57 2003/02/10 11:35:53 simokawa Exp $
-# $DragonFly: src/etc/MAKEDEV,v 1.19 2005/03/22 18:36:50 dillon Exp $
+# $DragonFly: src/etc/MAKEDEV,v 1.20 2005/05/07 17:38:33 swildner Exp $
 #
 # Device "make" file.  Valid arguments:
 #      all     makes all known devices, standard number of units (or close)
@@ -59,7 +59,7 @@
 #      vn*     vnode disks
 #
 # Console ports:
-#      vty*    virtual console devices for syscons/pcvt/codrv
+#      vty*    virtual console devices for syscons
 #
 # Pointing devices:
 #      mse*    Logitech and ATI Inport bus mouse
@@ -89,7 +89,7 @@
 #
 # Pseudo terminals:
 #      pty*    set of 32 master and slave pseudo terminals
-#      vty*    virtual terminals using syscons/pcvt/codrv console
+#      vty*    virtual terminals using syscons console
 #
 # Parallel port:
 #      lpt*    Printer
index 2398271..159c4f9 100644 (file)
@@ -1,6 +1,6 @@
 #      from: @(#)Makefile      5.11 (Berkeley) 5/21/91
 # $FreeBSD: src/etc/Makefile,v 1.219.2.38 2003/03/04 09:49:00 ru Exp $
-# $DragonFly: src/etc/Makefile,v 1.55 2005/05/04 06:17:41 y0netan1 Exp $
+# $DragonFly: src/etc/Makefile,v 1.56 2005/05/07 17:38:33 swildner Exp $
 
 .if !defined(NO_SENDMAIL)
 SUBDIR=        sendmail
@@ -229,6 +229,25 @@ upgrade_etc:       preupgrade
        rm -f ${DESTDIR}/usr/lib/${lib}
 .endif
 .endfor
+       rm -f ${DESTDIR}/usr/lib/libkeycap.a
+       rm -f ${DESTDIR}/usr/lib/libkeycap_p.a
+.for cmd in cursor fontedit ispcvt kcon loadfont mcon scon vt220keys vttest
+       rm -f ${DESTDIR}/usr/sbin/${cmd}
+.endfor
+.for man in cursor fontedit kcon loadfont mcon scon vt220keys vttest
+       rm -f ${DESTDIR}/usr/share/man/man1/${man}.1.gz
+.endfor
+.for man in keycap kgetent kgetflag kgetnum kgetstr
+       rm -f ${DESTDIR}/usr/share/man/man3/${man}.3.gz
+.endfor
+       rm -f ${DESTDIR}/usr/share/man/man4/pcvt.4.gz
+       rm -f ${DESTDIR}/usr/share/man/man4/vt.4.gz
+       rm -f ${DESTDIR}/usr/share/man/man5/keycap.5.gz
+       rm -f ${DESTDIR}/usr/share/man/man8/ispcvt.8.gz
+       rm -f ${DESTDIR}/usr/share/misc/keycap.pcvt
+       rm -rf ${DESTDIR}/usr/share/misc/fonts
+       rm -rf ${DESTDIR}/usr/share/misc/pcvtfonts
+       rm -rf ${DESTDIR}/usr/share/pcvt
        ldconfig -R
 
 distribution:
index 00c5f30..8fd1d11 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.188.2.40 2003/02/14 22:38:14 nectar Exp $
-# $DragonFly: src/etc/mtree/BSD.usr.dist,v 1.32 2005/04/21 13:48:56 joerg Exp $
+# $DragonFly: src/etc/mtree/BSD.usr.dist,v 1.33 2005/05/07 17:38:33 swildner Exp $
 #
 # Please see the file src/etc/mtree/README before making changes to this file.
 #
         me
         ..
         misc
-            fonts
-            ..
-            pcvtfonts
-            ..
         ..
         mk
         ..
                 ..
             ..
         ..
-        pcvt
-            Doc
-            ..
-            Etc
-            ..
-        ..
         sendmail
         ..
         skel
index af867ed..5bd49ff 100644 (file)
@@ -1,6 +1,6 @@
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 # $FreeBSD: src/share/man/man4/Makefile,v 1.83.2.66 2003/06/04 17:10:30 sam Exp $
-# $DragonFly: src/share/man/man4/Makefile,v 1.20 2005/04/06 03:25:46 y0netan1 Exp $
+# $DragonFly: src/share/man/man4/Makefile,v 1.21 2005/05/07 17:38:33 swildner Exp $
 
 MAN=   aac.4 \
        acpi.4 \
@@ -146,7 +146,6 @@ MAN=        aac.4 \
        pcic.4 \
        pcm.4 \
        pcn.4 \
-       pcvt.4 \
        pf.4 \
        pflog.4 \
        pfsync.4 \
@@ -251,7 +250,6 @@ MLINKS+=lp.4 plip.4
 MLINKS+=mem.4 kmem.4
 MLINKS+=netintro.4 networking.4
 MLINKS+=pcm.4 snd.4
-MLINKS+=pcvt.4 vt.4
 MLINKS+=scsi.4 CAM.4
 MLINKS+=scsi.4 SCSI.4
 MLINKS+=scsi.4 cam.4
index 233f514..88d18d4 100644 (file)
@@ -25,7 +25,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\" $FreeBSD: src/share/man/man4/atkbd.4,v 1.12.2.5 2001/08/17 13:08:36 ru Exp $
-.\" $DragonFly: src/share/man/man4/atkbd.4,v 1.2 2003/06/17 04:36:58 dillon Exp $
+.\" $DragonFly: src/share/man/man4/atkbd.4,v 1.3 2005/05/07 17:38:33 swildner Exp $
 .\"
 .Dd May 21, 1999
 .Dt ATKBD 4
@@ -46,10 +46,9 @@ driver, together with the
 driver, provides access to the AT 84 keyboard or the AT enhanced keyboard
 which is connected to the AT keyboard controller.
 .Pp
-This driver is required for the console drivers
+This driver is required for the
 .Xr syscons 4
-and
-.Xr pcvt 4 .
+console driver.
 .Pp
 There can be only one
 .Nm
@@ -189,7 +188,6 @@ to
 .Sh SEE ALSO
 .Xr kbdcontrol 1 ,
 .Xr atkbdc 4 ,
-.Xr pcvt 4 ,
 .Xr psm 4 ,
 .Xr syscons 4 ,
 .Xr boot 8 ,
diff --git a/share/man/man4/pcvt.4 b/share/man/man4/pcvt.4
deleted file mode 100644 (file)
index 3736cca..0000000
+++ /dev/null
@@ -1,927 +0,0 @@
-.\"
-.\"  Copyright (c) 1992, 2000 Hellmuth Michaelis, Brian Dunford-Shore,
-.\"                           Joerg Wunsch and Holger Veit.
-.\"
-.\"  All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"    This product includes software developed by Hellmuth Michaelis,
-.\"    Brian Dunford-Shore, Joerg Wunsch and Holger Veit.
-.\" 4. The name authors may not be used to endorse or promote products
-.\"    derived from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-.\" IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
-.\" Last Edit-Date: [Sun Jan  9 09:43:04 2000]
-.\"
-.\" $FreeBSD: src/share/man/man4/pcvt.4,v 1.22.2.5 2002/03/19 18:24:07 schweikh Exp $
-.\" $DragonFly: src/share/man/man4/Attic/pcvt.4,v 1.3 2004/03/11 12:28:55 hmp Exp $
-.\"
-.\" Man page pcvt(4) created after pcvt_ioctl.h on 13-Jan-93
-.\" by Joerg Wunsch
-.\"
-.Dd January 9, 2000
-.Dt PCVT 4
-.Os
-.Sh NAME
-.Nm pcvt ,
-.Nm vt
-.Nd PC console virtual screen system
-.Sh SYNOPSIS
-.Cd "options ""PCVT_FREEBSD=version" | "PCVT_NETBSD=version"""
-.Cd "options ""PCVT_NSCREENS=number"""
-.Cd "options PCVT_XXXX" No ( see Sx Configuration No below )
-.Pp
-.Cd "device vt0 at isa?"
-.Sh DESCRIPTION
-.Ss Overview
-The
-.Nm
-driver provides a virtual screen system with several additional
-features not available in historic console drivers.
-Besides the ability of handling
-multiple virtual screens,
-the probably most important is an emulation of a wide range
-of DEC
-.Tn VT-220
-functionality.
-See
-.Sx Features
-for a detailed description.
-.Pp
-The
-.Nm
-driver requires the keyboard driver
-.Nm atkbd
-to be also configured in the kernel.
-.Ss Features
-.Bl -bullet -compact
-.It
-Almost full DEC
-.Tn VT220
-functionality
-.Po
-moving towards
-.Tn VT320
-.Pc
-.It
-Completely independent virtual terminals for MDA/HGC/CGA/EGA and VGA
-.It
-25, 28, 35, 40, 43 or 50x80 screen resolution for each virtual screen
-.It
-Fully remappable keyboard to support national keyboards
-.It
-All VT220 character sets plus ISO Latin-1 and DEC technical supported
-.It
-VT220 downloadable character set supported when run on EGA/VGA
-.It
-VT220 user defined keys for each virtual terminal
-.It
-Optional function key label support
-\('a la Hewlett-Packard
-.It
-Display function codes functionality
-.It
-Support for MDA, CGA, EGA and VGA display adaptors
-.It
-Support for 132 column operation on VGA chipsets
-.It
-X Window Support for XFree86 >= 1.2 using the pccons model, or
-for XFree86 >= 2.0 using the syscons model
-.Po
-requires
-.Em PCVT_USL_VT_COMPAT
-to be configured
-.Pc
-.El
-.Pp
-What it cannot:
-.Pp
-.Bl -bullet -compact
-.It
-No double wide/high characters
-.It
-No softscroll
-.It
-No inverse background
-.It
-No VT220 printer output support
-.It
-No VT52 support at all
-.It
-No 8-bit controls
-.It
-Only limited AT-keyboard
-.Pq 84 keys
-support
-.Pq yet
-.It
-Help you to make money...
-.El
-.Ss Scrollback
-Each virtual
-.Nm
-virtual terminal now has 8 pages of memory attached which are used as a
-scrollback buffer (definition of SCROLLBACK_PAGES).
-.Pp
-By using
-.Em SHIFT-PageUp
-and
-.Em SHIFT-PageDown
-it is possible to scroll the screen back and forward.
-.Ss Configuration
-.Em Note
-to
-.Dx
-users: for the purposes of the following documentation, pretend you're
-using a FreeBSD system, pending possible implemention changes.
-.Pp
-The
-.Nm
-console driver is currently available for the Intel-based BSD operating
-systems
-.Tn NetBSD/i386
-(release 0.9 or higher),
-and
-.Fx
-(release 1.0-GAMMA or higher) .
-In order to get the appropriate system support, one of the options
-.Em PCVT_NETBSD ,
-or
-.Em PCVT_FREEBSD
-must be defined in the system's config file
-.Pq see Xr config 8 .
-In addition, for the
-.Fx
-and
-.Nx
-operating systems, it is necessary to set this option to the operating
-system's version number.
-For
-.Fx
-this version number must be expressed as a 3-digit number.
-E.\& g., if you are running the 1.0 release
-.Pq which is actually version 1.0.2 ,
-you should define
-.Pp
-.Em PCVT_FREEBSD = 102
-.Pp
-For
-.Nx
-this version number must be expressed as 9 if you are running
-.Nx 0.9
-and anything greater than 9 for NetBSD-current (pre 1.0). It is recommended
-to use (as with
-.Fx )
-100 for
-.Nx 1.0
-and 999 for
-.Tn NetBSD-current.
-E.g., if you are running the
-.Nx 1.0
-release, you should define
-.Pp
-.Em PCVT_NETBSD = 100
-.Pp
-The
-.Nm
-driver has been designed to be highly configurable in order to satisfy
-everyone's needs.
-The preferred way for those configurations is to
-provide appropriate
-.Em options
-lines within the config file, possibly overriding the built-in default
-values.
-Therefore it is possible to compile several distinct kernels
-with different driver behaviour on a single machine.
-.Pp
-The following list gives a short overview of the available configuration
-options.
-Refer to the file
-.Pa i386/isa/pcvt/pcvt_hdr.h
-in the kernel source tree for detailed documentation.
-.Pp
-Note: the following conventions apply to all the Boolean options.
-If an option is given with no value, a value of 1
-.Pq activated
-is substituted.
-If an option value is given as 0, this options is
-deactivated.
-Any other value is substituted by 1, too.
-If an option
-is omitted, a built-in default is assumed.
-.Bl -tag -width indent
-.It Em PCVT_NSCREENS
-Defines the number of virtual screens.
-.Pp
-Default: 8
-.It Em PCVT_VT220KEYB
-If activated, a keyboard layout resembling a DEC VT200 (TM) is generated.
-If deactivated, a mixture between VT220 and HP is used.
-See the files
-.Pa Keyboard.VT
-and
-.Pa Keyboard.HP
-in the
-.Nm
-documentation directory for a full description.
-.Pp
-Default: off
-.It Em PCVT_SCREENSAVER
-Enables the builtin screensaver feature.
-.Pp
-Default: on
-.It Em PCVT_PRETTYSCRNS
-If enabled, a blinking-star screensaver is used.
-If disabled, the screen
-is simply blanked
-.Pq which might be useful for energy-saving monitors .
-.Pp
-Default: on
-.It Em PCVT_CTRL_ALT_DEL
-If enabled, the key combination
-.Aq Em Ctrl
-.Aq Em Alt
-.Aq Em Del
-invokes a CPU reset.
-.Pp
-Default: off
-.It Em PCVT_USEKBDSEC
-Do NOT override a security lock for the keyboard.
-.Pp
-Default: on
-.It Em PCVT_24LINESDEF
-If enabled, the 25-line modi
-.Po
-VT emulation with 25 lines, and HP emulation with 28 lines
-.Pc
-default to 24 lines only to provide a better compatibility to the
-original DEV VT220 (TM). Thus it should be possible to use the
-terminal information for those terminals without further changes.
-Note that this is a startup option; it is possible to toggle between
-the 24- and 25-lines' display by the
-.Xr scon 1
-utility.
-.Pp
-Default: off
-.It Em PCVT_EMU_MOUSE
-Emulate a three-button mouse via the keypad.
-Useful for notebooks when
-running XFree86.
-See
-.Sx Mouse emulation
-below.
-.Pp
-Default: off
-.It Em PCVT_META_ESC
-If enabled, a sequence composed of
-.Aq Em esc ,
-followed by the normal key code is emitted if a key is pressed with the
-.Aq Em Alt
-key modifier.
-If disabled, then normal key code with the value
-.Em 0x80
-added is sent.
-.Pp
-Default: off
-.El
-.Pp
-Note that there are further options available which are mainly used for
-debugging purposes or as a workaround for hardware problems.
-They are
-found in
-.Pa i386/isa/pcvt/pcvt_hdr.h
-along with their documentation.
-.Ss Internal Functions
-The functionality described below may be accessed via
-.Xr ioctl 2
-system calls with a file descriptor opened on a device node
-related to the
-.Nm
-driver.
-To make use of them, a program should contain the following line:
-.Pp
-.Dl #include <machine/pcvt_ioctl.h>
-.Pp
-Any parameter definitions cited below can be found in that file.
-.Pp
-.Em Keyboard related functions
-.Pp
-Three functions are related to basic keyboard hardware:
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It KBDRESET
-reset keyboard, set defaults;
-.It KBDGTPMAT
-get current typematic value, parameter is a pointer to int where
-the values is stored to;
-.It KBDSTPMAT
-set current typematic value, similar to above command.
-.El
-.Pp
-Symbolic values are available for the appropriate constants.
-To specify the initial typematic delay time, they are
-KBD_TPD250 for 250 ms through
-KBD_TPD1000 for 1000 ms, in steps of 250 ms.
-The typematic repeat
-rates are
-KBD_TPM300, specifying 30.0 characters per second through
-KBD_TPM20 for 2.0 characters per second.
-The intermediate values
-are: 30.0, 26.7, 24.0, 21.8, 20.0, 18.5, 17.1, 16.0, 15.0, 13.3,
-12.0, 10.9, 10.0, 9.2, 8.6, 8.0, 7.5, 6.7, 6.0, 5.5, 5.0, 4.6, 4.3,
-4.0, 3.7, 3.3, 3.0, 2.7, 2.5, 2.3, 2.1, 2.0 characters per second.
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It KBDGREPSW
-get key repetition switch, and
-.It KBDSREPSW
-set key repetition switch
-.El
-.Pp
-again take a pointer to int as argument.
-They manipulate the
-drivers internal keyboard repetition flag, possible values are:
-KBD_REPEATOFF or KBD_REPEATON.
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It KBDGLEDS
-get LED state, and
-.It KBDSLEDS
-set LED state manipulate the keyboard indicators, but do not influence
-the drivers idea of lock key state.
-.El
-.Pp
-The int where the argument points to
-may have the values
-KBD_SCROLLLOCK, KBD_NUMLOCK, KBD_CAPSLOCK, which may be used in any
-conjunction.
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It KBDGLOCK
-gets state of SCROLL,NUM,CAPS, and
-.It KBDSLOCK
-sets state of SCROLL,NUM,CAPS + LEDs
-.El
-.Pp
-should be used in a same manner to get/set the drivers internal
-LED flags.
-.Pp
-.Em Keyboard remapping
-.Pp
-One important feature of the
-.Nm
-driver is its ability to overload the built in key definition.
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It KBDGCKEY
-get current key values,
-.It KBDSCKEY
-set new key assignment values, and
-.It KBDGOKEY
-get original key assignment values
-.El
-.Pp
-arrange those functions.
-The take a pointer to a
-.Em struct kbd_ovlkey
-as argument as described below.
-In addition,
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It KBDRMKEY
-removes a key assignment, taking a pointer to an int as argument which
-contains the affected key number;
-.It KBDDEFAULT
-removes all key assignments.
-.El
-.Bd -literal
-struct kbd_ovlkey                /* complete definition of a key */
-{
-    u_short keynum;                      /* the key itself */
-    u_short type;                        /* type of key, see below */
-    u_char  subu;                        /* subtype, ignored on write */
-    char    unshift[KBDMAXOVLKEYSIZE+1]; /* emitted string, unshifted */
-    u_char  subs;                        /* subtype, ignored on write */
-    char    shift[KBDMAXOVLKEYSIZE+1];   /* emitted string, shifted */
-    u_char  subc;                        /* subtype, ignored on write */
-    char    ctrl[KBDMAXOVLKEYSIZE+1];    /* emitted string, control */
-    u_char  suba;                        /* subtype, ignored on write */
-    char    altgr[KBDMAXOVLKEYSIZE+1];   /* emitted string, altgr */
-};
-.Ed
-.Pp
-The appropriate values for the
-.Em type
-field are:
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It KBD_NONE
-no function, key is disabled,
-.It KBD_SHIFT
-keyboard shift,
-.It KBD_META
-alternate shift, sets bit8 to ASCII code,
-.It KBD_NUM
-numeric shift, keypad numeric / application mode,
-.It KBD_CTL
-control code generation,
-.It KBD_CAPS
-caps shift - swaps case of letter,
-.It KBD_ASCII
-ASCII code generating key,
-.It KBD_SCROLL
-stop output,
-.It KBD_FUNC
-function key,
-.It KBD_KP
-keypad keys,
-.It KBD_BREAK
-ignored,
-.It KBD_ALTGR
-AltGr translation feature,
-.It KBD_SHFTLOCK
-shift lock,
-.It KBD_CURSOR
-cursor keys, and
-.It KBD_RETURN
-.Dq Return
-or
-.Dq Enter
-keys.
-.El
-.Pp
-The
-.Em subtype
-field contains one of the values
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It KBD_SUBT_STR
-key is bound to a string, or
-.It KBD_SUBT_FNC
-key is bound to a function.
-.El
-.Pp
-.Em Mouse emulation
-.Pp
-The mouse emulator
-.Pq if configured in
-fakes a three-button mouse using the Mouse Systems protocol.
-The first
-.Nm
-device node not used by a virtual screen is the mouse device.
-I.\& e.,
-for the default value of 8 virtual screens,
-.Pa /dev/ttyv0
-through
-.Pa /dev/ttyv7
-would refer to the virtual screens, and
-.Pa /dev/ttyv8
-were the mouse emulator device.
-The mouse emulation is turned on by
-pressing the
-.Aq Em NumLock
-key.
-The pointer is moved by the numerical keypad keys, into the
-obvious directions.
-The pointer is initially moved in single steps,
-and is accelerated after an adjustable time
-.Pq default: 500 ms
-by about 6 times.
-The mouse buttons are emulated by three normal
-keys, by default the function keys
-.Aq Em \&F1 ,
-.Aq Em \&F2 ,
-and
-.Aq Em \&F3 .
-There are two selectable flavors available: normal and
-.Dq sticky
-buttons.
-Normal buttons behave as expected.
-.Dq Sticky
-buttons are notified as button-press on the first keypress.
-They
-.Dq stick
-until the key is pressed again
-.Pq or another button-emulating key instead .
-Button presses and releases are notified to the user by a simple
-.Dq pling ,
-or
-.Dq plong ,
-respectively, generated from the PC's built-in speaker.
-.Pp
-The following commands control the emulation.
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It KBDMOUSEGET
-get the current definitions, and
-.It KBDMOUSESET
-set new definitions.
-.El
-.Pp
-Both accept a
-.Li struct mousedefs *
-as the third argument to the ioctl call:
-.Bd -literal
-struct mousedefs {
-    int leftbutton;     /* (PC) scan code for "left button" key     */
-    int middlebutton;   /* (PC) scan code for "mid button" key      */
-    int rightbutton;    /* (PC) scan code for "right button" key    */
-    int stickybuttons;  /* if true, the buttons are "sticky"        */
-    int acceltime;      /* timeout in microseconds to start pointer */
-                        /* movement acceleration                    */
-    /* defaults to: scan(F1), scan(F2), scan(F3), false, 500000     */
-};
-.Ed
-.Pp
-.Em Downloadable character set interface
-.Pp
-EGA and VGA video adaptors provide the capability of downloadable
-software fonts.
-Since the
-.Sq native character set
-of any IBM-compatible PC video board does not allow the full interpretation
-of DEC multinational character set or ISO Latin-1
-.Pq ISO 8859-1 ,
-this might be very useful for a U**X environment.
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It VGASETFONTATTR
-set font attr, and
-.It VGAGETFONTATTR
-get font attr
-.El
-.Pp
-are used to manipulate the drivers information about a downloaded
-font.
-The take a pointer to a
-.Em struct vgafontattr
-as argument:
-.Bd -literal
-struct vgafontattr {
-    int character_set;          /* VGA character set */
-    int font_loaded;            /* Mark font loaded or unloaded */
-    int screen_size;            /* Character rows per screen */
-    int character_scanlines;    /* Scanlines per character - 1 */
-    int screen_scanlines;       /* Scanlines per screen - 1 byte */
-};
-.Ed
-.Pp
-Each character of each font is to be downloaded with
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It VGALOADCHAR
-load vga char,
-.El
-.Pp
-taking a pointer to
-.Em struct vgaloadchar
-as its argument:
-.Bd -literal
-struct vgaloadchar {
-    int character_set;       /* VGA character set to load into */
-    int character;           /* Character to load */
-    int character_scanlines; /* Scanlines per character */
-    u_char char_table[32];   /* VGA character shape table */
-};
-.Ed
-.Pp
-The field
-.Em character_set
-takes the values
-CH_SET0, CH_SET1, CH_SET2, CH_SET3 on EGA's or VGA's. Since VGA's
-might have up to eight simultaneously loaded fonts, they can take
-CH_SET4, CH_SET5, CH_SET6, or CH_SET7, too.
-.Pp
-Note that there's a dependence between the font size
-and a possible screen height
-.Pq in character rows ,
-depending on the video adaptor used:
-.Bd -literal
-Screen size (rows) on:          EGA             VGA
-Font size
-
-8 x 8                           43              50
-8 x 10                          35              40
-8 x 14                          25              28
-8 x 16                          not             25
-                                applicable
-.Ed
-.Pp
-.Em General screen manipulation commands
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It VGACURSOR
-sets cursor shape,
-.El
-.Pp
-taking a pointer to the following structure as argument:
-.Bd -literal
-struct cursorshape {
-    int screen_no; /* screen number for which to set,               */
-                   /*  or -1 to set on current active screen        */
-    int start;     /* top scanline, range 0... Character Height - 1 */
-    int end;       /* end scanline, range 0... Character Height - 1 */
-};
-.Ed
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It VGASETSCREEN
-set screen info, and
-.It VGAGETSCREEN
-get screen info,
-.El
-.Pp
-provide an interface to some general driver internal variables
-which might modify the behaviour of the screens,
-or which might simply be used to force the driver to switch
-to one certain screen.
-Their argument is a pointer to the structure:
-.Bd -literal
-struct screeninfo {
-    int adaptor_type;   /* type of video adaptor installed     */
-                        /* read only, ignored on write (yet!)  */
-    int totalfonts;     /* no of downloadable fonts            */
-                        /* read only, ignored on write         */
-    int totalscreens;   /* no of virtual screens               */
-                        /* read only, ignored on write         */
-    int screen_no;      /* screen number, this was got from    */
-                        /* on write, if -1, apply pure_vt_mode */
-                        /* and/or screen_size to current screen*/
-                        /* else to screen_no supplied          */
-    int current_screen; /* screen number, which is displayed.  */
-                        /* on write, if -1, make this screen   */
-                        /* the current screen, else set current*/
-                        /* displayed screen to parameter       */
-    int pure_vt_mode;   /* flag, pure VT mode or HP/VT mode    */
-                        /* on write, if -1, no change          */
-    int screen_size;    /* screen size                         */
-                        /* on write, if -1, no change          */
-    int force_24lines;  /* force 24 lines if 25 lines VT mode  */
-                        /* or 28 lines HP mode to get pure     */
-                        /* VT220 screen size                   */
-                        /* on write, if -1, no change          */
-    int vga_family;     /* if adaptor_type = VGA, this reflects*/
-                        /* the chipset family after a read     */
-                        /* nothing happens on write ...        */
-    int vga_type;       /* if adaptor_type = VGA, this reflects*/
-                        /* the chipset after a read            */
-                        /* nothing happenes on write ...       */
-    int vga_132;        /* set to 1 if driver has support for  */
-                        /* 132 column operation for chipset    */
-                        /* currently ignored on write          */
-};
-.Ed
-.Pp
-Its field
-.Em pure_vt_mode
-may take the values M_HPVT for a mixed VTxxx and HP Mode, with function
-key labels and a status line, or M_PUREVT for only VTxxx sequences
-recognized, with no labels.
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It VGASETCOLMS
-sets the number of columns for the current screen,
-.El
-.Pp
-its parameter is a pointer to an integer containing either a value of 80,
-or a value of 132.
-Note that setting the number of columns to 132 is
-only supported on VGA adaptors.
-Any unsupported numbers cause the ioctl
-to fail with
-.Em errno
-.Pq see Xr intro 2
-being set to
-.Em EINVAL .
-.Pp
-.Em VGA color palette interface
-.Pp
-Only on VGA adaptors, there's a color palette register at the output.
-It is responsible for the red, green and blue output voltage provided
-for each of the 256 internal color codes, each lying in the range of
-0 through 63 (with 63 representing the brightest value for a base color).
-Thus, these adaptors map each color code to a color of a
-.Dq palette
-out of 262144 colors.
-The commands
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It VGAREADPEL
-read VGA palette entry, and
-.It VGAWRITEPEL
-write VGA palette entry
-.El
-.Pp
-establish an interface to these palette registers.
-Their argument is
-a pointer to:
-.Bd -literal
-struct vgapel {
-    unsigned idx;      /* index into palette, 0 .. 255 valid   */
-    unsigned r, g, b;  /* RGB values, masked by VGA_PMASK (63) */
-};
-.Ed
-.Pp
-.Em Driver identification
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It VGAPCVTID
-returns information if the current compiled in driver is pcvt and it's
-major and minor revision numbers. the call is taking a pointer to the
-following structure as argument:
-.El
-.Bd -literal
-struct pcvtid {
-#define PCVTIDNAMELN  16               /* driver id - string length */
-       char name[PCVTIDNAMELN];        /* driver name, == PCVTIDSTR    */
-#define PCVTIDNAME    "pcvt"           /* driver id - string */
-       int rmajor;                     /* revision number, major       */
-#define PCVTIDMAJOR   3
-       int rminor;                     /* revision number, minor       */
-#define PCVTIDMINOR   00
-};
-.Ed
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It VGAPCVTINFO
-returns information if the current compiled in driver is pcvt and it's
-compile time options. the call is taking a pointer to the following
-structure as argument:
-.El
-.Bd -literal
-struct pcvtinfo {
-       u_int opsys;                    /* PCVT_xxx(x)BSD */
-#define CONF_UNKNOWNOPSYS      0
-#define CONF_386BSD            1       /* unsupported !!! */
-#define CONF_NETBSD            2
-#define CONF_FREEBSD           3
-       u_int opsysrel;                 /* Release for NetBSD/FreeBSD */
-       u_int nscreens;                 /* PCVT_NSCREENS */
-       u_int scanset;                  /* PCVT_SCANSET */
-       u_int updatefast;               /* PCVT_UPDATEFAST */
-       u_int updateslow;               /* PCVT_UPDATESLOW */
-       u_int sysbeepf;                 /* PCVT_SYSBEEPF */
-       u_int pcburst;                  /* PCVT_PCBURST */
-       u_int kbd_fifo_sz;              /* PCVT_KBD_FIFO_SZ */
-
-/* config booleans */
-
-       u_long compile_opts;            /* PCVT_xxxxxxxxxxxxxxx */
-};
-.Ed
-.Pp
-.Em Screen saver
-.Pp
-Depending on the configuration of a
-.Nm
-driver, their might be a simple screen saver available.
-It is controlled
-by the command
-.Pp
-.Bl -tag -width 20n -offset indent -compact
-.It VGASCREENSAVER
-set timeout for screen saver in seconds; 0 turns it off,
-.El
-.Pp
-taking a pointer to an integer as argument.
-Despite of its command name,
-this is available on
-.Em any
-kind of adaptor if configured in by the
-.Xr config 8
-option
-.Dq PCVT_SCREENSAVER
-.Pp
-.Em Compatibility commands for USL-style VT's
-.Pp
-Release 3.00 of this
-.Nm
-driver supports a subset of the USL-style commands used to control
-the virtual terminal interface.
-This feature is mainly intended to
-allow
-.Em XFree86 ,
-release 2.0 or higher, to switch between virtual screens even when
-running an X server.
-They are ugly with respect to the implied semantics
-(i.e., they break Berkeley semantics)
-and are therefore not recommended for common use.
-See the file
-.Pa i386/include/pcvt_ioctl.h
-for their documentation.
-.Sh FILES
-.Bl -tag -width /usr/include/machine/pcvt_ioctl.h
-.It Pa /usr/include/machine/pcvt_ioctl.h
-Definitions for
-.Xr ioctl 2
-function calls
-.It Pa /dev/ttyv?
-.It Pa /dev/console
-Device nodes to access the
-.Nm
-driver
-.It Pa i386/isa/pcvt/pcvt_hdr.h
-.Pq relative to the kernel source tree
-Documents the various compile-time options to tailor
-.Nm .
-.El
-.Sh HISTORY
-The
-.Nm
-driver has been developed for and contributed to 386BSD release 0.1. Since
-release 3.00 explicit support is provided for NetBSD 0.9. It is expected
-that no further development on pcvt is done for 386BSD 0.1 after release 3.00,
-in fact, 386BSD support was dropped with release 3.20.
-.Sh AUTHORS
-.An -nosplit
-Written by
-.An Hellmuth Michaelis Aq hm@hcs.de
-with much help from
-.An Brian Dunford-Shore Aq brian@morpheus.wustl.edu
-and
-.An J\(:org Wunsch Aq joerg_wunsch@uriah.sax.de .
-.Pp
-This driver is based on several people's previous
-work, notably by
-.An William Jolitz' Aq ljolitz@cardio.ucsf.edu
-and
-.An Don Ahn's
-historic
-.Xr pccons 4
-implementation.
-.Pp
-.An Holger Veit Aq veit@first.gmd.de
-.Sh SEE ALSO
-.Xr cursor 1 ,
-.Xr loadfont 1 ,
-.Xr scon 1 ,
-.Xr intro 2 ,
-.Xr ioctl 2 ,
-.Xr atkbd 4 ,
-.Xr keyboard 4 ,
-.Xr screen 4 ,
-.Xr config 8 ,
-.Xr ispcvt 8
-.Sh BUGS
-Certainly existent.
-See the file
-.Pa BugList
-in the Documentation directory for an up-to-date list.
-.Ss Tested Video Boards
-.Bd -literal
-Manufacturer                    Chipset                 Monitor
-
-2theMax (?)                     ET4000                  VGA Color
-Video7 Inc.                     Video 7                 VGA Color
-Diamond Stealth VRAM            S3                      NEC 3FGx
-Trident                         TVGA 8800CS             NEC 3D
-Data General                    C&T P82C604             VGA Color
-NoName Hercules                 W86855AF                Mono
-Kyocera (Mainboard)            WD90C11                 Sony Color
-unknown                                ET3000                  NEC 3D
-.Ed
-.Ss Tested Keyboards
-.Bd -literal
-Manufacturer                    Type                    Layout
-
-Cherry                          MF II                   US
-Cherry/Tandon                   MF II                   German
-Hewlett-Packard                 MF II                   US
-Hewlett-Packard                 MF II                   German
-Tatung                          AT                      German
-.Ed
-.Pp
-There is absolutely NO support for the ancient PC-keyboards
-.Pq they had 83 keys .
-.Pp
-There is only limited support for AT-keyboards
-.Bo
-they have 84 keys, and a separate numeric keypad,
-they don't have F11/F12 keys
-.Bc
-because the emulator needs F9 through F12 for control functions, and due to
-the current design of the keyboard driver there is no
-.Pq full
-support for national keyboards because
-of the lack of an ALtGr key.
-.Pp
-MF-keyboards are fully supported, 101- and 102-key versions.
index e6da541..c1b173f 100644 (file)
@@ -25,7 +25,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\" $FreeBSD: src/share/man/man4/splash.4,v 1.9.2.7 2001/08/17 13:08:39 ru Exp $
-.\" $DragonFly: src/share/man/man4/splash.4,v 1.2 2003/06/17 04:36:59 dillon Exp $
+.\" $DragonFly: src/share/man/man4/splash.4,v 1.3 2005/05/07 17:38:33 swildner Exp $
 .\"
 .Dd February 9, 1999
 .Dt SPLASH 4
@@ -214,12 +214,6 @@ necessary to load the VESA module.
 Just load the bitmap file and the splash decoder module as in the
 first example above.
 .\".Sh DIAGNOSTICS
-.Sh CAVEATS
-Both the splash screen and the screen saver work with
-.Xr syscons 4
-only.
-They are not available for the alternative console driver
-.Xr pcvt 4 .
 .Sh BUGS
 If you load a screen saver while another screen saver has already
 been loaded, the first screen saver will not be automatically unloaded
index e337f2c..3b8f31b 100644 (file)
@@ -23,7 +23,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.197 2003/07/28 13:56:00 mbr Exp $
-.\" $DragonFly: src/share/man/man5/rc.conf.5,v 1.10 2005/03/17 22:25:46 dillon Exp $
+.\" $DragonFly: src/share/man/man5/rc.conf.5,v 1.11 2005/05/07 17:38:33 swildner Exp $
 .Dd March 3, 2002
 .Dt RC.CONF 5
 .Os
@@ -2497,144 +2497,6 @@ by default.
 Flags for
 .Xr isdntrace 8 .
 .\" -----------------------------------------------------
-.It Va pcvt_verbose
-.Pq Vt bool
-Set to
-.Dq Li NO
-by default.
-When set to
-.Dq Li YES ,
-verbose messages about the actions done by the start script are displayed.
-.Em Note :
-the
-.Xr pcvt 4
-driver must be compiled into the kernel before the
-.Xr pcvt 4
-related
-options described here take any effect.
-.It Va pcvt_keymap
-.Pq Vt str
-Set to
-.Dq Li NO
-by default.
-Use this to configure a national keyboard mapping found in the
-.Pa /usr/share/misc/keycap.pcvt
-file of keyboard mappings.
-(See also the manual pages
-.Xr keycap 5
-and
-.Xr keycap 3
-for usage of
-.Xr pcvt 4 Ns 's
-keycap database and the manual page
-.Xr kcon 1
-option
-.Fl m
-for national keyboard mapping configuration.)
-.It Va pcvt_keydel
-.Pq Vt int
-Set to
-.Dq Li NO
-by default.
-Used to set the keyboard key repeat delay value.
-Valid values are
-in the range 0..3 for delay values of 250, 500, 750 and 1000 msec.
-(See also the
-.Xr kcon 1
-manual page.)
-.It Va pcvt_keyrate
-.Pq Vt int
-Set to
-.Dq Li NO
-by default.
-Used to set the keyboard key repetition rate value.
-Valid values are
-in the range 0..31 for repetition values of 2..30 characters per second.
-.It Va pcvt_keyrepeat
-.Pq Vt bool
-Set to
-.Dq Li NO
-by default.
-Set to
-.Dq Li YES
-to enable automatic keyboard key repeating.
-.It Va pcvt_force24
-.Pq Vt bool
-Set to
-.Dq Li NO
-by default.
-Set to
-.Dq Li YES
-to force
-.Xr pcvt 4
-to use 24 lines only (in 25 lines mode) for compatibility
-with the original
-.Tn VT220
-terminal.
-.It Va pcvt_hpext
-.Pq Vt bool
-Set to
-.Dq Li NO
-by default.
-Set to
-.Dq Li YES
-to enable the display and functionality of function key labels (as found
-on
-.Tn Hewlett-Packard
-terminals such as the
-.Tn HP2392A
-and the
-.Tn HP700/92
-in
-.Tn ANSI
-mode).
-.It Va pcvt_lines
-.Pq Vt int
-Set to
-.Dq Li NO
-by default resulting in a value of 25.
-Used to set the number of lines on the screen.
-For VGA displays, valid
-values are 25, 28, 40 and 50 lines.
-(See also the
-.Xr scon 1
-manual page.)
-.It Va pcvt_blanktime
-.Pq Vt int
-Set to
-.Dq Li NO
-by default.
-Used to set the screen saver timeout in seconds for values greater than
-zero.
-.It Va pcvt_cursorh
-.Pq Vt int
-Set to
-.Dq Li NO
-by default.
-Used to set the cursor top scanline.
-(See also the
-.Xr cursor 1
-manual page.)
-.It Va pcvt_cursorl
-.Pq Vt int
-Set to
-.Dq Li NO
-by default.
-Used to set the cursor bottom scanline.
-.It Va pcvt_monohigh
-.Pq Vt bool
-Set to
-.Dq Li NO
-by default.
-Set to
-.Dq Li YES
-to set intensity to high on monochrome monitors.
-(See also the
-.Xr scon 1
-manual page, option
-.Fl p ,
-for more information on changing VGA palette
-values.)
 .It Va harvest_interrupt
 .Pq Vt bool
 Set to
index 0a404af..368436e 100644 (file)
@@ -31,7 +31,7 @@
 .\"
 .\"    @(#)hier.7      8.1 (Berkeley) 6/5/93
 .\" $FreeBSD: src/share/man/man7/hier.7,v 1.29.2.17 2003/01/13 21:43:50 ceri Exp $
-.\" $DragonFly: src/share/man/man7/hier.7,v 1.4 2004/03/11 12:28:56 hmp Exp $
+.\" $DragonFly: src/share/man/man7/hier.7,v 1.5 2005/05/07 17:38:33 swildner Exp $
 .\"
 .Dd June 5, 1993
 .Dt HIER 7
@@ -471,12 +471,6 @@ see
 .It Pa misc/
 misc system-wide ASCII text files
 .Bl -tag -width Fl -compact
-.It Pa fonts/
-???
-.It Pa pcvtfonts/
-pcvt fonts;
-see
-.Xr pcvt 4
 .It Pa termcap
 terminal characteristics database;
 see
@@ -490,10 +484,6 @@ see
 national language support files;
 see
 .Xr mklocale 1
-.It Pa pcvt/
-pcvt documentation and etc examples;
-see
-.Xr pcvt 4
 .It Pa perl/
 perl library files;
 see
index fa80233..23fecc9 100644 (file)
@@ -31,7 +31,7 @@
 .\"
 .\"    @(#)MAKEDEV.8   8.1 (Berkeley) 6/5/93
 .\" $FreeBSD: src/share/man/man8/man8.i386/MAKEDEV.8,v 1.15.2.5 2002/05/11 06:15:16 dd Exp $
-.\" $DragonFly: src/share/man/man8/man8.i386/MAKEDEV.8,v 1.4 2005/03/22 00:40:54 dillon Exp $
+.\" $DragonFly: src/share/man/man8/man8.i386/MAKEDEV.8,v 1.5 2005/05/07 17:38:33 swildner Exp $
 .\"
 .Dd June 5, 1993
 .Dt MAKEDEV 8 i386
@@ -91,7 +91,7 @@ SCSI changer devices
 .It ses#
 SCSI SES/SAF-TE environmental devices
 .It vty#
-set of 12 virtual console devices for syscons/pcvt/codrv
+set of 12 virtual console devices for syscons
 .It ad#
 .Dq ATAPI
 disk drives (IDE).
index 0a49d1f..8cd3517 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/share/mk/bsd.libnames.mk,v 1.28.2.10 2002/08/08 09:33:28 ru Exp $
-# $DragonFly: src/share/mk/bsd.libnames.mk,v 1.9 2005/01/11 14:36:49 joerg Exp $
+# $DragonFly: src/share/mk/bsd.libnames.mk,v 1.10 2005/05/07 17:38:33 swildner Exp $
 #
 # The include file <bsd.libnames.mk> define library names. 
 # Other include files (e.g. bsd.prog.mk, bsd.lib.mk) include this 
@@ -53,7 +53,6 @@ LIBKCORE?=    ${DESTDIR}${LIBDIR}/libkcore.a
 LIBKDB?=       ${DESTDIR}${LIBDIR}/libkdb.a    # XXX in secure dist, not base
 LIBKRB?=       ${DESTDIR}${LIBDIR}/libkrb.a    # XXX in secure dist, not base
 LIBKRB5?=      ${DESTDIR}${LIBDIR}/libkrb5.a   # XXX in secure dist, not base
-LIBKEYCAP?=    ${DESTDIR}${LIBDIR}/libkeycap.a
 LIBKINFO?=     ${DESTDIR}${LIBDIR}/libkinfo.a
 LIBKVM?=       ${DESTDIR}${LIBDIR}/libkvm.a
 LIBL?=         ${DESTDIR}${LIBDIR}/libl.a
index 9fefe21..46f660b 100644 (file)
@@ -31,7 +31,7 @@
 #
 #      @(#)termcap.src 8.2 (Berkeley) 11/17/93
 # $FreeBSD: src/share/termcap/termcap.src,v 1.89.2.26 2003/05/26 18:52:13 ache Exp $
-# $DragonFly: src/share/termcap/termcap.src,v 1.2 2003/06/17 04:37:03 dillon Exp $
+# $DragonFly: src/share/termcap/termcap.src,v 1.3 2005/05/07 17:38:33 swildner Exp $
 
 #      Termcap source file
 #      John Kunze, Berkeley
@@ -1456,259 +1456,6 @@ nansi.sysk|nansisysk|PC-DOS Public Domain NANSI.SYS with keypad redefined for vi
        :al=\E[1L:dl=\E[1M:ic=\E[1@:dc=\E[1P:\
        :is=U4 PC-DOS Public Domain NANSI.SYS with keypad redefined for vi 9-29-86\n\E[;75;8p:\
        :tc=ansi.sysk:
-#      Hellmuth Michaelis <hm@FreeBSD.org>
-#      pcvt vt220 terminal emulator console (pc keyboard & monitor)
-#      termcap entries for pure VT220-Emulation and 25, 28, 35, 40, 43 and
-#      50 lines entries
-#      80 columns
-#---------------------------------------------------------------------------
-pcvt25|dec vt220 with 25 lines:\
-       :li#25:\
-       :co#80:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;25r\E[25;1H:\
-       :tc=pcvtXX:
-
-pcvt28|dec vt220 with 28 lines:\
-       :li#28:\
-       :co#80:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;28r\E[28;1H:\
-       :tc=pcvtXX:
-
-pcvt35|dec vt220 with 35 lines:\
-       :li#35:\
-       :co#80:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;35r\E[35;1H:\
-       :tc=pcvtXX:
-
-pcvt40|dec vt220 with 40 lines:\
-       :li#40:\
-       :co#80:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;40r\E[40;1H:\
-       :tc=pcvtXX:
-
-pcvt43|dec vt220 with 43 lines:\
-       :li#43:\
-       :co#80:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;43r\E[43;1H:\
-       :tc=pcvtXX:
-
-pcvt50|dec vt220 with 50 lines:\
-       :li#50:\
-       :co#80:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;50r\E[50;1H:\
-       :tc=pcvtXX:
-#      termcap entries for pure VT220-Emulation and 25, 28, 35, 40, 43 and
-#      50 lines entries
-#      132 columns
-pcvt25w|dec vt220 with 25 lines and 132 cols:\
-       :li#25:\
-       :co#132:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;25r\E[25;1H:\
-       :tc=pcvtXX:
-
-pcvt28w|dec vt220 with 28 lines and 132 cols:\
-       :li#28:\
-       :co#132:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;28r\E[28;1H:\
-       :tc=pcvtXX:
-
-pcvt35w|dec vt220 with 35 lines and 132 cols:\
-       :li#35:\
-       :co#132:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;35r\E[35;1H:\
-       :tc=pcvtXX:
-
-pcvt40w|dec vt220 with 40 lines and 132 cols:\
-       :li#40:\
-       :co#132:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;40r\E[40;1H:\
-       :tc=pcvtXX:
-
-pcvt43w|dec vt220 with 43 lines and 132 cols:\
-       :li#43:\
-       :co#132:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;43r\E[43;1H:\
-       :tc=pcvtXX:
-
-pcvt50w|dec vt220 with 50 lines and 132 cols:\
-       :li#50:\
-       :co#132:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;50r\E[50;1H:\
-       :tc=pcvtXX:
-#      termcap entries for HP-Emulation and 25, 28, 35, 40, 43 and 50
-#      lines entries. note that the HP-Emulation uses the bottom 3 lines
-#      for status and function key labels, so we get always 3 lines less.
-#      "Xs" is a nonstandard, private flag indicating HP-like fkey labels
-#      80 column entries
-pcvt22h|dec vt220 with HP-fkey labels and 22 lines:\
-       :li#22:\
-       :co#80:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;22r\E[22;1H:\
-       :tc=pcvtXX:
-
-pcvt25h|dec vt220 with HP-fkey labels and 25 lines:\
-       :li#25:\
-       :co#80:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;25r\E[25;1H:\
-       :tc=pcvtXX:
-
-pcvt32h|dec vt220 with HP-fkey labels and 32 lines:\
-       :li#32:\
-       :co#80:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;32r\E[32;1H:\
-       :tc=pcvtXX:
-
-pcvt37h|dec vt220 with HP-fkey labels and 37 lines:\
-       :li#37:\
-       :co#80:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;37r\E[37;1H:\
-       :tc=pcvtXX:
-
-pcvt40h|dec vt220 with HP-fkey labels and 40 lines:\
-       :li#40:\
-       :co#80:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;40r\E[40;1H:\
-       :tc=pcvtXX:
-
-pcvt47h|dec vt220 with HP-fkey labels and 47 lines:\
-       :li#47:\
-       :co#80:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;47r\E[47;1H:\
-       :tc=pcvtXX:
-#      termcap entries for HP-Emulation and 25, 28, 35, 40, 43 and 50
-#      lines entries. note that the HP-Emulation uses the bottom 3 lines
-#      for status and function key labels, so we get always 3 lines less.
-#      "Xs" is a nonstandard, private flag indicating HP-like fkey labels
-#      132 column entries
-pcvt22hw|dec vt220 with HP-fkey labels, 22 lines and 132 cols:\
-       :li#22:\
-       :co#132:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;22r\E[22;1H:\
-       :tc=pcvtXX:
-
-pcvt25hw|dec vt220 with HP-fkey labels, 25 lines and 132 cols:\
-       :li#25:\
-       :co#132:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;25r\E[25;1H:\
-       :tc=pcvtXX:
-
-pcvt32hw|dec vt220 with HP-fkey labels, 32 lines and 132 cols:\
-       :li#32:\
-       :co#132:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;32r\E[32;1H:\
-       :tc=pcvtXX:
-
-pcvt37hw|dec vt220 with HP-fkey labels, 37 lines and 132 cols:\
-       :li#37:\
-       :co#132:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;37r\E[37;1H:\
-       :tc=pcvtXX:
-
-pcvt40hw|dec vt220 with HP-fkey labels, 40 lines and 132 cols:\
-       :li#40:\
-       :co#132:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;40r\E[40;1H:\
-       :tc=pcvtXX:
-
-pcvt47hw|dec vt220 with HP-fkey labels, 47 lines and 132 cols:\
-       :li#47:\
-       :co#132:\
-       :Xs:\
-       :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;47r\E[47;1H:\
-       :tc=pcvtXX:
-#      main entry, without "is" and "li" capabilities
-pcvtXX|pcvt vt200 emulator (DEC VT220):\
-       :AL=\E[%dL:\
-       :DC=\E[%dP:\
-       :DL=\E[%dM:\
-       :DO=\E[%dB:\
-       :IC=\E[%d@:\
-       :LE=\E[%dD:\
-       :RI=\E[%dC:\
-       :SF=\E[%dS:\
-       :SR=\E[%dT:\
-       :UP=\E[%dA:\
-        :ac=llmmkkjjuuttvvwwqqxxnnpprr``aa:\
-       :ae=^O:\
-       :al=\E[L:\
-       :am:\
-       :as=^N:\
-       :bl=^G:\
-       :bs:\
-       :cb=\E[1K:\
-       :cd=\E[J:\
-       :ce=\E[K:\
-       :cl=\E[H\E[J:\
-       :cm=\E[%i%d;%dH:\
-       :cr=^M:\
-       :cs=\E[%i%d;%dr:\
-       :ct=\E[3g:\
-       :dc=\E[P:\
-       :dl=\E[M:\
-       :do=^J:\
-        :eA=\E)0:\
-       :ei=\E[4l:\
-       :ho=\E[H:\
-       :im=\E[4h:\
-       :it#8:\
-       :k1=\E[17~:\
-       :k2=\E[18~:\
-       :k3=\E[19~:\
-       :k4=\E[20~:\
-       :k5=\E[21~:\
-       :k6=\E[23~:\
-       :k7=\E[24~:\
-       :k8=\E[25~:\
-       :kD=\E[3~:\
-       :kH=\E[4~:\
-       :kI=\E[2~:\
-       :kN=\E[6~:\
-       :kP=\E[5~:\
-       :kb=\177:\
-       :kd=\EOB:\
-       :ke=\E[?1l\E>:\
-       :kh=\E[1~:\
-       :kl=\EOD:\
-       :km:\
-       :kr=\EOC:\
-       :ks=\E[?1h\E=:\
-       :ku=\EOA:\
-       :le=^H:\
-       :mb=\E[5m:\
-       :md=\E[1m:\
-       :me=\E[m:\
-       :mi:\
-       :mr=\E[7m:\
-       :ms:\
-       :nd=\E[C:\
-       :pb#16000000:\
-       :pt:\
-       :rc=\E8:\
-       :rf=/usr/share/tabset/vt100:\
-       :rs=\Ec\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:\
-       :sc=\E7:\
-       :se=\E[27m:\
-       :sf=\ED:\
-       :so=\E[7m:\
-       :sr=\EM:\
-       :st=\EH:\
-       :ue=\E[24m:\
-       :up=\E[A:\
-       :us=\E[4m:\
-       :vt#3:\
-       :xn:
-
 # \f# --------------------------------
 #
 # T: TELETYPE
index 89cf9b3..5a3feb8 100644 (file)
@@ -2,7 +2,7 @@
 # files marked standard are always included.
 #
 # $FreeBSD: src/sys/conf/files.i386,v 1.307.2.38 2003/01/02 20:41:33 kan Exp $
-# $DragonFly: src/sys/conf/Attic/files.amd64,v 1.5 2005/03/28 14:42:44 joerg Exp $
+# $DragonFly: src/sys/conf/Attic/files.amd64,v 1.6 2005/05/07 17:38:33 swildner Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -200,12 +200,6 @@ i386/isa/npx.c                             mandatory       npx
 bus/iicbus/i386/pcf.c                  optional        pcf
 bus/pci/i386/pci_cfgreg.c              optional        pci
 bus/pci/i386/pcibus.c                  optional        pci
-dev/video/pcvt/i386/pcvt_drv.c         optional        vt
-dev/video/pcvt/i386/pcvt_ext.c         optional        vt
-dev/video/pcvt/i386/pcvt_kbd.c         optional        vt
-dev/video/pcvt/i386/pcvt_out.c         optional        vt
-dev/video/pcvt/i386/pcvt_sup.c         optional        vt
-dev/video/pcvt/i386/pcvt_vtf.c         optional        vt
 i386/isa/pmtimer.c                     optional        acpica  
 # XXX drhodus
 i386/isa/prof_machdep.c                        optional        profiling-routine
index 0193e07..c65280b 100644 (file)
@@ -2,7 +2,7 @@
 # files marked standard are always included.
 #
 # $FreeBSD: src/sys/conf/files.i386,v 1.307.2.38 2003/01/02 20:41:33 kan Exp $
-# $DragonFly: src/sys/conf/Attic/files.i386,v 1.29 2005/03/28 14:42:44 joerg Exp $
+# $DragonFly: src/sys/conf/Attic/files.i386,v 1.30 2005/05/07 17:38:33 swildner Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -250,12 +250,6 @@ i386/isa/npx.c                             mandatory       npx
 bus/iicbus/i386/pcf.c                  optional        pcf
 bus/pci/i386/pci_cfgreg.c              optional        pci
 bus/pci/i386/pcibus.c                  optional        pci
-dev/video/pcvt/i386/pcvt_drv.c         optional        vt
-dev/video/pcvt/i386/pcvt_ext.c         optional        vt
-dev/video/pcvt/i386/pcvt_kbd.c         optional        vt
-dev/video/pcvt/i386/pcvt_out.c         optional        vt
-dev/video/pcvt/i386/pcvt_sup.c         optional        vt
-dev/video/pcvt/i386/pcvt_vtf.c         optional        vt
 i386/isa/pmtimer.c                     optional        acpica pmtimer
 # XXX drhodus
 i386/isa/prof_machdep.c                        optional        profiling-routine
index 41d5328..c212d3b 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/sys/conf/options.i386,v 1.132.2.18 2003/03/14 21:22:35 jhb Exp $
-# $DragonFly: src/sys/conf/Attic/options.amd64,v 1.4 2005/03/28 14:42:44 joerg Exp $
+# $DragonFly: src/sys/conf/Attic/options.amd64,v 1.5 2005/05/07 17:38:33 swildner Exp $
 
 DISABLE_PSE
 IDE_DELAY
@@ -121,21 +121,6 @@ EISA_SLOTS         opt_eisa.h
 
 FE_8BIT_SUPPORT                opt_fe.h
 
-# pcvt(4) has a bunch of options
-FAT_CURSOR             opt_pcvt.h
-XSERVER                        opt_pcvt.h
-PCVT_24LINESDEF                opt_pcvt.h
-PCVT_CTRL_ALT_DEL      opt_pcvt.h
-PCVT_EMU_MOUSE         opt_pcvt.h
-PCVT_FREEBSD           opt_pcvt.h
-PCVT_META_ESC          opt_pcvt.h
-PCVT_NSCREENS          opt_pcvt.h
-PCVT_PRETTYSCRNS       opt_pcvt.h
-PCVT_SCANSET           opt_pcvt.h
-PCVT_SCREENSAVER       opt_pcvt.h
-PCVT_USEKBDSEC         opt_pcvt.h
-PCVT_VT220KEYB         opt_pcvt.h
-
 # Video spigot
 SPIGOT_UNSECURE                opt_spigot.h
 
index a6fd355..9dab005 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/sys/conf/options.i386,v 1.132.2.18 2003/03/14 21:22:35 jhb Exp $
-# $DragonFly: src/sys/conf/Attic/options.i386,v 1.11 2005/04/04 17:49:09 joerg Exp $
+# $DragonFly: src/sys/conf/Attic/options.i386,v 1.12 2005/05/07 17:38:33 swildner Exp $
 
 DISABLE_PSE
 IDE_DELAY
@@ -125,21 +125,6 @@ EISA_SLOTS         opt_eisa.h
 
 FE_8BIT_SUPPORT                opt_fe.h
 
-# pcvt(4) has a bunch of options
-FAT_CURSOR             opt_pcvt.h
-XSERVER                        opt_pcvt.h
-PCVT_24LINESDEF                opt_pcvt.h
-PCVT_CTRL_ALT_DEL      opt_pcvt.h
-PCVT_EMU_MOUSE         opt_pcvt.h
-PCVT_FREEBSD           opt_pcvt.h
-PCVT_META_ESC          opt_pcvt.h
-PCVT_NSCREENS          opt_pcvt.h
-PCVT_PRETTYSCRNS       opt_pcvt.h
-PCVT_SCANSET           opt_pcvt.h
-PCVT_SCREENSAVER       opt_pcvt.h
-PCVT_USEKBDSEC         opt_pcvt.h
-PCVT_VT220KEYB         opt_pcvt.h
-
 # Video spigot
 SPIGOT_UNSECURE                opt_spigot.h
 
index 66c5773..70b9043 100644 (file)
@@ -4,7 +4,7 @@
 # Check the LINT configuration file in sys/i386/conf, for an
 # exhaustive list of options.
 #
-# $DragonFly: src/sys/config/GENERIC,v 1.22 2005/01/12 20:20:21 swildner Exp $
+# $DragonFly: src/sys/config/GENERIC,v 1.23 2005/05/07 17:38:34 swildner Exp $
 
 machine                i386
 cpu            I386_CPU
@@ -146,13 +146,6 @@ pseudo-device      splash
 device         sc0     at isa? flags 0x100
 options        SC_PIXEL_MODE           # add support for the raster text mode
 
-# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
-#device                vt0     at isa?
-#options       XSERVER                 # support for X server on a vt console
-#options       FAT_CURSOR              # start with block cursor
-# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
-#options       PCVT_SCANSET=2          # IBM keyboards are non-std
-
 device         agp             # support several AGP chipsets
 
 # Floating point support - do not disable.
index ebe80cf..e682635 100644 (file)
@@ -3,7 +3,7 @@
 #      as much of the source tree as it can.
 #
 # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $
-# $DragonFly: src/sys/config/LINT,v 1.51 2005/04/02 20:00:40 joerg Exp $
+# $DragonFly: src/sys/config/LINT,v 1.52 2005/05/07 17:38:34 swildner Exp $
 #
 # NB: You probably don't want to try running a kernel built from this
 # file.  Instead, you should start from GENERIC, and add options from
@@ -1139,24 +1139,6 @@ options  VESA
 # Splash screen at start up!  Screen savers require this too.
 pseudo-device  splash
 
-# The pcvt console driver (vt220 compatible).
-device         vt0     at isa?
-options        XSERVER                 # support for running an X server on vt
-options        FAT_CURSOR              # start with block cursor
-# This PCVT option is for keyboards such as those used on IBM ThinkPad laptops
-options        PCVT_SCANSET=2          # IBM keyboards are non-std
-# Other PCVT options are documented in pcvt(4).
-options        PCVT_24LINESDEF
-options        PCVT_CTRL_ALT_DEL
-options        PCVT_EMU_MOUSE
-options        PCVT_FREEBSD=211
-options        PCVT_META_ESC
-options        PCVT_NSCREENS=9
-options        PCVT_PRETTYSCRNS
-options        PCVT_SCREENSAVER
-options        PCVT_USEKBDSEC
-options        PCVT_VT220KEYB
-
 # The syscons console driver (sco color console compatible).
 device         sc0     at isa?
 options        MAXCONS=16              # number of virtual consoles
index 1f98ddf..d865973 100644 (file)
@@ -10,7 +10,7 @@
 #
 # Tinderbox maintained by:     Hiten Pandya (hmp@leaf.dragonflybsd.org)
 #
-# $DragonFly: src/sys/config/Attic/TINDERBOX,v 1.15 2004/11/12 02:25:51 drhodus Exp $
+# $DragonFly: src/sys/config/Attic/TINDERBOX,v 1.16 2005/05/07 17:38:34 swildner Exp $
 
 machine                i386
 cpu            I686_CPU
@@ -148,13 +148,6 @@ pseudo-device      splash
 # syscons is the default console driver, resembling an SCO console
 device         sc0     at isa? flags 0x100
 
-# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
-#device                vt0     at isa?
-#options       XSERVER                 # support for X server on a vt console
-#options       FAT_CURSOR              # start with block cursor
-# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
-#options       PCVT_SCANSET=2          # IBM keyboards are non-std
-
 device         agp             # support several AGP chipsets
 
 # Floating point support - do not disable.
index 79728fb..cdd7e01 100644 (file)
@@ -24,7 +24,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/kbd/atkbd.c,v 1.25.2.4 2002/04/08 19:21:38 asmodai Exp $
- * $DragonFly: src/sys/dev/misc/kbd/atkbd.c,v 1.7 2005/04/30 23:04:21 swildner Exp $
+ * $DragonFly: src/sys/dev/misc/kbd/atkbd.c,v 1.8 2005/05/07 17:38:33 swildner Exp $
  */
 
 #include "opt_kbd.h"
@@ -175,9 +175,6 @@ atkbd_timeout(void *arg)
 
 typedef struct atkbd_state {
        KBDC            kbdc;           /* keyboard controller */
-                                       /* XXX: don't move this field; pcvt
-                                        * expects `kbdc' to be the first
-                                        * field in this structure. */
        int             ks_mode;        /* input mode (K_XLATE,K_RAW,K_CODE) */
        int             ks_flags;       /* flags */
 #define COMPOSE                (1 << 0)
diff --git a/sys/dev/video/pcvt/i386/pcvt_conf.h b/sys/dev/video/pcvt/i386/pcvt_conf.h
deleted file mode 100644 (file)
index 8e1a449..0000000
+++ /dev/null
@@ -1,476 +0,0 @@
-/*
- * Copyright (c) 1999 Hellmuth Michaelis
- *
- * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
- *
- * Copyright (c) 1992, 1994 Brian Dunford-Shore.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by
- *     Hellmuth Michaelis, Brian Dunford-Shore and Joerg Wunsch.
- * 4. The name authors may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*---------------------------------------------------------------------------
- *
- *     pcvt_conf.h     VT220 driver global configuration file
- *     ------------------------------------------------------
- *
- *     Last Edit-Date: [Mon Dec 27 14:09:58 1999]
- *
- * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_conf.h,v 1.9 1999/12/30 16:17:08 hm Exp $
- * $DragonFly: src/sys/dev/video/pcvt/i386/Attic/pcvt_conf.h,v 1.2 2003/06/17 04:28:38 dillon Exp $
- *
- *---------------------------------------------------------------------------*/
-
-/*---------------------------------------------------------------------------
- *
- * from: Onno van der Linden    c/o   frank@fwi.uva.nl
- *
- * Here's an idea how to automatically detect the version of NetBSD pcvt is
- * being compiled on:
- *
- * NetBSD 0.8 : NetBSD0_8 defined in <sys/param.h>
- * NetBSD 0.9 : NetBSD0_9 defined in <sys/param.h>
- * NetBSD 1.0 : NetBSD1_0 defined as 1 in <sys/param.h>
- * NetBSD 1.0A: NetBSD1_0 defined as 2 in <sys/param.h>
- *
- * The NetBSDx_y defines are mutual exclusive.
- *
- * This leads to something like this in pcvt_hdr.h (#elif is possible too):
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef NetBSD0_8
-#define PCVT_NETBSD 8
-#endif
-
-#ifdef NetBSD0_9
-#define PCVT_NETBSD 9
-#endif
-
-#ifdef NetBSD1_0
-#if NetBSD1_0 > 1
-#define PCVT_NETBSD 199
-#else
-#define PCVT_NETBSD 100
-#endif
-#endif
-
-/*---------------------------------------------------------------------------
- * Note that each of the options below should rather be overriden by the
- * kernel config file instead of this .h file - this allows for different
- * definitions in different kernels compiled at the same machine
- *
- * The convention is as follows:
- *
- *     options "PCVT_FOO=1"  - enables the option
- *     options "PCVT_FOO"    - is a synonym for the above
- *     options "PCVT_FOO=0"  - disables the option
- *
- * omitting an option defaults to what is shown below
- *
- * exceptions from this rule are i.e.:
- *
- *     options "PCVT_NSCREENS=x"
- *     options "PCVT_SCANSET=x"
- *     options "PCVT_UPDATEFAST=x"
- *     options "PCVT_UPDATESLOW=x"
- *     options "PCVT_SYSBEEPF=x"
- *
- * which are always numeric!
- *---------------------------------------------------------------------------*/
-
-/* -------------------------------------------------------------------- */
-/* -------------------- OPERATING SYSTEM ------------------------------ */
-/* -------------------------------------------------------------------- */
-
-/*
- *  one of the following options must be set in the kernel config file:
- *
- *======================================================================*
- *                     N e t B S D                                     *
- *======================================================================*
- *
- *     options "PCVT_NETBSD=xxx" enables support for NetBSD
- *
- *     select:
- *             PCVT_NETBSD =   9       for NetBSD 0.9
- *             PCVT_NETBSD =  99       for PRE-1.0 NetBSD-current
- *             PCVT_NETBSD = 100       for NetBSD 1.0
- *             PCVT_NETBSD = 199       for PRE-2.0 NetBSD-current
- *
- *
- *======================================================================*
- *                     F r e e B S D                                   *
- *======================================================================*
- *
- *     options "PCVT_FREEBSD=xxx" enables support for FreeBSD
- *
- *     select:
- *             PCVT_FREEBSD = 102      for 1.0 release (actually 1.0.2)
- *             PCVT_FREEBSD = 110      for FreeBSD 1.1-Release
- *             PCVT_FREEBSD = 115      for FreeBSD 1.1.5.1-Release
- *             PCVT_FREEBSD = 200      for FreeBSD 2.0-Release
- *             PCVT_FREEBSD = 210      for FreeBSD 2.1-Release
- *
- */
-
-/* -------------------------------------------------------------------- */
-/* ---------------- USER PREFERENCE DRIVER OPTIONS -------------------- */
-/* -------------------------------------------------------------------- */
-
-/*----------------------------------------------------------------------*/
-/* NOTE: if FAT_CURSOR is defined, a block cursor is used instead of   */
-/*       the cursor shape we got from the BIOS, see pcvt_out.c         */
-/*----------------------------------------------------------------------*/
-
-#if !defined PCVT_NSCREENS     /* ---------- DEFAULT: 8 -------------- */
-# define PCVT_NSCREENS 8       /* this option defines how many virtual */
-#endif                         /* screens you want to have in your     */
-                               /* system. each screen allocates memory,*/
-                               /* so you can't have an unlimited num-  */
-                               /* ber...; the value is intented to be  */
-                               /* compile-time overridable by a config */
-                               /* options "PCVT_NSCREENS=x" line       */
-
-#if !defined PCVT_VT220KEYB    /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_VT220KEYB 0      /* this compiles a more vt220-like      */
-#elif PCVT_VT220KEYB != 0      /* keyboardlayout as described in the   */
-# undef PCVT_VT220KEYB         /* file Keyboard.VT220.                 */
-# define PCVT_VT220KEYB 1      /* if undefined, a more HP-like         */
-#endif                         /* keyboardlayout is compiled           */
-                               /* try to find out what YOU like !      */
-
-#if !defined PCVT_SCREENSAVER  /* ---------- DEFAULT: ON ------------- */
-# define PCVT_SCREENSAVER 1    /* enable screen saver feature - this   */
-#elif PCVT_SCREENSAVER != 0    /* just blanks the display screen.      */
-# undef PCVT_SCREENSAVER       /* see PCVT_PRETTYSCRNS below ...       */
-# define PCVT_SCREENSAVER 1
-#endif
-
-#if !defined PCVT_PRETTYSCRNS  /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_PRETTYSCRNS 0    /* for the cost of some microseconds of */
-#elif PCVT_PRETTYSCRNS != 0    /* cpu time this adds a more "pretty"   */
-# undef PCVT_PRETTYSCRNS       /* version to the screensaver, an "*"   */
-# define PCVT_PRETTYSCRNS 1    /* in random locations of the display.  */
-#endif                         /* NOTE: this should not be defined if  */
-                               /* you have an energy-saving monitor    */
-                               /* which turns off the display if its   */
-                               /* black !!!!!!                         */
-
-#if !defined PCVT_CTRL_ALT_DEL /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_CTRL_ALT_DEL 0   /* this enables the execution of a cpu  */
-#elif PCVT_CTRL_ALT_DEL != 0   /* reset by pressing the CTRL, ALT and  */
-# undef PCVT_CTRL_ALT_DEL      /* DEL keys simultanously. Because this */
-# define PCVT_CTRL_ALT_DEL 1   /* is a feature of an ancient simple    */
-#endif                         /* bootstrap loader, it does not belong */
-                               /* into modern operating systems and    */
-                               /* was commented out by default ...     */
-
-#if !defined PCVT_KBD_FIFO     /* ---------- DEFAULT: ON ------------- */
-# define PCVT_KBD_FIFO 1       /* this enables Keyboad fifo so that we */
-#elif PCVT_KBD_FIFO != 0       /* are not any longer forced to switch  */
-# undef PCVT_KBD_FIFO          /* off tty interrupts while switching   */
-# define PCVT_KBD_FIFO 1       /* virtual screens - AND loosing chars  */
-#endif                         /* on the serial lines is gone :-)      */
-
-#if PCVT_KBD_FIFO
-
-# if !defined PCVT_KBD_FIFO_SZ /* ---------- DEFAULT: 256 ------------ */
-#  define PCVT_KBD_FIFO_SZ 256 /* this specifies the size of the above */
-# elif PCVT_KBD_FIFO_SZ < 16   /* mentioned keyboard buffer. buffer    */
-#  undef PCVT_KBD_FIFO_SZ      /* overflows are logged via syslog, so  */
-#  define PCVT_KBD_FIFO_SZ 256 /* have a look at /var/log/messages     */
-# endif
-
-#endif /* PCVT_KBD_FIFO */
-
-#if !defined PCVT_USEKBDSEC    /* ---------- DEFAULT: ON ------------- */
-# define PCVT_USEKBDSEC 1      /* do not set the COMMAND_INHOVR bit    */
-#elif PCVT_USEKBDSEC != 0      /* (1 = override security lock inhibit) */
-# undef PCVT_USEKBDSEC         /* when initializing the keyboard, so   */
-# define PCVT_USEKBDSEC 1      /* that security locking should work    */
-#endif                         /* now. I guess this has to be done also*/
-                               /* in the boot code to prevent single   */
-                               /* user startup ....                    */
-
-#if !defined PCVT_24LINESDEF   /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_24LINESDEF 0     /* use 24 lines in VT 25 lines mode and */
-#elif PCVT_24LINESDEF != 0     /* HP 28 lines mode by default to have  */
-# undef PCVT_24LINESDEF                /* the the better compatibility to the  */
-# define PCVT_24LINESDEF 1     /* real VT220 - you can switch between  */
-#endif                         /* the maximum possible screensizes in  */
-                               /* those two modes (25 lines) and true  */
-                               /* compatibility (24 lines) by using    */
-                               /* the scon utility at runtime          */
-
-#if !defined PCVT_EMU_MOUSE    /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_EMU_MOUSE 0      /* emulate a mouse systems mouse via    */
-#elif PCVT_EMU_MOUSE != 0      /* the keypad; this is experimental     */
-# undef PCVT_EMU_MOUSE         /* code intented to be used on note-    */
-# define PCVT_EMU_MOUSE 1      /* books in conjunction with XFree86;   */
-#endif                         /* look at the comments in pcvt_kbd.c   */
-                               /* if you are interested in testing it. */
-
-#if !defined PCVT_META_ESC      /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_META_ESC 0        /* if ON, send the sequence "ESC key"  */
-#elif PCVT_META_ESC != 0        /* for a meta-shifted key; if OFF,     */
-# undef PCVT_META_ESC           /* send the normal key code with 0x80  */
-# define PCVT_META_ESC 1        /* added.                              */
-#endif
-
-#if !defined PCVT_SW0CNOUTP     /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_SW0CNOUTP 0       /* if ON, on console/kernel output the  */
-#elif PCVT_SW0CNOUTP != 0       /* current screen is switched to screen */
-# undef PCVT_SW0CNOUTP          /* 0 if not already at screen 0.        */
-# define PCVT_SW0CNOUTP 1      /* CAUTION: CURRENTLY THIS CAUSES AN X- */
-#endif                         /* SESSION TO CLUTTER VIDEO MEMORY !!!! */
-
-/* -------------------------------------------------------------------- */
-/* -------------------- DRIVER DEBUGGING ------------------------------ */
-/* -------------------------------------------------------------------- */
-
-#if !defined PCVT_SHOWKEYS     /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_SHOWKEYS 0       /* this replaces the system load line   */
-#elif PCVT_SHOWKEYS != 0       /* on the vt 0 in hp mode with a display*/
-# undef PCVT_SHOWKEYS          /* of the most recent keyboard scan-    */
-# define PCVT_SHOWKEYS 1       /* and status codes received from the   */
-#endif                         /* keyboard controller chip.            */
-                               /* this is just for some hardcore       */
-                               /* keyboarders ....                     */
-
-/* -------------------------------------------------------------------- */
-/* -------------------- DRIVER OPTIONS -------------------------------- */
-/* -------------------------------------------------------------------- */
-/*     it is unlikely that anybody wants to change anything below       */
-
-#if !defined PCVT_NO_LED_UPDATE        /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_NO_LED_UPDATE 0  /* On some (Notebook?) keyboards it is  */
-#elif PCVT_NO_LED_UPDATE != 0  /* not possible to update the LED's     */
-# undef PCVT_NO_LED_UPDATE     /* without hanging the keyboard after-  */
-# define PCVT_NO_LED_UPDATE 1  /* wards. If you experience Problems    */
-#endif                         /* like this, try to enable this option */
-
-#if !defined PCVT_PORTIO_DELAY  /* ---------- DEFAULT: ON ------------- */
-# define PCVT_PORTIO_DELAY 1   /* Defining PCVT_PORTIO_DELAY lets pcvt */
-#elif PCVT_PORTIO_DELAY != 0   /* use multiple accesses to port 0x84   */
-# undef PCVT_PORTIO_DELAY      /* to produce a delay of 7 us needed for*/
-# define PCVT_PORTIO_DELAY 1   /* accessing the keyboard controller,   */
-#endif                         /* otherwise the system delay functions */
-                               /* are used.                            */
-
-#if !defined PCVT_PCBURST      /* ---------- DEFAULT: 256 ------------ */
-# define PCVT_PCBURST 256      /* NETBSD and FreeBSD >= 2.0 only: this */
-#endif                         /* is the number of output characters   */
-                               /* handled together as a burst in       */
-                               /* routine pcstart(), file pcvt_drv.c   */
-
-#if !defined PCVT_SCANSET      /* ---------- DEFAULT: 1 -------------- */
-# define PCVT_SCANSET 1                /* define the keyboard scancode set you */
-#endif                         /* want to use:                         */
-                               /* 1 - code set 1       (supported)     */
-                               /* 2 - code set 2       (supported)     */
-                               /* 3 - code set 3       (UNsupported)   */
-
-#if !defined PCVT_KEYBDID      /* ---------- DEFAULT: ON ------------- */
-# define PCVT_KEYBDID 1                /* check type of keyboard connected. at */
-#elif PCVT_KEYBDID != 0                /* least HP-keyboards send an id other  */
-# undef PCVT_KEYBDID           /* than the industry standard, so it    */
-# define PCVT_KEYBDID 1                /* CAN lead to problems. if you have    */
-#endif                         /* problems with this, TELL ME PLEASE ! */
-
-#if !defined PCVT_SIGWINCH     /* ---------- DEFAULT: ON ------------- */
-# define PCVT_SIGWINCH 1       /* this sends a SIGWINCH signal in case */
-#elif PCVT_SIGWINCH != 0       /* the window size is changed. to try,  */
-# undef PCVT_SIGWINCH          /* issue "scons -s<size>" while in elvis*/
-# define PCVT_SIGWINCH 1       /* and you'll see the effect.           */
-#endif                         /* i'm not sure, whether this feature   */
-                               /* has to be in the driver or has to    */
-                               /* move as an ioctl call to scon ....   */
-
-#if !defined PCVT_NULLCHARS    /* ---------- DEFAULT: ON ------------- */
-# define PCVT_NULLCHARS 1      /* allow the keyboard to send null      */
-#elif PCVT_NULLCHARS != 0      /* (0x00) characters to the calling     */
-# undef PCVT_NULLCHARS         /* program. this has the side effect    */
-# define PCVT_NULLCHARS 1      /* that every undefined key also sends  */
-#endif                         /* out nulls. take it as experimental   */
-                               /* code, this behaviour will change in  */
-                               /* a future release                     */
-
-#if !defined PCVT_BACKUP_FONTS /* ---------- DEFAULT: ON ------------- */
-# define PCVT_BACKUP_FONTS 1   /* fonts are always kept memory-backed; */
-#elif  PCVT_BACKUP_FONTS != 0  /* otherwise copies are only made if    */
-# undef PCVT_BACKUP_FONTS      /* they are needed.                     */
-# define PCVT_BACKUP_FONTS 1
-#endif
-
-#ifndef PCVT_UPDATEFAST                /* this is the rate at which the cursor */
-# define PCVT_UPDATEFAST (hz/10) /* gets updated with its new position */
-#endif                         /* see: async_update() in pcvt_sup.c    */
-
-#ifndef PCVT_UPDATESLOW                /* this is the rate at which the cursor */
-# define PCVT_UPDATESLOW 3     /* position display and the system load */
-#endif                         /* (or the keyboard scancode display)   */
-                               /* is updated. the relation is:         */
-                               /* PCVT_UPDATEFAST/PCVT_UPDATESLOW      */
-
-#ifndef PCVT_SYSBEEPF          /* timer chip value to be used for the  */
-# define PCVT_SYSBEEPF 1193182 /* sysbeep frequency value.             */
-#endif                         /* this should really go somewhere else,*/
-                               /* e.g. in isa.h; but it used to be in  */
-                               /* each driver, sometimes even with     */
-                               /* different values (:-)                */
-
-#if !defined PCVT_SETCOLOR     /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_SETCOLOR 0       /* enable making colors settable. this  */
-#elif PCVT_SETCOLOR != 0       /* introduces a new escape sequence     */
-# undef PCVT_SETCOLOR          /* <ESC d> which is (i think) not       */
-# define PCVT_SETCOLOR 1       /* standardized, so this is an option   */
-#endif                         /* (Birthday present for Bruce ! :-)    */
-
-#if !defined PCVT_132GENERIC   /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_132GENERIC 0     /* if you #define this, you enable      */
-#elif PCVT_132GENERIC != 0     /*      EXPERIMENTAL (!!!!!!!!!!!!)     */
-# undef PCVT_132GENERIC                /*      USE-AT-YOUR-OWN-RISK,           */
-# define PCVT_132GENERIC 1     /*      MAY-DAMAGE-YOUR-MONITOR         */
-#endif                         /* code to switch generic VGA boards/   */
-                               /* chipsets to 132 column mode. Since   */
-                               /* i could not verify this option, i    */
-                               /* prefer to NOT generally enable this, */
-                               /* if you want to play, look at the     */
-                               /* hints and the code in pcvt_sup.c and */
-                               /* get in contact with Joerg Wunsch, who*/
-                               /* submitted this code. Be careful !!!  */
-
-#if !defined PCVT_PALFLICKER   /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_PALFLICKER 0     /* this option turns off the screen     */
-#elif PCVT_PALFLICKER != 0     /* during accesses to the VGA DAC       */
-# undef PCVT_PALFLICKER                /* registers. why: on one fo the tested */
-# define PCVT_PALFLICKER 1     /* pc's (WD-chipset), accesses to the   */
-#endif                         /* vga dac registers caused distortions */
-                               /* on the screen. Ferraro says, one has */
-                               /* to blank the screen. the method used */
-                               /* to accomplish this stopped the noise */
-                               /* but introduced another flicker, so   */
-                               /* this is for you to experiment .....  */
-                               /* - see also PCVT_WAITRETRACE below -- */
-
-#if !defined PCVT_WAITRETRACE  /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_WAITRETRACE 0    /* this option waits for being in a     */
-#elif PCVT_WAITRETRACE != 0    /* retrace window prior to accessing    */
-# undef PCVT_WAITRETRACE       /* the VGA DAC registers.               */
-# define PCVT_WAITRETRACE 1    /* this is the other method Ferraro     */
-#endif                         /* mentioned in his book. this option   */
-                               /* did eleminate the flicker noticably  */
-                               /* but not completely. besides that, it */
-                               /* is implemented as a busy-wait loop   */
-                               /* which is a no-no-no in environments  */
-                               /* like this - VERY BAD PRACTICE !!!!!  */
-                               /* the other method implementing it is  */
-                               /* using the vertical retrace irq, but  */
-                               /* we get short of irq-lines on pc's.   */
-                               /* this is for you to experiment .....  */
-                               /* -- see also PCVT_PALFLICKER above -- */
-
-#if !defined PCVT_INHIBIT_NUMLOCK /* --------- DEFAULT: OFF ----------- */
-# define PCVT_INHIBIT_NUMLOCK 0 /* A notebook hack: since i am getting */
-#elif PCVT_INHIBIT_NUMLOCK != 0        /* tired of the numlock LED always      */
-# undef PCVT_INHIBIT_NUMLOCK    /* being turned on - which causes the  */
-# define PCVT_INHIBIT_NUMLOCK 1 /* right half of my keyboard being     */
-#endif                                 /* interpreted as a numeric keypad and  */
-                               /* thus going unusable - i want to      */
-                               /* have a better control over it. If    */
-                               /* this option is enabled, only the     */
-                               /* numlock key itself and the related   */
-                               /* ioctls will modify the numlock       */
-                               /* LED. (The ioctl is needed for the    */
-                               /* ServerNumLock feature of XFree86.)   */
-                               /* The default state is changed to      */
-                               /* numlock off, and the escape          */
-                               /* sequences to switch between numeric  */
-                               /* and application mode keypad are      */
-                               /* silently ignored.                    */
-
-#if !defined PCVT_NOFASTSCROLL /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_NOFASTSCROLL 0   /* If off, enables code for fast scroll.*/
-#elif PCVT_NOFASTSCROLL != 0   /* This is done by changing the CRTC    */
-# undef PCVT_NOFASTSCROLL      /* screen start address for scrolling   */
-# define PCVT_NOFASTSCROLL 1   /* and using 2 times the screen size as */
-#endif                         /* buffer. The fastscroll code works    */
-                               /* ONLY for VGA/EGA/CGA because it uses */
-                               /* the crtc for hardware scrolling and  */
-                               /* therefore needs more than the one    */
-                               /* page video memory MDA and most       */
-                               /* Hercules boards support.             */
-                               /* If you run pcvt ONLY on MDA/Hercules */
-                               /* you should disable fastscroll to save*/
-                               /* the time to decide which board you   */
-                               /* are running pcvt on at runtime.      */
-                               /*     [see roll_up() and roll_down().] */
-
-#if !defined PCVT_SLOW_INTERRUPT/* ---------- DEFAULT: OFF ------------ */
-# define PCVT_SLOW_INTERRUPT 0 /* If off, protecting critical regions  */
-#elif PCVT_SLOW_INTERRUPT != 0 /* in the keyboard fifo code is done by */
-# undef PCVT_SLOW_INTERRUPT    /* disabling the processor irq's, if on */
-# define PCVT_SLOW_INTERRUPT 1 /* this is done by spl()/splx() calls.  */
-#endif
-
-#ifdef XSERVER
-
-#if !defined PCVT_USL_VT_COMPAT        /* ---------- DEFAULT: ON ------------- */
-# define PCVT_USL_VT_COMPAT 1  /* this option enables multiple virtual */
-#elif PCVT_USL_VT_COMPAT != 0  /* screen support for XFree86. If set   */
-# undef PCVT_USL_VT_COMPAT     /* to off, support for a "classic"      */
-# define PCVT_USL_VT_COMPAT 1  /* single screen only X server is       */
-#endif                         /* compiled in. If enabled, most of the */
-                               /* ioctl's from SYSV/USL are supported  */
-                               /* to run multiple X servers and/or     */
-                               /* character terminal sessions.         */
-
-#endif /* XSERVER */
-
-/*---------------------------------------------------------------------------*
- *     Kernel messages attribute definitions
- *     These define the foreground and background attributes used to
- *     emphasize messages from the kernel on color and mono displays.
- *---------------------------------------------------------------------------*/
-
-#if !defined COLOR_KERNEL_FG           /* color displays               */
-#define COLOR_KERNEL_FG        FG_LIGHTGREY    /* kernel messages, foreground  */
-#endif
-#if !defined COLOR_KERNEL_BG
-#define COLOR_KERNEL_BG        BG_RED          /* kernel messages, background  */
-#endif
-
-#if !defined MONO_KERNEL_FG            /* monochrome displays          */
-#define MONO_KERNEL_FG FG_UNDERLINE    /* kernel messages, foreground  */
-#endif
-#if !defined MONO_KERNEL_BG
-#define MONO_KERNEL_BG BG_BLACK        /* kernel messages, background  */
-#endif
-
-/*---------------------------------- E O F ----------------------------------*/
diff --git a/sys/dev/video/pcvt/i386/pcvt_drv.c b/sys/dev/video/pcvt/i386/pcvt_drv.c
deleted file mode 100644 (file)
index 86c5426..0000000
+++ /dev/null
@@ -1,1667 +0,0 @@
-/*
- * Copyright (c) 1999 Hellmuth Michaelis
- *
- * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
- *
- * Copyright (c) 1992, 1993 Brian Dunford-Shore and Scott Turner.
- *
- * Copyright (c) 1993 Charles Hannum.
- *
- * All rights reserved.
- *
- * Parts of this code regarding the NetBSD interface were written
- * by Charles Hannum.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz and Don Ahn.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by
- *     Hellmuth Michaelis, Brian Dunford-Shore, Joerg Wunsch, Scott Turner
- *     and Charles Hannum.
- * 4. The name authors may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*---------------------------------------------------------------------------*
- *
- *     pcvt_drv.c      VT220 Driver Main Module / OS - Interface
- *     ---------------------------------------------------------
- *
- *     Last Edit-Date: [Mon Dec 27 14:03:36 1999]
- *
- * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_drv.c,v 1.63.2.1 2001/02/26 04:23:13 jlemon Exp $
- * $DragonFly: src/sys/dev/video/pcvt/i386/Attic/pcvt_drv.c,v 1.12 2004/09/19 02:43:26 dillon Exp $
- *
- *---------------------------------------------------------------------------*/
-
-#include "use_vt.h"
-#if NVT > 0
-
-#define EXTERN                 /* allocate mem */
-
-#include "pcvt_hdr.h"  /* global include */
-
-#if PCVT_FREEBSD >= 200
-#include <sys/bus.h>
-#include <machine/stdarg.h>
-#else
-#include "machine/stdarg.h"
-#endif
-
-extern int getchar (void);
-
-#if PCVT_NETBSD
-       extern u_short *Crtat;
-#endif /* PCVT_NETBSD */
-
-static void vgapelinit(void);  /* read initial VGA DAC palette */
-
-#if defined XSERVER && !PCVT_USL_VT_COMPAT
-static int pcvt_xmode_set(int on, struct thread *td); /* initialize for X mode */
-#endif /* XSERVER && !PCVT_USL_VT_COMPAT */
-
-#ifdef _DEV_KBD_KBDREG_H_
-static void pcvt_reset_detect_timeout(int unit, int hz);
-static void detect_kbd(void *arg);
-static kbd_callback_func_t pcevent;
-#endif
-
-static cn_probe_t      pccnprobe;
-static cn_init_t       pccninit;
-static cn_term_t       pccnterm;
-static cn_getc_t       pccngetc;
-static cn_checkc_t     pccncheckc;
-static cn_putc_t       pccnputc;
-
-CONS_DRIVER(pc, pccnprobe, pccninit, pccnterm, pccngetc, pccncheckc, pccnputc,
-           NULL);
-
-static d_open_t        pcopen;
-static d_close_t       pcclose;
-static d_ioctl_t       pcioctl;
-static d_mmap_t        pcmmap;
-
-#define        CDEV_MAJOR      12
-struct cdevsw pc_cdevsw = {
-       /* name */      "vt",
-       /* maj */       CDEV_MAJOR,
-       /* flags */     D_TTY | D_KQFILTER,
-       /* port */      NULL,
-       /* clone */     NULL,
-
-       /* open */      pcopen,
-       /* close */     pcclose,
-       /* read */      ttyread,
-       /* write */     ttywrite,
-       /* ioctl */     pcioctl,
-       /* poll */      ttypoll,
-       /* mmap */      pcmmap,
-       /* strategy */  nostrategy,
-       /* dump */      nodump,
-       /* psize */     nopsize,
-       /* kqfilter */  ttykqfilter
-};
-
-static struct callout  pcvt_timeout_ch;
-
-#if PCVT_NETBSD > 100  /* NetBSD-current Feb 20 1995 */
-int
-pcprobe(struct device *parent, void *match, void *aux)
-#else
-#if PCVT_NETBSD > 9
-int
-pcprobe(struct device *parent, struct device *self, void *aux)
-#else
-int
-pcprobe(struct isa_device *dev)
-#endif /* PCVT_NETBSD > 9 */
-#endif /* PCVT_NETBSD > 100 */
-{
-#ifdef _DEV_KBD_KBDREG_H_
-       int i;
-
-       if (kbd == NULL) {
-               reset_keyboard = 0;
-               kbd_configure(KB_CONF_PROBE_ONLY);
-               i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)dev->id_unit);
-               if ((i < 0) || ((kbd = kbd_get_keyboard(i)) == NULL))
-                       return (-1);
-       }
-       reset_keyboard = 1;             /* it's now safe to do kbd reset */
-#endif /* _DEV_KBD_KBDREG_H_ */
-
-       kbd_code_init();
-
-#if PCVT_NETBSD > 9
-       ((struct isa_attach_args *)aux)->ia_iosize = 16;
-       return 1;
-#else
-#ifdef _DEV_KBD_KBDREG_H_
-       return (-1);
-#elif PCVT_NETBSD || PCVT_FREEBSD
-       return (16);
-#else
-       return 1;
-#endif /* PCVT_NETBSD || PCVT_FREEBSD */
-#endif /* PCVT_NETBSD > 9 */
-
-}
-
-#if PCVT_NETBSD > 9
-void
-pcattach(struct device *parent, struct device *self, void *aux)
-{
-       struct isa_attach_args *ia = aux;
-       static struct intrhand vthand;
-#else
-int
-pcattach(struct isa_device *dev)
-{
-#endif /* PCVT_NETBSD > 9 */
-
-       int i;
-
-       if ((pcvt_timeout_ch.c_flags & CALLOUT_DID_INIT) == 0)
-               callout_init(&pcvt_timeout_ch);
-       pcvt_support_init();
-       vt_coldmalloc();                /* allocate memory for screens */
-
-#ifdef _DEV_KBD_KBDREG_H_
-       if (kbd == NULL)
-               pcvt_reset_detect_timeout(dev->id_unit, hz * 2);
-#endif /* _DEV_KBD_KBDREG_H_ */
-
-#if PCVT_NETBSD || PCVT_FREEBSD
-
-#if PCVT_NETBSD > 9
-       printf(": ");
-#else
-       printf("vt%d: ", dev->id_unit);
-#endif /* PCVT_NETBSD > 9 */
-
-       switch(adaptor_type)
-       {
-               case MDA_ADAPTOR:
-                       printf("mda");
-                       break;
-
-               case CGA_ADAPTOR:
-                       printf("cga");
-                       break;
-
-               case EGA_ADAPTOR:
-                       printf("ega");
-                       break;
-
-               case VGA_ADAPTOR:
-                       printf("%s, ", (char *)vga_string(vga_type));
-                       if(can_do_132col)
-                               printf("80/132 col");
-                       else
-                               printf("80 col");
-                       vgapelinit();
-                       break;
-
-               default:
-                       printf("unknown");
-                       break;
-       }
-
-       if(color == 0)
-               printf(", mono");
-       else
-               printf(", color");
-
-       printf(", %d scr, ", totalscreens);
-
-       switch(keyboard_type)
-       {
-               case KB_AT:
-                       printf("at-");
-                       break;
-
-               case KB_MFII:
-                       printf("mf2-");
-                       break;
-
-               default:
-                       printf("unknown ");
-                       break;
-       }
-
-       printf("kbd, [R%s]\n", PCVT_REL);
-
-#if PCVT_NETBSD || (PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
-
-       for(i = 0; i < totalscreens; i++)
-       {
-
-#if PCVT_NETBSD
-               pc_tty[i] = ttymalloc();
-               vs[i].vs_tty = pc_tty[i];
-#else /* !PCVT_NETBSD */
-               pccons[i] = ttymalloc(pccons[i]);
-               vs[i].vs_tty = pccons[i];
-#endif /* PCVT_NETBSD */
-
-       }
-
-#if PCVT_EMU_MOUSE
-#if PCVT_NETBSD
-       pc_tty[totalscreens] = ttymalloc(); /* the mouse emulator tty */
-#else /* !PCVT_NETBSD */
-       /* the mouse emulator tty */
-       pc_tty[totalscreens] = ttymalloc(pccons[totalscreens]);
-#endif /* PCVT_NETBSD */
-#endif /* PCVT_EMU_MOUSE */
-
-#if PCVT_NETBSD
-       pcconsp = pc_tty[0];
-#else  /* !PCVT_NETBSD */
-       pcconsp = pccons[0];
-#endif  /* PCVT_NETBSD */
-
-#endif /* #if PCVT_NETBSD || (PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200) */
-
-#else /* !PCVT_NETBSD && !PCVT_FREEBSD*/
-
-       switch(adaptor_type)
-       {
-               case MDA_ADAPTOR:
-                       printf(" <mda");
-                       break;
-
-               case CGA_ADAPTOR:
-                       printf(" <cga");
-                       break;
-
-               case EGA_ADAPTOR:
-                       printf(" <ega");
-                       break;
-
-               case VGA_ADAPTOR:
-                       printf(" <%s,", (char *)vga_string(vga_type));
-                       if(can_do_132col)
-                               printf("80/132 col");
-                       else
-                               printf("80 col");
-                       vgapelinit();
-                       break;
-
-               default:
-                       printf(" <unknown");
-                       break;
-       }
-
-       if(color == 0)
-               printf(",mono");
-       else
-               printf(",color");
-
-       printf(",%d scr,", totalscreens);
-
-       switch(keyboard_type)
-       {
-               case KB_AT:
-                       printf("at-");
-                       break;
-
-               case KB_MFII:
-                       printf("mf2-");
-                       break;
-
-               default:
-                       printf("unknown ");
-                       break;
-       }
-
-       printf("kbd,[R%s]>", PCVT_REL);
-
-#endif  /* PCVT_NETBSD || PCVT_FREEBSD */
-
-#if !PCVT_NETBSD && !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
-       cdevsw_add(&pc_cdevsw, 0, 0);
-       for(i = 0; i < totalscreens; i++)
-       {
-               ttyregister(&pccons[i]);
-               vs[i].vs_tty = &pccons[i];
-               make_dev(&pc_cdevsw, i, UID_ROOT, GID_WHEEL, 0600, "ttyv%r", i);
-       }
-#endif /* !PCVT_NETBSD && !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200) */
-
-       async_update(UPDATE_START);     /* start asynchronous updates */
-
-#if PCVT_NETBSD > 9
-
-       vthand.ih_fun = pcrint;
-       vthand.ih_arg = 0;
-       vthand.ih_level = IPL_TTY;
-
-#if (PCVT_NETBSD > 100) && defined(IST_EDGE)
-       intr_establish(ia->ia_irq, IST_EDGE, &vthand);
-#else /* PCVT_NETBSD > 100 */
-       intr_establish(ia->ia_irq, &vthand);
-#endif /* PCVT_NETBSD > 100 */
-
-#else /* PCVT_NETBSD > 9 */
-
-       dev->id_ointr = pcrint;
-
-       return 1;
-
-#endif /* PCVT_NETBSD > 9 */
-
-}
-
-/* had a look at the friedl driver */
-
-#if !PCVT_NETBSD
-
-struct tty *
-get_pccons(Dev_t dev)
-{
-       int i = minor(dev);
-
-#if PCVT_EMU_MOUSE
-       if(i == totalscreens)
-#if !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
-               return(&pccons[i]);
-#else
-               return(pccons[i]);
-#endif /* !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200) */
-#endif /* PCVT_EMU_MOUSE */
-
-       if(i >= PCVT_NSCREENS)
-               return(NULL);
-#if !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
-       return(&pccons[i]);
-#else
-       return(pccons[i]);
-#endif
-}
-
-#else
-
-struct tty *
-get_pccons(Dev_t dev)
-{
-       int i = minor(dev);
-
-#if PCVT_EMU_MOUSE
-       if(i == totalscreens)
-               return(pc_tty[i]);
-#endif /* PCVT_EMU_MOUSE */
-
-       if(i >= PCVT_NSCREENS)
-               return(NULL);
-       return(pc_tty[i]);
-}
-
-#endif /* !PCVT_NETBSD */
-
-/*---------------------------------------------------------------------------*
- *             /dev/ttyc0, /dev/ttyc1, etc.
- *---------------------------------------------------------------------------*/
-int
-pcopen(Dev_t dev, int flag, int mode, struct thread *td)
-{
-       struct tty *tp;
-       struct video_state *vsx;
-       int s, retval;
-       int winsz = 0;
-       int i = minor(dev);
-
-#if PCVT_EMU_MOUSE
-       if(i == totalscreens)
-               vsx = 0;
-       else
-#endif /* PCVT_EMU_MOUSE */
-
-       vsx = &vs[i];
-
-       if((tp = get_pccons(dev)) == NULL)
-               return ENXIO;
-
-       dev->si_tty = tp;
-
-#if PCVT_EMU_MOUSE
-       if(i == totalscreens)
-       {
-               if(mouse.opened == 0)
-                       mouse.buttons = mouse.extendedseen =
-                               mouse.breakseen = mouse.lastmove.tv_sec = 0;
-               mouse.minor = i;
-               mouse.opened++;
-       }
-       else
-#endif /* PCVT_EMU_MOUSE */
-
-       vsx->openf++;
-
-       tp->t_oproc = pcstart;
-       tp->t_param = pcparam;
-       tp->t_stop = nottystop;
-       tp->t_dev = dev;
-
-       if ((tp->t_state & TS_ISOPEN) == 0)
-       {
-
-#ifdef TS_WOPEN /* not (FreeBSD-1.1.5 or FreeBSD some time after 2.0.5) */
-               tp->t_state |= TS_WOPEN;
-#endif
-
-               ttychars(tp);
-               tp->t_iflag = TTYDEF_IFLAG;
-               tp->t_oflag = TTYDEF_OFLAG;
-               tp->t_cflag = TTYDEF_CFLAG;
-               tp->t_lflag = TTYDEF_LFLAG;
-               tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
-               pcparam(tp, &tp->t_termios);
-               (*linesw[tp->t_line].l_modem)(tp, 1);   /* fake connection */
-               winsz = 1;                      /* set winsize later */
-       }
-       else if (tp->t_state & TS_XCLUDE && suser(td))
-               return (EBUSY);
-
-#if PCVT_NETBSD || (PCVT_FREEBSD >= 200)
-       retval = ((*linesw[tp->t_line].l_open)(dev, tp));
-#else
-       retval = ((*linesw[tp->t_line].l_open)(dev, tp, flag));
-#endif /* PCVT_NETBSD || (PCVT_FREEBSD >= 200) */
-
-       if(winsz == 1)
-       {
-
-               /*
-                * The line discipline has clobbered t_winsize if TS_ISOPEN
-                * was clear. (NetBSD PR #400 from Bill Sommerfeld)
-                * We have to do this after calling the open routine, because
-                * it does some other things in other/older *BSD releases -hm
-                */
-
-               s = spltty();
-
-               tp->t_winsize.ws_col = vsx->maxcol;
-               tp->t_winsize.ws_row = vsx->screen_rows;
-               tp->t_winsize.ws_xpixel = (vsx->maxcol == 80)? 720: 1056;
-               tp->t_winsize.ws_ypixel = 400;
-
-               splx(s);
-       }
-
-       return(retval);
-}
-
-int
-pcclose(Dev_t dev, int flag, int mode, struct thread *td)
-{
-       struct tty *tp;
-       struct video_state *vsx;
-       int i = minor(dev);
-
-#if PCVT_EMU_MOUSE
-       if(i == totalscreens)
-               vsx = 0;
-       else
-#endif /* PCVT_EMU_MOUSE */
-
-       vsx = &vs[i];
-
-       if((tp = get_pccons(dev)) == NULL)
-               return ENXIO;
-
-       (*linesw[tp->t_line].l_close)(tp, flag);
-       ttyclose(tp);
-
-#if PCVT_EMU_MOUSE
-       if(i == totalscreens)
-               mouse.opened = 0;
-       else
-#endif /* PCVT_EMU_MOUSE */
-
-       vsx->openf = 0;
-
-#if PCVT_USL_VT_COMPAT
-#if PCVT_EMU_MOUSE
-
-       if(i == totalscreens)
-               return (0);
-
-#endif /* PCVT_EMU_MOUSE */
-
-       reset_usl_modes(vsx);
-
-#endif /* PCVT_USL_VT_COMPAT */
-
-       return(0);
-}
-
-int
-pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
-{
-       int error;
-       struct tty *tp;
-
-       if((tp = get_pccons(dev)) == NULL)
-               return(ENXIO);
-
-       /* note that some ioctl's are global, e.g.  KBSTPMAT: There is
-        * only one keyboard and different repeat rates for instance between
-        * sessions are a suspicious wish. If you really need this make the
-        * appropriate variables arrays
-        */
-
-#if PCVT_EMU_MOUSE
-       if(minor(dev) == totalscreens)
-       {
-               if((error = mouse_ioctl(dev, cmd, data)) >= 0)
-                       return error;
-               goto do_standard;
-       }
-#endif /* PCVT_EMU_MOUSE */
-
-#ifdef XSERVER
-#if PCVT_USL_VT_COMPAT
-
-       if((error = usl_vt_ioctl(dev, cmd, data, flag, td->td_proc)) >= 0)
-               return error;
-
-       /*
-        * just for compatibility:
-        * XFree86 < 2.0 and SuperProbe still might use it
-        *
-        * NB: THIS IS A HACK! Do not use it unless you explicitly need.
-        * Especially, since the vty is not put into process-controlled
-        * mode (this would require the application to co-operate), any
-        * attempts to switch vtys while this kind of X mode is active
-        * may cause serious trouble.
-        */
-       switch(cmd)
-       {
-         case CONSOLE_X_MODE_ON:
-         {
-           int i;
-
-           if((error = usl_vt_ioctl(dev, KDENABIO, 0, flag, td->td_proc)) > 0)
-             return error;
-
-           i = KD_GRAPHICS;
-           if((error = usl_vt_ioctl(dev, KDSETMODE, (caddr_t)&i, flag, td->td_proc))
-              > 0)
-             return error;
-
-           i = K_RAW;
-           error = usl_vt_ioctl(dev, KDSKBMODE, (caddr_t)&i, flag, td->td_proc);
-           return error;
-         }
-
-         case CONSOLE_X_MODE_OFF:
-         {
-           int i;
-
-           (void)usl_vt_ioctl(dev, KDDISABIO, 0, flag, td->td_proc);
-
-           i = KD_TEXT;
-           (void)usl_vt_ioctl(dev, KDSETMODE, (caddr_t)&i, flag, td->td_proc);
-
-           i = K_XLATE;
-           (void)usl_vt_ioctl(dev, KDSKBMODE, (caddr_t)&i, flag, td->td_proc);
-           return 0;
-         }
-
-
-         case CONSOLE_X_BELL:
-
-               /*
-                * If `data' is non-null, the first int value denotes
-                * the pitch, the second a duration. Otherwise, behaves
-                * like BEL.
-                */
-
-               if (data)
-               {
-
-#if PCVT_NETBSD
-                       sysbeep(((int *)data)[0],
-                               ((int *)data)[1] * hz / 1000);
-#else /* PCVT_NETBSD */
-                       sysbeep(PCVT_SYSBEEPF / ((int *)data)[0],
-                               ((int *)data)[1] * hz / 3000);
-#endif /* PCVT_NETBSD */
-
-               }
-               else
-               {
-                       sysbeep(PCVT_SYSBEEPF / 1493, hz / 4);
-               }
-               return (0);
-
-         default: /* fall through */ ;
-       }
-
-#else /* PCVT_USL_VT_COMPAT */
-
-       switch(cmd)
-       {
-         case CONSOLE_X_MODE_ON:
-               return pcvt_xmode_set(1, td->td_proc);
-
-         case CONSOLE_X_MODE_OFF:
-               return pcvt_xmode_set(0, td->td_proc);
-
-         case CONSOLE_X_BELL:
-
-               /*
-                * If `data' is non-null, the first int value denotes
-                * the pitch, the second a duration. Otherwise, behaves
-                * like BEL.
-                */
-
-               if (data)
-               {
-
-#if PCVT_NETBSD
-                       sysbeep(((int *)data)[0],
-                               ((int *)data)[1] * hz / 1000);
-#else /* PCVT_NETBSD */
-                       sysbeep(PCVT_SYSBEEPF / ((int *)data)[0],
-                               ((int *)data)[1] * hz / 3000);
-#endif /* PCVT_NETBSD */
-
-               }
-               else
-               {
-                       sysbeep(PCVT_SYSBEEPF / 1493, hz / 4);
-               }
-               return (0);
-
-         default: /* fall through */ ;
-       }
-
-#endif /* PCVT_USL_VT_COMPAT */
-#endif /* XSERVER */
-
-       if((error = kbdioctl(dev,cmd,data,flag)) >= 0)
-               return error;
-
-       if((error = vgaioctl(dev,cmd,data,flag)) >= 0)
-               return error;
-
-#if PCVT_EMU_MOUSE
-do_standard:
-#endif
-
-#if PCVT_NETBSD > 9 || PCVT_FREEBSD >= 200
-       if((error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td))
-           != ENOIOCTL)
-               return (error);
-#else
-       if((error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag)) >= 0)
-               return(error);
-#endif /* PCVT_NETBSD > 9 || PCVT_FREEBSD >= 200 */
-
-#if PCVT_NETBSD > 9
-       if((error = ttioctl(tp, cmd, data, flag, td)) >= 0)
-               return (error);
-#else
-       if((error = ttioctl(tp, cmd, data, flag)) != ENOIOCTL)
-               return (error);
-#endif /* PCVT_NETBSD > 9 */
-
-       return (ENOTTY);
-}
-
-int
-pcmmap(Dev_t dev, vm_offset_t offset, int nprot)
-{
-       if (offset > 0x20000 - PAGE_SIZE)
-               return -1;
-       return i386_btop((0xa0000 + offset));
-}
-
-/*---------------------------------------------------------------------------*
- *
- *     handle a keyboard receive interrupt
- *
- *     NOTE: the keyboard is multiplexed by means of "pcconsp"
- *     between virtual screens. pcconsp - switching is done in
- *     the vgapage() routine
- *
- *---------------------------------------------------------------------------*/
-
-#if PCVT_KBD_FIFO
-
-u_char pcvt_kbd_fifo[PCVT_KBD_FIFO_SZ];
-static int pcvt_kbd_wptr = 0;
-int pcvt_kbd_rptr = 0;
-short pcvt_kbd_count= 0;
-static u_char pcvt_timeout_scheduled = 0;
-
-static void
-pcvt_timeout(void *arg)
-{
-       u_char *cp;
-
-#if PCVT_SLOW_INTERRUPT
-       int     s;
-#endif
-
-       pcvt_timeout_scheduled = 0;
-
-#if PCVT_SCREENSAVER
-       pcvt_scrnsv_reset();
-#endif /* PCVT_SCREENSAVER */
-
-       while (pcvt_kbd_count)
-       {
-               if (((cp = sgetc(1)) != 0) &&
-                   (vs[current_video_screen].openf))
-               {
-
-#if PCVT_NULLCHARS
-                       if(*cp == '\0')
-                       {
-                               /* pass a NULL character */
-                               (*linesw[pcconsp->t_line].l_rint)('\0', pcconsp);
-                       }
-/* XXX */              else
-#endif /* PCVT_NULLCHARS */
-
-                       while (*cp)
-                               (*linesw[pcconsp->t_line].l_rint)(*cp++ & 0xff, pcconsp);
-               }
-
-               PCVT_DISABLE_INTR ();
-
-               if (!pcvt_kbd_count)
-                       pcvt_timeout_scheduled = 0;
-
-               PCVT_ENABLE_INTR ();
-       }
-
-       return;
-}
-#endif
-
-#ifdef _DEV_KBD_KBDREG_H_
-
-static 
-void
-pcvt_reset_detect_timeout(int unit, int hz)
-{
-       static struct callout **prd_callout_ary;
-       static int nprd;
-       struct callout *prd_ch;
-
-       KKASSERT(unit >= 0 && unit < 4096);
-
-       /*
-        * Expand our callout pointer array if necessary
-        */
-       if (unit >= nprd) {
-               struct callout **nary;
-               int nunits;
-               int i;
-
-               nunits = (unit + 1 + 7) & ~7;
-               nary = malloc(nunits * sizeof(struct callout *), 
-                               M_DEVBUF, M_INTWAIT|M_ZERO);
-
-               /* detect race if we blocked */
-               if (nunits > nprd) {
-                       for (i = 0; i < nprd; ++i)
-                               nary[i] = prd_callout_ary[i];
-                       prd_callout_ary = nary;
-                       nprd = nunits;
-               } else {
-                       free(nary, M_DEVBUF);
-               }
-       }
-
-       /*
-        * Malloc a callout if necessary
-        */
-       if ((prd_ch = prd_callout_ary[unit]) == NULL) {
-               prd_ch = malloc(sizeof(struct callout), M_DEVBUF, M_INTWAIT);
-               callout_init(prd_ch);
-
-               /* detect race if we blocked */
-               if (prd_callout_ary[unit] == NULL) {
-                       prd_callout_ary[unit] = prd_ch;
-               } else {
-                       free(prd_ch, M_DEVBUF);
-                       prd_ch = prd_callout_ary[unit];
-               }
-       }
-       callout_reset(prd_ch, hz, detect_kbd, (void *)unit);
-}
-
-static void
-detect_kbd(void *arg)
-{
-       int unit = (int)arg;
-       int i;
-
-       if (kbd != NULL)
-               return;
-       i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)unit);
-       if (i >= 0)
-               kbd = kbd_get_keyboard(i);
-       if (kbd != NULL)
-       {
-               reset_keyboard = 1;     /* ok to reset the keyboard */
-               kbd_code_init();
-               return;
-       }
-       reset_keyboard = 0;
-       pcvt_reset_detect_timeout(unit, hz * 2);
-}
-
-int
-pcevent(keyboard_t *thiskbd, int event, void *arg)
-{
-       int unit = (int)arg;
-
-       if (thiskbd != kbd)
-               return EINVAL;          /* shouldn't happen */
-
-       switch (event) {
-       case KBDIO_KEYINPUT:
-               pcrint(unit);
-               return 0;
-       case KBDIO_UNLOADING:
-               reset_keyboard = 0;
-               kbd = NULL;
-               kbd_release(thiskbd, (void *)&kbd);
-               pcvt_reset_detect_timeout(unit, hz * 4);
-               return 0;
-       default:
-               return EINVAL;
-       }
-}
-#endif /* _DEV_KBD_KBDREG_H_ */
-
-void
-pcrint(int unit)
-{
-
-#if PCVT_KBD_FIFO
-       u_char  dt;
-       u_char  ret = -1;
-
-# if PCVT_SLOW_INTERRUPT
-       int     s;
-# endif
-
-# ifdef _DEV_KBD_KBDREG_H_
-       int     c;
-# endif
-
-#else /* !PCVT_KBD_FIFO */
-       u_char  *cp;
-#endif /* PCVT_KBD_FIFO */
-
-#if PCVT_SCREENSAVER
-       pcvt_scrnsv_reset();
-#endif /* PCVT_SCREENSAVER */
-
-#if PCVT_KBD_FIFO
-       if (kbd_polling)
-       {
-               sgetc(1);
-               return;
-       }
-
-# ifndef _DEV_KBD_KBDREG_H_
-       while (inb(CONTROLLER_CTRL) & STATUS_OUTPBF)    /* check 8042 buffer */
-       {
-               ret = 1;                                /* got something */
-
-               PCVT_KBD_DELAY();                       /* 7 us delay */
-
-               dt = inb(CONTROLLER_DATA);              /* get it 8042 data */
-# else 
-       while ((c = (*kbdsw[kbd->kb_index]->read)(kbd, FALSE)) != -1)
-       {
-               ret = 1;                                /* got something */
-               dt = c;
-# endif /* _DEV_KBD_KBDREG_H_ */
-
-               if (pcvt_kbd_count >= PCVT_KBD_FIFO_SZ) /* fifo overflow ? */
-               {
-                       log (LOG_WARNING, "pcvt: keyboard buffer overflow\n");
-               }
-               else
-               {
-                       pcvt_kbd_fifo[pcvt_kbd_wptr++] = dt; /* data -> fifo */
-
-                       PCVT_DISABLE_INTR ();   /* XXX necessary ? */
-                       pcvt_kbd_count++;               /* update fifo count */
-                       PCVT_ENABLE_INTR ();
-
-                       if (pcvt_kbd_wptr >= PCVT_KBD_FIFO_SZ)
-                               pcvt_kbd_wptr = 0;      /* wraparound pointer */
-               }
-       }
-
-       if (ret == 1)   /* got data from keyboard ? */
-       {
-               if (!pcvt_timeout_scheduled)    /* if not already active .. */
-               {
-                       PCVT_DISABLE_INTR ();
-                       pcvt_timeout_scheduled = 1;     /* flag active */
-                                                       /* fire off */
-                       callout_reset(&pcvt_timeout_ch, hz / 100,
-                                       pcvt_timeout, NULL);
-                       PCVT_ENABLE_INTR ();
-               }
-       }
-
-#else /* !PCVT_KBD_FIFO */
-
-       if((cp = sgetc(1)) == 0)
-               return;
-
-       if (kbd_polling)
-               return;
-
-       if(!(vs[current_video_screen].openf))   /* XXX was vs[minor(dev)] */
-               return;
-
-#if PCVT_NULLCHARS
-       if(*cp == '\0')
-       {
-               /* pass a NULL character */
-               (*linesw[pcconsp->t_line].l_rint)('\0', pcconsp);
-               return;
-       }
-#endif /* PCVT_NULLCHARS */
-
-       while (*cp)
-               (*linesw[pcconsp->t_line].l_rint)(*cp++ & 0xff, pcconsp);
-
-#endif /* PCVT_KBD_FIFO */
-}
-
-
-#if PCVT_NETBSD || PCVT_FREEBSD >= 200
-
-void
-pcstart(struct tty *tp)
-{
-       struct clist *rbp;
-       int s, len;
-       u_char buf[PCVT_PCBURST];
-
-       s = spltty();
-
-       if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP))
-               goto out;
-
-       tp->t_state |= TS_BUSY;
-
-       splx(s);
-
-       async_update(UPDATE_KERN);
-
-       rbp = &tp->t_outq;
-
-       /*
-        * Call q_to_b() at spltty() to ensure that the queue is empty when
-        * the loop terminates.
-        */
-
-       s = spltty();
-
-       while((len = q_to_b(rbp, buf, PCVT_PCBURST)) > 0)
-       {
-               if(vs[minor(tp->t_dev)].scrolling)
-                       sgetc(31337);
-               
-               /*
-                * We need to do this outside spl since it could be fairly
-                * expensive and we don't want our serial ports to overflow.
-                */
-               splx(s);
-               sput(&buf[0], 0, len, minor(tp->t_dev));
-               s = spltty();
-       }
-
-       tp->t_state &= ~TS_BUSY;
-
-#ifndef TS_ASLEEP /* FreeBSD some time after 2.0.5 */
-       ttwwakeup(tp);
-#else
-       if (rbp->c_cc <= tp->t_lowat)
-       {
-               if (tp->t_state&TS_ASLEEP)
-               {
-                       tp->t_state &= ~TS_ASLEEP;
-                       wakeup((caddr_t)rbp);
-               }
-               selwakeup(&tp->t_wsel);
-       }
-#endif
-out:
-       splx(s);
-}
-
-void
-pcstop(struct tty *tp, int flag)
-{
-}
-
-#else /* PCVT_NETBSD || PCVT_FREEBSD >= 200 */
-
-void
-pcstart(struct tty *tp)
-{
-       int s;
-       unsigned char c;
-
-       s = spltty();
-
-       if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP))
-       {
-               goto out;
-       }
-
-       for(;;)
-       {
-
-#if !(PCVT_FREEBSD > 114)
-
-#if !(PCVT_FREEBSD > 111)
-               if (RB_LEN(&tp->t_out) <= tp->t_lowat)
-#else
-               if (RB_LEN(tp->t_out) <= tp->t_lowat)
-#endif
-               {
-                       if (tp->t_state&TS_ASLEEP)
-                       {
-                               tp->t_state &= ~TS_ASLEEP;
-#if !(PCVT_FREEBSD > 111)
-                               wakeup((caddr_t)&tp->t_out);
-#else
-                               wakeup((caddr_t)tp->t_out);
-#endif
-                       }
-
-                       if (tp->t_wsel)
-                       {
-                               selwakeup(tp->t_wsel, tp->t_state & TS_WCOLL);
-                               tp->t_wsel = 0;
-                               tp->t_state &= ~TS_WCOLL;
-                       }
-               }
-
-#else /* PCVT_FREEBSD > 114 */
-               if (tp->t_state & (TS_SO_OCOMPLETE | TS_SO_OLOWAT)
-                   || tp->t_wsel) {
-                       ttwwakeup(tp);
-               }
-#endif /* !PCVT_FREEBSD > 114 */
-
-#if !(PCVT_FREEBSD > 111)
-               if (RB_LEN(&tp->t_out) == 0)
-#else
-               if (RB_LEN(tp->t_out) == 0)
-#endif
-               {
-                       goto out;
-               }
-
-#if !(PCVT_FREEBSD > 111)
-               c = getc(&tp->t_out);
-#else
-               c = getc(tp->t_out);
-#endif
-
-               tp->t_state |= TS_BUSY; /* patch from Frank Maclachlan */
-               splx(s);
-               sput(&c, 0, 1, minor(tp->t_dev));
-               spltty();
-               tp->t_state &= ~TS_BUSY; /* patch from Frank Maclachlan */
-       }
-out:
-       splx(s);
-}
-
-#endif /* PCVT_NETBSD || PCVT_FREEBSD >= 200 */
-
-/*---------------------------------------------------------------------------*
- *             /dev/console
- *---------------------------------------------------------------------------*/
-
-#if !PCVT_NETBSD       /* has moved to cons.c in netbsd-current */
-void
-consinit()             /* init for kernel messages during boot */
-{
-}
-#endif /* PCVT_NETBSD */
-
-#if PCVT_FREEBSD > 205
-static void
-#else
-int
-#endif
-pccnprobe(struct consdev *cp)
-{
-       int unit = 0;
-       int i;
-
-       /* See if this driver is disabled in probe hint. */ 
-       if (resource_int_value("vt", unit, "disabled", &i) == 0 && i) {
-               cp->cn_pri = CN_DEAD;
-               return;
-       }
-
-#ifdef _DEV_KBD_KBDREG_H_
-       kbd_configure(KB_CONF_PROBE_ONLY);
-       if (kbd_find_keyboard("*", unit) < 0)
-       {
-               cp->cn_pri = CN_DEAD;
-               return;
-       }
-#endif /* _DEV_KBD_KBDREG_H_ */
-
-       /* initialize required fields */
-
-       cp->cn_dev = make_adhoc_dev(&pc_cdevsw, 0);
-       cp->cn_pri = CN_INTERNAL;
-
-#if !PCVT_NETBSD
-
-#if !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
-       cp->cn_tp = &pccons[0];
-#else
-       cp->cn_tp = pccons[0];
-#endif /* !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200) */
-
-#endif /* !PCVT_NETBSD */
-
-#if PCVT_FREEBSD <= 205
-       return 1;
-#endif
-}
-
-#if PCVT_FREEBSD > 205
-static void
-#else
-int
-#endif
-pccninit(struct consdev *cp)
-{
-       int unit = 0;
-       int i;
-
-       pcvt_is_console = 1;
-
-#ifdef _DEV_KBD_KBDREG_H_
-       /*
-        * Don't reset the keyboard via `kbdio' just yet.
-        * The system clock has not been calibrated...
-        */
-       reset_keyboard = 0;
-
-       if (kbd)
-       {
-               kbd_release(kbd, (void *)&kbd);
-               kbd = NULL;
-       }
-       i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)unit);
-       if (i >= 0)
-               kbd = kbd_get_keyboard(i);
-
-#if PCVT_SCANSET == 2
-       /*
-        * Turn off scancode translation early so that UserConfig 
-        * and DDB can read the keyboard.
-        */
-       if (kbd)
-       {
-               empty_both_buffers(*(KBDC *)kbd->kb_data, 10);
-               set_controller_command_byte(*(KBDC *)kbd->kb_data,
-                                           KBD_TRANSLATION, 0);
-       }
-#endif /* PCVT_SCANSET == 2 */
-
-#endif /* _DEV_KBD_KBDREG_H_ */
-
-#if PCVT_FREEBSD <= 205
-       return 0;
-#endif
-}
-
-static void
-pccnterm(struct consdev *cp)
-{
-#ifdef _DEV_KBD_KBDREG_H_
-       if (kbd)
-       {
-               kbd_release(kbd, (void *)&kbd);
-               kbd = NULL;
-       }
-#endif /* _DEV_KBD_KBDREG_H_ */
-}
-
-#if PCVT_FREEBSD > 205
-static void
-#else
-int
-#endif
-pccnputc(Dev_t dev, U_char c)
-{
-
-#if PCVT_SW0CNOUTP
-
-       if(current_video_screen != 0)
-       {
-
-#if !PCVT_USL_VT_COMPAT
-               vgapage(0);
-#else
-               switch_screen(0, 0);
-#endif /* !PCVT_USL_VT_COMPAT */
-
-       }
-
-#endif /* PCVT_SW0CNOUTP */
-
-       if (c == '\n')
-               sput("\r", 1, 1, 0);
-
-       sput((char *) &c, 1, 1, 0);
-
-       async_update(UPDATE_KERN);
-
-#if PCVT_FREEBSD <= 205
-       return 0;
-#endif
-}
-
-static int
-pccngetc(Dev_t dev)
-{
-       int s;
-       static u_char *cp, cbuf[4]; /* Temp buf for multi-char key sequence. */
-       u_char c;
-
-#ifdef XSERVER
-
-#if !PCVT_USL_VT_COMPAT
-       if (pcvt_xmode)
-               return 0;
-#else /* !PCVT_USL_VT_COMPAT */
-       if (pcvt_kbd_raw)
-               return 0;
-#endif /* !PCVT_USL_VT_COMPAT */
-
-#endif /* XSERVER */
-
-       if (cp && *cp)
-               /*
-                * We still have a pending key sequence, e.g.
-                * from an arrow key.  Deliver this one first.
-                */
-               return (*cp++);
-
-#ifdef _DEV_KBD_KBDREG_H_
-       if (kbd == NULL)
-               return 0;
-#endif 
-
-       s = spltty();           /* block pcrint while we poll */
-       kbd_polling = 1;
-#ifdef _DEV_KBD_KBDREG_H_
-       (*kbdsw[kbd->kb_index]->enable)(kbd);
-#endif 
-       cp = sgetc(0);
-#ifdef _DEV_KBD_KBDREG_H_
-       (*kbdsw[kbd->kb_index]->disable)(kbd);
-#endif 
-       kbd_polling = 0;
-       splx(s);
-       c = *cp++;
-       if (c && *cp) {
-               /* Preserve the multi-char sequence for the next call. */
-               bcopy(cp, cbuf, 3); /* take care for a trailing '\0' */
-               cp = cbuf;
-       } else
-               cp = 0;
-
-#if ! (PCVT_FREEBSD >= 201)
-       /* this belongs to cons.c */
-       if (c == '\r')
-               c = '\n';
-#endif /* ! (PCVT_FREEBSD >= 201) */
-
-       return c;
-}
-
-#if PCVT_FREEBSD >= 200
-static int
-pccncheckc(Dev_t dev)
-{
-       char *cp;
-       int x;
-
-#ifdef _DEV_KBD_KBDREG_H_
-       if (kbd == NULL)
-               return 0;
-#endif 
-
-       x = spltty();
-       kbd_polling = 1;
-#ifdef _DEV_KBD_KBDREG_H_
-       (*kbdsw[kbd->kb_index]->enable)(kbd);
-#endif 
-       cp = sgetc(1);
-#ifdef _DEV_KBD_KBDREG_H_
-       (*kbdsw[kbd->kb_index]->disable)(kbd);
-#endif 
-       kbd_polling = 0;
-       splx(x);
-       return (cp == NULL ? -1 : *cp);
-}
-#endif /* PCVT_FREEBSD >= 200 */
-
-#if PCVT_NETBSD >= 100
-void
-pccnpollc(Dev_t dev, int on)
-{
-       kbd_polling = on;
-       if (!on) {
-               int s;
-
-               /*
-                * If disabling polling, make sure there are no bytes left in
-                * the FIFO, holding up the interrupt line.  Otherwise we
-                * won't get any further interrupts.
-                */
-               s = spltty();
-               pcrint();
-               splx(s);
-       }
-}
-#endif /* PCVT_NETBSD >= 100 */
-
-/*---------------------------------------------------------------------------*
- *     Set line parameters
- *---------------------------------------------------------------------------*/
-int
-pcparam(struct tty *tp, struct termios *t)
-{
-       int cflag = t->c_cflag;
-
-        /* and copy to tty */
-
-        tp->t_ispeed = t->c_ispeed;
-        tp->t_ospeed = t->c_ospeed;
-        tp->t_cflag = cflag;
-
-       return(0);
-}
-
-/*----------------------------------------------------------------------*
- *     read initial VGA palette (as stored by VGA ROM BIOS) into
- *     palette save area
- *----------------------------------------------------------------------*/
-void
-vgapelinit(void)
-{
-       unsigned idx;
-       struct rgb *val;
-
-       /* first, read all and store to first screen's save buffer */
-       for(idx = 0, val = vs[0].palette; idx < NVGAPEL; idx++, val++)
-               vgapaletteio(idx, val, 0 /* read it */);
-
-       /* now, duplicate for remaining screens */
-       for(idx = 1; idx < PCVT_NSCREENS; idx++)
-               bcopy(vs[0].palette, vs[idx].palette,
-                     NVGAPEL * sizeof(struct rgb));
-}
-
-#if defined XSERVER && !PCVT_USL_VT_COMPAT
-/*----------------------------------------------------------------------*
- *     initialize for X mode
- *     i.e.: grant current process (the X server) all IO privileges,
- *     and mark in static variable so other hooks can test for it,
- *     save all loaded fonts and screen pages to pageable buffers;
- *     if parameter `on' is false, the same procedure is done reverse.
- *----------------------------------------------------------------------*/
-static int
-pcvt_xmode_set(int on, struct thread *td)
-{
-       static unsigned char *saved_fonts[NVGAFONTS];
-
-#if PCVT_SCREENSAVER
-       static unsigned saved_scrnsv_tmo = 0;
-#endif /* PCVT_SCREENSAVER */
-
-#if (PCVT_NETBSD > 9) || (PCVT_FREEBSD > 102)
-       struct trapframe *fp;
-#else
-       struct syscframe *fp;
-#endif /* PCVT_NETBSD > 9 */
-
-       int error, i;
-
-       /* X will only run on VGA and Hercules adaptors */
-
-       if(adaptor_type != VGA_ADAPTOR && adaptor_type != MDA_ADAPTOR)
-               return (EINVAL);
-
-#if PCVT_NETBSD > 9
-       fp = (struct trapframe *)p->p_regs;
-#else
-       fp = (struct syscframe *)p->p_regs;
-#endif /* PCVT_NETBSD > 9 */
-
-       if(on)
-       {
-               /*
-                * Test whether the calling process has super-user privileges
-                * and we're in insecure mode.
-                * This prevents us from granting the potential security hole
-                * `IO priv' to insufficiently privileged processes.
-                */
-               error = suser(td);
-               if (error != 0)
-                       return (error);
-               if (securelevel > 0)
-                       return (EPERM);
-
-               if(pcvt_xmode)
-                       return 0;
-
-               pcvt_xmode = pcvt_kbd_raw = 1;
-
-               for(i = 0; i < totalfonts; i++)
-               {
-                       if(vgacs[i].loaded)
-                       {
-                               saved_fonts[i] = (unsigned char *)
-                                       malloc(32 * 256, M_DEVBUF, M_WAITOK);
-                               if(saved_fonts[i] == 0)
-                               {
-                                       printf(
-                                 "pcvt_xmode_set: no font buffer available\n");
-                                       return (EAGAIN);
-                               }
-                               else
-                               {
-                                       vga_move_charset(i, saved_fonts[i], 1);
-                               }
-                       }
-                       else
-                       {
-                               saved_fonts[i] = 0;
-                       }
-               }
-
-#if PCVT_SCREENSAVER
-               if(saved_scrnsv_tmo = scrnsv_timeout)
-                       pcvt_set_scrnsv_tmo(0); /* turn it off */
-#endif /* PCVT_SCREENSAVER */
-
-               async_update(UPDATE_STOP);      /* turn off */
-
-               /* disable text output and save screen contents */
-               /* video board memory -> kernel memory */
-
-               bcopy(vsp->Crtat, vsp->Memory,
-                      vsp->screen_rowsize * vsp->maxcol * CHR);
-
-               vsp->Crtat = vsp->Memory;       /* operate in memory now */
-
-#ifndef _DEV_KBD_KBDREG_H_
-
-#if PCVT_SCANSET == 2
-               /* put keyboard to return ancient PC scan codes */
-               kbc_8042cmd(CONTR_WRITE);
-#if PCVT_USEKBDSEC             /* security enabled */
-               outb(CONTROLLER_DATA,
-                (COMMAND_SYSFLG|COMMAND_IRQEN|COMMAND_PCSCAN));
-#else                          /* security disabled */
-               outb(CONTROLLER_DATA,
-                (COMMAND_INHOVR|COMMAND_SYSFLG|COMMAND_IRQEN|COMMAND_PCSCAN));
-#endif /* PCVT_USEKBDSEC */
-#endif /* PCVT_SCANSET == 2 */
-
-#else /* _DEV_KBD_KBDREG_H_ */
-
-#if PCVT_SCANSET == 2
-               /* put keyboard to return ancient PC scan codes */
-               set_controller_command_byte(*(KBDC *)kbd->kb_data, 
-                       KBD_TRANSLATION, KBD_TRANSLATION); 
-#endif /* PCVT_SCANSET == 2 */
-
-#endif /* !_DEV_KBD_KBDREG_H_ */
-
-#if PCVT_NETBSD > 9
-               fp->tf_eflags |= PSL_IOPL;
-#else
-               fp->sf_eflags |= PSL_IOPL;
-#endif /* PCVT_NETBSD > 9 */
-
-       }
-       else
-       {
-               if(!pcvt_xmode)         /* verify if in X */
-                       return 0;
-
-               pcvt_xmode = pcvt_kbd_raw = 0;
-
-               for(i = 0; i < totalfonts; i++)
-               {
-                       if(saved_fonts[i])
-                       {
-                               vga_move_charset(i, saved_fonts[i], 0);
-                               free(saved_fonts[i], M_DEVBUF);
-                               saved_fonts[i] = 0;
-                       }
-               }
-
-#if PCVT_NETBSD > 9
-               fp->tf_eflags &= ~PSL_IOPL;
-#else
-               fp->sf_eflags &= ~PSL_IOPL;
-#endif /* PCVT_NETBSD > 9 */
-
-#if PCVT_SCREENSAVER
-               if(saved_scrnsv_tmo)
-                       pcvt_set_scrnsv_tmo(saved_scrnsv_tmo);
-#endif /* PCVT_SCREENSAVER */
-
-#ifndef _DEV_KBD_KBDREG_H_
-
-#if PCVT_SCANSET == 2
-               kbc_8042cmd(CONTR_WRITE);
-#if PCVT_USEKBDSEC             /* security enabled */
-               outb(CONTROLLER_DATA,
-                (COMMAND_SYSFLG|COMMAND_IRQEN));
-#else                          /* security disabled */
-               outb(CONTROLLER_DATA,
-                (COMMAND_INHOVR|COMMAND_SYSFLG|COMMAND_IRQEN));
-#endif /* PCVT_USEKBDSEC */
-#endif /* PCVT_SCANSET == 2 */
-
-#else /* _DEV_KBD_KBDREG_H_ */
-
-#if PCVT_SCANSET == 2
-               set_controller_command_byte(*(KBDC *)kbd->kb_data,
-                       KBD_TRANSLATION, 0);
-#endif /* PCVT_SCANSET == 2 */
-
-#endif /* !_DEV_KBD_KBDREG_H_ */
-
-               if(adaptor_type == MDA_ADAPTOR)
-               {
-                   /*
-                    * Due to the fact that HGC registers are write-only,
-                    * the Xserver can only make guesses about the state
-                    * the HGC adaptor has been before turning on X mode.
-                    * Thus, the display must be re-enabled now, and the
-                    * cursor shape and location restored.
-                    */
-                   outb(GN_DMCNTLM, 0x28); /* enable display, text mode */
-                   outb(addr_6845, CRTC_CURSORH); /* select high register */
-                   outb(addr_6845+1,
-                        ((vsp->Crtat + vsp->cur_offset) - Crtat) >> 8);
-                   outb(addr_6845, CRTC_CURSORL); /* select low register */
-                   outb(addr_6845+1,
-                        ((vsp->Crtat + vsp->cur_offset) - Crtat));
-
-                   outb(addr_6845, CRTC_CURSTART); /* select high register */
-                   outb(addr_6845+1, vsp->cursor_start);
-                   outb(addr_6845, CRTC_CUREND); /* select low register */
-                   outb(addr_6845+1, vsp->cursor_end);
-                 }
-
-               /* restore screen and re-enable text output */
-               /* kernel memory -> video board memory */
-
-               bcopy(vsp->Memory, Crtat,
-                      vsp->screen_rowsize * vsp->maxcol * CHR);
-
-               vsp->Crtat = Crtat;     /* operate on-screen now */
-
-               /* set crtc screen memory start address */
-
-               outb(addr_6845, CRTC_STARTADRH);
-               outb(addr_6845+1, (vsp->Crtat - Crtat) >> 8);
-               outb(addr_6845, CRTC_STARTADRL);
-               outb(addr_6845+1, (vsp->Crtat - Crtat));
-
-               async_update(UPDATE_START);
-       }
-       return 0;
-}
-#endif /* XSERVER && !PCVT_USL_VT_COMPAT */
-
-#endif /* NVT > 0 */
-
-/*-------------------------- E O F -------------------------------------*/
diff --git a/sys/dev/video/pcvt/i386/pcvt_ext.c b/sys/dev/video/pcvt/i386/pcvt_ext.c
deleted file mode 100644 (file)
index ec9cfb5..0000000
+++ /dev/null
@@ -1,2822 +0,0 @@
-/*
- * Copyright (c) 1999 Hellmuth Michaelis
- *
- * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
- *
- * Copyright (C) 1992, 1993 Soeren Schmidt.
- *
- * All rights reserved.
- *
- * For the sake of compatibility, portions of this code regarding the
- * X server interface are taken from Soeren Schmidt's syscons driver.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by
- *     Hellmuth Michaelis, Joerg Wunsch and Soeren Schmidt.
- * 4. The name authors may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*---------------------------------------------------------------------------*
- *
- *     pcvt_ext.c      VT220 Driver Extended Support Routines
- *     ------------------------------------------------------
- *
- *     Last Edit-Date: [Mon Dec 27 14:05:16 1999]
- *
- * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_ext.c,v 1.17 1999/12/30 16:17:09 hm Exp $
- * $DragonFly: src/sys/dev/video/pcvt/i386/Attic/pcvt_ext.c,v 1.6 2003/08/07 21:17:16 dillon Exp $
- *
- *---------------------------------------------------------------------------*/
-
-#include "use_vt.h"
-#if NVT > 0
-
-#include "pcvt_hdr.h"  /* global include */
-
-#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
-
-static int  s3testwritable( void );
-static int  et4000_col( int );
-static int  wd90c11_col( int );
-static int  tri9000_col( int );
-static int  v7_1024i_col( int );
-static int  s3_928_col( int );
-static int  cl_gd542x_col( int );
-
-/* storage to save video timing values of 80 columns text mode */
-static union {
-       u_char generic[11];
-       u_char et4000[11];
-       u_char wd90c11[12];
-       u_char tri9000[13];
-       u_char v7_1024i[17];
-       u_char s3_928[32];
-       u_char cirrus[13];
-}
-savearea;
-
-static int regsaved = 0;       /* registers are saved to savearea */
-
-/*---------------------------------------------------------------------------*
- *
- *     Find out which video board we are running on, taken from:
- *     Richard Ferraro: Programmers Guide to the EGA and VGA Cards
- *     and from David E. Wexelblat's SuperProbe Version 1.0.
- *     When a board is found, for which 132 column switching is
- *     provided, the global variable "can_do_132col" is set to 1,
- *     also the global variable vga_family is set to what we found.
- *
- *     ###############################################################
- *     ## THIS IS GETTING MORE AND MORE A LARGE SPAGHETTI HACK !!!! ##
- *     ###############################################################
- *
- *---------------------------------------------------------------------------*/
-u_char
-vga_chipset(void)
-{
-       u_char *ptr;
-       u_char byte, oldbyte, old1byte, newbyte;
-
-#if PCVT_132GENERIC
-       can_do_132col = 1;      /* assumes everyone can do 132 col */
-#else
-       can_do_132col = 0;      /* assumes noone can do 132 col */
-#endif /* PCVT_132GENERIC */
-
-       vga_family = VGA_F_NONE;
-
-/*---------------------------------------------------------------------------*
- *     check for Western Digital / Paradise chipsets
- *---------------------------------------------------------------------------*/
-
-       ptr = (u_char *)Crtat;
-
-       if(color)
-               ptr += (0xc007d - 0xb8000);
-       else
-               ptr += (0xc007d - 0xb0000);
-
-       if((*ptr++ == 'V') && (*ptr++ == 'G') &&
-          (*ptr++ == 'A') && (*ptr++ == '='))
-       {
-               int wd90c10;
-
-               vga_family = VGA_F_WD;
-
-               outb(addr_6845, 0x2b);
-               oldbyte = inb(addr_6845+1);
-               outb(addr_6845+1, 0xaa);
-               newbyte = inb(addr_6845+1);
-               outb(addr_6845+1, oldbyte);
-               if(newbyte != 0xaa)
-                       return(VGA_PVGA);       /* PVGA1A chip */
-
-               outb(TS_INDEX, 0x12);
-               oldbyte = inb(TS_DATA);
-               outb(TS_DATA, oldbyte & 0xbf);
-               newbyte = inb(TS_DATA) & 0x40;
-               if(newbyte != 0)
-                       return(VGA_WD90C00);    /* WD90C00 chip */
-
-               outb(TS_DATA, oldbyte | 0x40);
-               newbyte = inb(TS_DATA) & 0x40;
-               if(newbyte == 0)
-                       return(VGA_WD90C00);    /* WD90C00 chip */
-
-               outb(TS_DATA, oldbyte);
-
-               wd90c10 = 0;
-               outb(TS_INDEX, 0x10);
-               oldbyte = inb(TS_DATA);
-
-               outb(TS_DATA, oldbyte & 0xfb);
-               newbyte = inb(TS_DATA) & 0x04;
-               if(newbyte != 0)
-                       wd90c10 = 1;
-
-               outb(TS_DATA, oldbyte | 0x04);
-               newbyte = inb(TS_DATA) & 0x04;
-               if(newbyte == 0)
-                       wd90c10 = 1;
-
-               outb(TS_DATA, oldbyte);
-
-               if(wd90c10)
-                       return(VGA_WD90C10);
-               else
-               {
-                       can_do_132col = 1;
-                       return(VGA_WD90C11);
-               }
-       }
-
-/*---------------------------------------------------------------------------*
- *     check for Trident chipsets
- *---------------------------------------------------------------------------*/
-
-       outb(TS_INDEX, 0x0b);
-       oldbyte = inb(TS_DATA);
-
-
-       outb(TS_INDEX, 0x0b);
-       outb(TS_DATA, 0x00);
-
-       byte = inb(TS_DATA);    /* chipset type */
-
-
-       outb(TS_INDEX, 0x0e);
-       old1byte = inb(TS_DATA);
-
-       outb(TS_DATA, 0);
-       newbyte = inb(TS_DATA);
-
-       outb(TS_DATA, (old1byte ^ 0x02));
-
-       outb(TS_INDEX, 0x0b);
-       outb(TS_DATA, oldbyte);
-
-       if((newbyte & 0x0f) == 0x02)
-       {
-               /* is a trident chip */
-
-               vga_family = VGA_F_TRI;
-
-               switch(byte)
-               {
-                       case 0x01:
-                               return(VGA_TR8800BR);
-
-                       case 0x02:
-                               return(VGA_TR8800CS);
-
-                       case 0x03:
-                               can_do_132col = 1;
-                               return(VGA_TR8900B);
-
-                       case 0x04:
-                       case 0x13:
-       /* Haven't tried, but should work */
-                               can_do_132col = 1;
-                               return(VGA_TR8900C);
-
-                       case 0x23:
-                               can_do_132col = 1;
-                               return(VGA_TR9000);
-
-                       case 0x33:
-                               can_do_132col = 1;
-                               return(VGA_TR8900CL);
-
-                       case 0x83:
-                               return(VGA_TR9200);
-
-                       case 0x93:
-                               return(VGA_TR9100);
-
-                       default:
-                               return(VGA_TRUNKNOWN);
-               }
-       }
-
-/*---------------------------------------------------------------------------*
- *     check for Tseng Labs ET3000/4000 chipsets
- *---------------------------------------------------------------------------*/
-
-       outb(GN_HERCOMPAT, 0x06);
-       if(color)
-               outb(GN_DMCNTLC, 0xa0);
-       else
-               outb(GN_DMCNTLM, 0xa0);
-
-       /* read old value */
-
-       if(color)
-               inb(GN_INPSTAT1C);
-       else
-               inb(GN_INPSTAT1M);
-       outb(ATC_INDEX, ATC_MISC);
-       oldbyte = inb(ATC_DATAR);
-
-       /* write new value */
-
-       if(color)
-               inb(GN_INPSTAT1C);
-       else
-               inb(GN_INPSTAT1M);
-       outb(ATC_INDEX, ATC_MISC);
-       newbyte = oldbyte ^ 0x10;
-       outb(ATC_DATAW, newbyte);
-
-       /* read back new value */
-       if(color)
-               inb(GN_INPSTAT1C);
-       else
-               inb(GN_INPSTAT1M);
-       outb(ATC_INDEX, ATC_MISC);
-       byte = inb(ATC_DATAR);
-
-       /* write back old value */
-       if(color)
-               inb(GN_INPSTAT1C);
-       else
-               inb(GN_INPSTAT1M);
-       outb(ATC_INDEX, ATC_MISC);
-       outb(ATC_DATAW, oldbyte);
-
-       if(byte == newbyte)     /* ET3000 or ET4000 */
-       {
-               vga_family = VGA_F_TSENG;
-
-               outb(addr_6845, CRTC_EXTSTART);
-               oldbyte = inb(addr_6845+1);
-               newbyte = oldbyte ^ 0x0f;
-               outb(addr_6845+1, newbyte);
-               byte = inb(addr_6845+1);
-               outb(addr_6845+1, oldbyte);
-
-               if(byte == newbyte)
-               {
-                       can_do_132col = 1;
-                       return(VGA_ET4000);
-               }
-               else
-               {
-                       return(VGA_ET3000);
-               }
-       }
-
-/*---------------------------------------------------------------------------*
- *     check for Video7 VGA chipsets
- *---------------------------------------------------------------------------*/
-
-       outb(TS_INDEX, TS_EXTCNTL);     /* enable extensions */
-       outb(TS_DATA, 0xea);
-
-       outb(addr_6845, CRTC_STARTADRH);
-       oldbyte = inb(addr_6845+1);
-
-       outb(addr_6845+1, 0x55);
-       newbyte = inb(addr_6845+1);
-
-       outb(addr_6845, CRTC_V7ID);     /* id register */
-       byte = inb(addr_6845+1);        /* read id */
-
-       outb(addr_6845, CRTC_STARTADRH);
-       outb(addr_6845+1, oldbyte);
-
-       outb(TS_INDEX, TS_EXTCNTL);     /* disable extensions */
-       outb(TS_DATA, 0xae);
-
-       if(byte == (0x55 ^ 0xea))
-       {                                       /* is Video 7 */
-
-               vga_family = VGA_F_V7;
-
-               outb(TS_INDEX, TS_EXTCNTL);     /* enable extensions */
-               outb(TS_DATA, 0xea);
-
-               outb(TS_INDEX, TS_V7CHIPREV);
-               byte = inb(TS_DATA);
-
-               outb(TS_INDEX, TS_EXTCNTL);     /* disable extensions */
-               outb(TS_DATA, 0xae);
-
-               if(byte < 0xff && byte >= 0x80)
-                       return(VGA_V7VEGA);
-               if(byte < 0x7f && byte >= 0x70)
-                       return(VGA_V7FWVR);
-               if(byte < 0x5a && byte >= 0x50)
-                       return(VGA_V7V5);
-               if(byte < 0x4a && byte > 0x40)
-               {
-                       can_do_132col = 1;
-                       return(VGA_V71024I);
-               }
-               return(VGA_V7UNKNOWN);
-       }
-
-/*---------------------------------------------------------------------------*
- *     check for S3 chipsets
- *---------------------------------------------------------------------------*/
-
-       outb(addr_6845, 0x38);          /* reg 1 lock register */
-       old1byte = inb(addr_6845+1);    /* get old value */
-
-       outb(addr_6845, 0x38);
-       outb(addr_6845+1, 0x00);        /* lock registers */
-
-       if(s3testwritable() == 0)       /* check if locked */
-       {
-               outb(addr_6845, 0x38);
-               outb(addr_6845+1, 0x48);        /* unlock registers */
-
-               if(s3testwritable() == 1 )      /* check if unlocked */
-               {
-                       vga_family = VGA_F_S3;  /* FAMILY S3  */
-
-                       outb(addr_6845, 0x30);  /* chip id/rev reg */
-                       byte = inb(addr_6845+1);
-
-                       switch(byte & 0xf0)
-                       {
-                               case 0x80:
-                                       switch(byte & 0x0f)
-                                       {
-                                               case 0x01:
-                                                       outb(addr_6845, 0x38);
-                                                       outb(addr_6845+1, old1byte);
-                                                       return VGA_S3_911;
-
-                                               case 0x02:
-                                                       outb(addr_6845, 0x38);
-                                                       outb(addr_6845+1, old1byte);
-                                                       return VGA_S3_924;
-
-                                               default:
-                                                       outb(addr_6845, 0x38);
-                                                       outb(addr_6845+1, old1byte);
-                                                       return VGA_S3_UNKNOWN;
-                                       }
-                                       break;
-
-                               case 0xA0:
-                                       outb(addr_6845, 0x38);
-                                       outb(addr_6845+1, old1byte);
-                                       return VGA_S3_80x;
-
-                               case 0x90:
-                               case 0xb0:
-                                       outb(addr_6845, 0x38);
-                                       outb(addr_6845+1, old1byte);
-                                       can_do_132col = 1;
-                                       return VGA_S3_928;
-
-                               default:
-                                       outb(addr_6845, 0x38);
-                                       outb(addr_6845+1, old1byte);
-                                       return VGA_S3_UNKNOWN;
-                       }
-               }
-       }
-
-/*---------------------------------------------------------------------------*
- *     check for Cirrus chipsets
- *---------------------------------------------------------------------------*/
-
-       outb(TS_INDEX, 6);
-       oldbyte = inb(TS_DATA);
-       outb(TS_INDEX, 6);
-       outb(TS_DATA, 0x12);
-       outb(TS_INDEX, 6);
-       newbyte = inb(TS_DATA);
-       outb(addr_6845, 0x27);
-       byte = inb(addr_6845 + 1);
-       outb(TS_INDEX, 6);
-       outb(TS_DATA, oldbyte);
-       if (newbyte == 0x12) {
-               vga_family = VGA_F_CIR;
-               can_do_132col = 1;
-               switch ((byte & 0xfc) >> 2) {
-               case 0x22:
-                       switch (byte & 3) {
-                       case 0:
-                               return VGA_CL_GD5402;
-                       case 1:
-                               return VGA_CL_GD5402r1;
-                       case 2:
-                               return VGA_CL_GD5420;
-                       case 3:
-                               return VGA_CL_GD5420r1;
-                       }
-                       break;
-               case 0x23:
-                       return VGA_CL_GD5422;
-               case 0x25:
-                       return VGA_CL_GD5424;
-               case 0x24:
-                       return VGA_CL_GD5426;
-               case 0x26:
-                       return VGA_CL_GD5428;
-               }
-       }
-
-       return(VGA_UNKNOWN);
-}
-
-/*---------------------------------------------------------------------------
- * test if index 35 lower nibble is writable (taken from SuperProbe 1.0)
- *---------------------------------------------------------------------------*/
-static int
-s3testwritable(void)
-{
-       u_char old, new1, new2;
-
-       outb(addr_6845, 0x35);
-       old = inb(addr_6845+1);                 /* save */
-
-       outb(addr_6845, 0x35);
-       outb(addr_6845+1, (old & 0xf0));        /* write 0 */
-
-       outb(addr_6845, 0x35);
-       new1 = (inb(addr_6845+1)) & 0x0f;       /* must read 0 */
-
-       outb(addr_6845, 0x35);
-       outb(addr_6845+1, (old | 0x0f));        /* write 1 */
-
-       outb(addr_6845, 0x35);
-       new2 = (inb(addr_6845+1)) & 0x0f;       /* must read 1 */
-
-       outb(addr_6845, 0x35);
-       outb(addr_6845+1, old);                 /* restore */
-
-       return((new1==0) && (new2==0x0f));
-}
-
-/*---------------------------------------------------------------------------*
- *     return ptr to string describing vga type
- *---------------------------------------------------------------------------*/
-char *
-vga_string(int number)
-{
-       static char *vga_tab[] = {
-               "generic",
-               "et4000",
-               "et3000",
-               "pvga1a",
-               "wd90c00",
-               "wd90c10",
-               "wd90c11",
-               "v7 vega",
-               "v7 fast",
-               "v7 ver5",
-               "v7 1024i",
-               "unknown v7",
-               "tvga 8800br",
-               "tvga 8800cs",
-               "tvga 8900b",
-               "tvga 8900c",
-               "tvga 8900cl",
-               "tvga 9000",
-               "tvga 9100",
-               "tvga 9200",
-               "unknown trident",
-               "s3 911",
-               "s3 924",
-               "s3 801/805",
-               "s3 928",
-               "unkown s3",
-               "cl-gd5402",
-               "cl-gd5402r1",
-               "cl-gd5420",
-               "cl-gd5420r1",
-               "cl-gd5422",
-               "cl-gd5424",
-               "cl-gd5426",
-               "cl-gd5428"
-       };
-       return(vga_tab[number]);
-}
-
-/*---------------------------------------------------------------------------*
- *     toggle vga 80/132 column operation
- *---------------------------------------------------------------------------*/
-int
-vga_col(struct video_state *svsp, int cols)
-{
-       int ret = 0;
-
-       if(adaptor_type != VGA_ADAPTOR)
-               return(0);
-
-       switch(vga_type)
-       {
-               case VGA_ET4000:
-                       ret = et4000_col(cols);
-                       break;
-
-               case VGA_WD90C11:
-                       ret = wd90c11_col(cols);
-                       break;
-
-               case VGA_TR8900B:
-               case VGA_TR8900C:
-               case VGA_TR8900CL:
-               case VGA_TR9000:
-                       ret = tri9000_col(cols);
-                       break;
-
-               case VGA_V71024I:
-                       ret = v7_1024i_col(cols);
-                       break;
-
-               case VGA_S3_928:
-                       ret = s3_928_col(cols);
-                       break;
-
-               case VGA_CL_GD5402:
-               case VGA_CL_GD5402r1:
-               case VGA_CL_GD5420:
-               case VGA_CL_GD5420r1:
-               case VGA_CL_GD5422:
-               case VGA_CL_GD5424:
-               case VGA_CL_GD5426:
-               case VGA_CL_GD5428:
-                       ret = cl_gd542x_col(cols);
-                       break;
-
-               default:
-
-#if PCVT_132GENERIC
-                       ret = generic_col(cols);
-#endif /* PCVT_132GENERIC */
-
-                       break;
-       }
-
-       if(ret == 0)
-               return(0);      /* failed */
-
-       svsp->maxcol = cols;
-
-       return(1);
-}
-
-#if PCVT_132GENERIC
-/*---------------------------------------------------------------------------*
- *     toggle 80/132 column operation for "generic" SVGAs
- *     NB: this is supposed to work on any (S)VGA as long as the monitor
- *     is able to sync down to 21.5 kHz horizontally. The resulting
- *     vertical frequency is only 50 Hz, so if there is some better board
- *     specific algorithm, we avoid using this generic one.
- *     REPORT ANY FAILURES SO WE CAN IMPROVE THIS
- *---------------------------------------------------------------------------*/
-
-#if PCVT_EXP_132COL
-/*
- *     Some improved (i.e. higher scan rates) figures for the horizontal
- *     timing. USE AT YOUR OWN RISK, THIS MIGHT DAMAGE YOUR MONITOR DUE
- *     TO A LOSS OF HORIZONTAL SYNC!
- *     The figures have been tested with an ET3000 board along with a
- *     NEC MultiSync 3D monitor. If you are playing here, consider
- *     testing with several screen pictures (dark background vs. light
- *     background, even enlightening the border color may impact the
- *     result - you can do this e.g. by "scon -p black,42,42,42")
- *     Remember that all horizontal timing values must be dividable
- *     by 8! (The scheme below is taken so that nifty kernel hackers
- *     are able to patch the figures at run-time.)
- *
- *     The actual numbers result in 23 kHz line scan and 54 Hz vertical
- *     scan.
- */
-#endif /* PCVT_EXP_132COL */
-
-int
-generic_col(int cols)
-{
-       u_char *sp;
-       u_char byte;
-
-#if !PCVT_EXP_132COL
-
-       /* stable figures for any multisync monitor that syncs down to 22 kHz*/
-       static volatile u_short htotal = 1312;
-       static volatile u_short displayend = 1056;
-       static volatile u_short blankstart = 1072;
-       static volatile u_short syncstart = 1112;
-       static volatile u_short syncend = 1280;
-
-#else /* PCVT_EXP_132COL */
-
-       /* reduced sync-pulse width and sync delays */
-       static volatile u_short htotal = 1232;
-       static volatile u_short displayend = 1056;
-       static volatile u_short blankstart = 1056;
-       static volatile u_short syncstart = 1104;
-       static volatile u_short syncend = 1168;
-
-#endif /* PCVT_EXP_132COL */
-
-       vga_screen_off();
-
-       /* enable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       byte = inb(addr_6845+1);
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte & 0x7f);
-
-       if(cols == SCR_COL132)          /* switch 80 -> 132 */
-       {
-               /* save state of board for 80 columns */
-
-               if(!regsaved)
-               {
-                       regsaved = 1;
-
-                       sp = savearea.generic;
-
-                       outb(addr_6845, 0x00);  /* Horizontal Total */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x01);  /* Horizontal Display End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x03);  /* Horizontal Blank End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x13);  /* Row Offset Register */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-                       *sp++ = inb(TS_DATA);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Mode control */
-                       outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Horizontal Pixel Panning */
-                       outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       *sp++ = inb(GN_MISCOUTR); /* Misc output register */
-               }
-
-               /* setup chipset for 132 column operation */
-
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, (htotal / 8) - 5);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, (displayend / 8) - 1);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, blankstart / 8);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, ((syncend / 8) & 0x1f) | 0x80);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, syncstart / 8);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1,
-                    (((syncend / 8) & 0x20) * 4)
-                    | ((syncend / 8) & 0x1f));
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, 0x42);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, 0x01);    /* 8 dot char clock */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */
-               outb(ATC_DATAW, 0x08);  /* Line graphics disable */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); /* ATC Horizontal Pixel Panning */
-               outb(ATC_DATAW, 0x00);
-
-               /* Misc output register */
-               /* use the 28.322 MHz clock */
-               outb(GN_MISCOUTW, (inb(GN_MISCOUTR) & ~0x0c) | 4);
-       }
-       else    /* switch 132 -> 80 */
-       {
-               if(!regsaved)                   /* failsafe */
-               {
-                       /* disable access to first 7 CRTC registers */
-                       outb(addr_6845, CRTC_VSYNCE);
-                       outb(addr_6845+1, byte);
-                       vga_screen_on();
-                       return(0);
-               }
-
-               sp = savearea.generic;
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, *sp++);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Mode control */
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Horizontal Pixel Panning */
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               outb(GN_MISCOUTW, *sp++);       /* Misc output register */
-       }
-
-       /* disable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte);
-
-       vga_screen_on();
-
-       return(1);
-}
-#endif /* PCVT_132GENERIC */
-
-/*---------------------------------------------------------------------------*
- *     toggle 80/132 column operation for ET4000 based boards
- *---------------------------------------------------------------------------*/
-int
-et4000_col(int cols)
-{
-       u_char *sp;
-       u_char byte;
-
-       vga_screen_off();
-
-       /* enable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       byte = inb(addr_6845+1);
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte & 0x7f);
-
-       if(cols == SCR_COL132)          /* switch 80 -> 132 */
-       {
-               /* save state of board for 80 columns */
-
-               if(!regsaved)
-               {
-                       regsaved = 1;
-
-                       sp = savearea.et4000;
-
-                       outb(addr_6845, 0x00);  /* Horizontal Total */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x01);  /* Horizontal Display End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x13);  /* Row Offset Register */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x34);  /* 6845 Compatibility */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-                       *sp++ = inb(TS_DATA);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Mode control */
-                       outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Horizontal Pixel Panning */
-                       outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       *sp++ = inb(GN_MISCOUTR);       /* Misc output register */
-               }
-
-               /* setup chipset for 132 column operation */
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, 0x9f);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, 0x83);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, 0x84);
-
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, 0x8b);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, 0x80);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, 0x42);
-
-               outb(addr_6845, 0x34);  /* 6845 Compatibility */
-               outb(addr_6845+1, 0x0a);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, 0x01);    /* 8 dot char clock */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */
-               outb(ATC_DATAW, 0x08);  /* Line graphics disable */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); /* ATC Horizontal Pixel Panning */
-               outb(ATC_DATAW, 0x00);
-
-               /* Misc output register */
-
-               outb(GN_MISCOUTW, (inb(GN_MISCOUTR) & ~0x0c));
-       }
-       else    /* switch 132 -> 80 */
-       {
-               if(!regsaved)                   /* failsafe */
-               {
-                       /* disable access to first 7 CRTC registers */
-                       outb(addr_6845, CRTC_VSYNCE);
-                       outb(addr_6845+1, byte);
-                       vga_screen_on();
-                       return(0);
-               }
-
-               sp = savearea.et4000;
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, *sp++);
-
-
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x34);  /* 6845 Compatibility */
-               outb(addr_6845+1, *sp++);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Mode control */
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Horizontal Pixel Panning */
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               outb(GN_MISCOUTW, *sp++);       /* Misc output register */
-       }
-
-       /* disable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte);
-
-       vga_screen_on();
-
-       return(1);
-}
-
-/*---------------------------------------------------------------------------*
- *     toggle 80/132 column operation for WD/Paradise based boards
- *
- *     when this card does 132 cols, the char map select register (TS_INDEX,
- *     TS_FONTSEL) function bits get REDEFINED. whoever did design this,
- *     please don't cross my way ever .......
- *
- *---------------------------------------------------------------------------*/
-int
-wd90c11_col(int cols)
-{
-
-#if !PCVT_BACKUP_FONTS
-       static unsigned char *sv_fontwd[NVGAFONTS];
-#endif /*  !PCVT_BACKUP_FONTS */
-
-       u_char *sp;
-       u_char byte;
-       int i;
-
-       vga_screen_off();
-
-       /* enable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       byte = inb(addr_6845+1);
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte & 0x7f);
-
-       /* enable access to WD/Paradise "control extensions" */
-
-       outb(GDC_INDEX, GDC_PR5GPLOCK);
-       outb(GDC_INDEX, 0x05);
-       outb(addr_6845, CRTC_PR10);
-       outb(addr_6845, 0x85);
-       outb(TS_INDEX, TS_UNLOCKSEQ);
-       outb(TS_DATA, 0x48);
-
-       if(cols == SCR_COL132)          /* switch 80 -> 132 */
-       {
-               /* save state of board for 80 columns */
-
-               if(!regsaved)
-               {
-                       regsaved = 1;
-
-                       /* save current fonts */
-
-#if !PCVT_BACKUP_FONTS
-                       for(i = 0; i < totalfonts; i++)
-                       {
-                               if(vgacs[i].loaded)
-                               {
-                                       if((sv_fontwd[i] =
-                                           (u_char *)malloc(32 * 256,
-                                                            M_DEVBUF,
-                                                            M_WAITOK))
-                                          == NULL)
-                                               printf("pcvt: no font buffer\n");
-                                       else
-                                               vga_move_charset(i,
-                                                                sv_fontwd[i],
-                                                                1);
-                               }
-                               else
-                               {
-                                       sv_fontwd[i] = 0;
-                               }
-                       }
-
-#endif /* !PCVT_BACKUP_FONTS */
-
-                       sp = savearea.wd90c11;
-
-                       outb(addr_6845, 0x00);  /* Horizontal Total */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x01);  /* Horizontal Display End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x03);  /* Horizontal Blank End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x13);  /* Row Offset Register */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x2e);  /* misc 1 */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x2f);  /* misc 2 */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(TS_INDEX, 0x10);/* Timing Sequencer */
-                       *sp++ = inb(TS_DATA);
-                       outb(TS_INDEX, 0x12);/* Timing Sequencer */
-                       *sp++ = inb(TS_DATA);
-
-                       *sp++ = inb(GN_MISCOUTR);       /* Misc output register */
-               }
-
-               /* setup chipset for 132 column operation */
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, 0x9c);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, 0x83);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, 0x84);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, 0x9f);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, 0x8a);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, 0x1c);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, 0x42);
-
-               outb(addr_6845, 0x2e);  /* misc 1 */
-               outb(addr_6845+1, 0x04);
-               outb(addr_6845, 0x2f);  /* misc 2 */
-               outb(addr_6845+1, 0x00);
-
-               outb(TS_INDEX, 0x10);/* Timing Sequencer */
-               outb(TS_DATA, 0x21);
-               outb(TS_INDEX, 0x12);/* Timing Sequencer */
-               outb(TS_DATA, 0x14);
-
-               outb(GN_MISCOUTW, (inb(GN_MISCOUTR) | 0x08));   /* Misc output register */
-
-               vsp->wd132col = 1;
-       }
-       else    /* switch 132 -> 80 */
-       {
-               if(!regsaved)                   /* failsafe */
-               {
-                       /* disable access to first 7 CRTC registers */
-
-                       outb(addr_6845, CRTC_VSYNCE);
-                       outb(addr_6845+1, byte);
-
-                       /* disable access to WD/Paradise "control extensions" */
-
-                       outb(GDC_INDEX, GDC_PR5GPLOCK);
-                       outb(GDC_INDEX, 0x00);
-                       outb(addr_6845, CRTC_PR10);
-                       outb(addr_6845, 0x00);
-                       outb(TS_INDEX, TS_UNLOCKSEQ);
-                       outb(TS_DATA, 0x00);
-
-                       vga_screen_on();
-
-                       return(0);
-               }
-
-               sp = savearea.wd90c11;
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x2e);  /* misc 1 */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x2f);  /* misc 2 */
-               outb(addr_6845+1, *sp++);
-
-               outb(TS_INDEX, 0x10);/* Timing Sequencer */
-               outb(addr_6845+1, *sp++);
-               outb(TS_INDEX, 0x12);/* Timing Sequencer */
-               outb(addr_6845+1, *sp++);
-
-               outb(GN_MISCOUTW, *sp++);       /* Misc output register */
-
-               vsp->wd132col = 0;
-       }
-
-       /* restore fonts */
-
-#if !PCVT_BACKUP_FONTS
-       for(i = 0; i < totalfonts; i++)
-       {
-               if(sv_fontwd[i])
-                       vga_move_charset(i, sv_fontwd[i], 0);
-       }
-#else
-       for(i = 0; i < totalfonts; i++)
-               if(saved_charsets[i])
-                       vga_move_charset(i, 0, 0);
-#endif /* !PCVT_BACKUP_FONTS */
-
-       select_vga_charset(vsp->vga_charset);
-
-       /* disable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte);
-
-       /* disable access to WD/Paradise "control extensions" */
-
-       outb(GDC_INDEX, GDC_PR5GPLOCK);
-       outb(GDC_INDEX, 0x00);
-       outb(addr_6845, CRTC_PR10);
-       outb(addr_6845, 0x00);
-       outb(TS_INDEX, TS_UNLOCKSEQ);
-       outb(TS_DATA, 0x00);
-
-       vga_screen_on();
-
-       return(1);
-}
-
-/*---------------------------------------------------------------------------*
- *     toggle 80/132 column operation for TRIDENT 9000 based boards
- *---------------------------------------------------------------------------*/
-int
-tri9000_col(int cols)
-{
-       u_char *sp;
-       u_char byte;
-
-       vga_screen_off();
-
-       /* sync reset is necessary to preserve memory contents ... */
-
-       outb(TS_INDEX, TS_SYNCRESET);
-       outb(TS_DATA, 0x01);    /* synchronous reset */
-
-       /* disable protection of misc out and other regs */
-
-       outb(addr_6845, CRTC_MTEST);
-       byte = inb(addr_6845+1);
-       outb(addr_6845, CRTC_MTEST);
-       outb(addr_6845+1, byte & ~0x50);
-
-       /* enable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       byte = inb(addr_6845+1);
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte & 0x7f);
-
-       if(cols == SCR_COL132)          /* switch 80 -> 132 */
-       {
-               /* save state of board for 80 columns */
-
-               if(!regsaved)
-               {
-                       regsaved = 1;
-
-                       sp = savearea.tri9000;
-
-                       outb(addr_6845, 0x00);  /* Horizontal Total */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x01);  /* Horizontal Display End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x03);  /* Horizontal Blank End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x13);
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-                       *sp++ = inb(TS_DATA);
-
-                       outb(TS_INDEX, TS_HWVERS);/* Hardware Version register */
-                       outb(TS_DATA, 0x00);      /* write ANYTHING switches to OLD */
-                       outb(TS_INDEX, TS_MODEC2);
-                       *sp++ = inb(TS_DATA);
-
-                       outb(TS_INDEX, TS_HWVERS);/* Hardware Version register */
-                       inb(TS_DATA);             /* read switches to NEW */
-                       outb(TS_INDEX, TS_MODEC2);
-                       *sp++ = inb(TS_DATA);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Mode control */
-                       outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Horizontal Pixel Panning */
-                       outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       *sp++ = inb(GN_MISCOUTR);       /* Misc output register */
-               }
-
-               /* setup chipset for 132 column operation */
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, 0x9b);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, 0x83);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, 0x84);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, 0x1e);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, 0x87);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, 0x1a);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, 0x42);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, 0x01);    /* 8 dot char clock */
-
-               outb(TS_INDEX, TS_HWVERS);/* Hardware Version register */
-               outb(TS_DATA, 0x00);      /* write ANYTHING switches to OLD */
-               outb(TS_INDEX, TS_MODEC2);
-               outb(TS_DATA, 0x00);
-
-               outb(TS_INDEX, TS_HWVERS);/* Hardware Version register */
-               inb(TS_DATA);             /* read switches to NEW */
-               outb(TS_INDEX, TS_MODEC2);
-               outb(TS_DATA, 0x01);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */
-               outb(ATC_DATAW, 0x08);  /* Line graphics disable */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); /* ATC Horizontal Pixel Panning */
-               outb(ATC_DATAW, 0x00);
-
-               outb(GN_MISCOUTW, (inb(GN_MISCOUTR) | 0x0c));   /* Misc output register */
-       }
-       else    /* switch 132 -> 80 */
-       {
-               if(!regsaved)                   /* failsafe */
-               {
-                       /* disable access to first 7 CRTC registers */
-                       outb(addr_6845, CRTC_VSYNCE);
-                       outb(addr_6845+1, byte);
-
-                       outb(TS_INDEX, TS_SYNCRESET);
-                       outb(TS_DATA, 0x03);    /* clear synchronous reset */
-
-                       vga_screen_on();
-
-                       return(0);
-               }
-
-               sp = savearea.tri9000;
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, *sp++);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, *sp++);
-
-               outb(TS_INDEX, TS_HWVERS);/* Hardware Version register */
-               outb(TS_DATA, 0x00);      /* write ANYTHING switches to OLD */
-               outb(TS_INDEX, TS_MODEC2);/* Timing Sequencer */
-               outb(TS_DATA, *sp++);
-
-               outb(TS_INDEX, TS_HWVERS);/* Hardware Version register */
-               inb(TS_DATA);             /* read switches to NEW */
-               outb(TS_INDEX, TS_MODEC2);/* Timing Sequencer */
-               outb(TS_DATA, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Mode control */
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Horizontal Pixel Panning */
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               outb(GN_MISCOUTW, *sp++);       /* Misc output register */
-       }
-
-       /* disable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte);
-
-       outb(TS_INDEX, TS_SYNCRESET);
-       outb(TS_DATA, 0x03);    /* clear synchronous reset */
-
-       vga_screen_on();
-
-       return(1);
-}
-
-/*---------------------------------------------------------------------------*
- *     toggle 80/132 column operation for Video7 VGA 1024i
- *---------------------------------------------------------------------------*/
-int
-v7_1024i_col(int cols)
-{
-       u_char *sp;
-       u_char byte;
-       u_char save__byte;
-
-       vga_screen_off();
-
-       /* enable access to first 7 CRTC registers */
-
-       /* first, enable read access to vertical retrace start/end */
-       outb(addr_6845, CRTC_HBLANKE);
-       byte = inb(addr_6845+1);
-       outb(addr_6845, CRTC_HBLANKE);
-       outb(addr_6845+1, (byte | 0x80));
-
-       /* second, enable access to protected registers */
-       outb(addr_6845, CRTC_VSYNCE);
-       save__byte = byte = inb(addr_6845+1);
-       byte |= 0x20;   /* no irq 2 */
-       byte &= 0x6f;   /* wr enable, clr irq flag */
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte);
-
-       outb(TS_INDEX, TS_EXTCNTL);     /* enable extensions */
-       outb(TS_DATA, 0xea);
-
-
-       if(cols == SCR_COL132)          /* switch 80 -> 132 */
-       {
-               /* save state of board for 80 columns */
-
-               if(!regsaved)
-               {
-                       regsaved = 1;
-
-                       sp = savearea.v7_1024i;
-
-                       outb(addr_6845, 0x00);  /* Horizontal Total */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x01);  /* Horizontal Display End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x03);  /* Horizontal Blank End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x13);  /* Row Offset Register */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-                       *sp++ = inb(TS_DATA);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Mode control */
-                       outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Horizontal Pixel Panning */
-                       outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       outb(TS_INDEX, 0x83);
-                       *sp++ = inb(TS_DATA);
-
-                       outb(TS_INDEX, 0xa4);
-                       *sp++ = inb(TS_DATA);
-
-                       outb(TS_INDEX, 0xe0);
-                       *sp++ = inb(TS_DATA);
-
-                       outb(TS_INDEX, 0xe4);
-                       *sp++ = inb(TS_DATA);
-
-                       outb(TS_INDEX, 0xf8);
-                       *sp++ = inb(TS_DATA);
-
-                       outb(TS_INDEX, 0xfd);
-                       *sp++ = inb(TS_DATA);
-
-                       *sp++ = inb(GN_MISCOUTR);       /* Misc output register */
-               }
-
-               /* setup chipset for 132 column operation */
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, 0x9c);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, 0x83);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, 0x86);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, 0x9e);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, 0x89);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, 0x1c);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, 0x42);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, 0x01);    /* 8 dot char clock */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */
-               outb(ATC_DATAW, 0x08);  /* Line graphics disable */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); /* ATC Horizontal Pixel Panning */
-               outb(ATC_DATAW, 0x00);
-
-               outb(TS_INDEX, TS_SYNCRESET);
-               outb(TS_DATA, 0x01);    /* synchronous reset */
-
-               outb(TS_INDEX, 0x83);
-               outb(TS_DATA, 0xa0);
-
-               outb(TS_INDEX, 0xa4);
-               outb(TS_DATA, 0x1c);
-
-               outb(TS_INDEX, 0xe0);
-               outb(TS_DATA, 0x00);
-
-               outb(TS_INDEX, 0xe4);
-               outb(TS_DATA, 0xfe);
-
-               outb(TS_INDEX, 0xf8);
-               outb(TS_DATA, 0x1b);
-
-               outb(TS_INDEX, 0xfd);
-               outb(TS_DATA, 0x33);
-
-               byte = inb(GN_MISCOUTR);
-               byte |= 0x0c;
-               outb(GN_MISCOUTW, byte);        /* Misc output register */
-
-               outb(TS_INDEX, TS_SYNCRESET);
-               outb(TS_DATA, 0x03);    /* clear synchronous reset */
-       }
-       else    /* switch 132 -> 80 */
-       {
-               if(!regsaved)                   /* failsafe */
-               {
-                       outb(TS_INDEX, TS_EXTCNTL);     /* disable extensions */
-                       outb(TS_DATA, 0xae);
-
-                       /* disable access to first 7 CRTC registers */
-                       outb(addr_6845, CRTC_VSYNCE);
-                       outb(addr_6845+1, byte);
-                       vga_screen_on();
-                       return(0);
-               }
-
-               sp = savearea.v7_1024i;
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, *sp++);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Mode control */
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Horizontal Pixel Panning */
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               outb(TS_INDEX, TS_SYNCRESET);
-               outb(TS_DATA, 0x01);    /* synchronous reset */
-
-               outb(TS_INDEX, 0x83);
-               outb(TS_DATA, *sp++);
-
-               outb(TS_INDEX, 0xa4);
-               outb(TS_DATA, *sp++);
-
-               outb(TS_INDEX, 0xe0);
-               outb(TS_DATA, *sp++);
-
-               outb(TS_INDEX, 0xe4);
-               outb(TS_DATA, *sp++);
-
-               outb(TS_INDEX, 0xf8);
-               outb(TS_DATA, *sp++);
-
-               outb(TS_INDEX, 0xfd);
-               outb(TS_DATA, *sp++);
-
-               outb(GN_MISCOUTW, *sp++);       /* Misc output register */
-
-               outb(TS_INDEX, TS_SYNCRESET);
-               outb(TS_DATA, 0x03);    /* clear synchronous reset */
-       }
-
-       outb(TS_INDEX, TS_EXTCNTL);     /* disable extensions */
-       outb(TS_DATA, 0xae);
-
-       /* disable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, save__byte);
-
-       vga_screen_on();
-
-       return(1);
-}
-
-/*---------------------------------------------------------------------------*
- *     toggle 80/132 column operation for S3 86C928 based boards
- *---------------------------------------------------------------------------*/
-int
-s3_928_col(int cols)
-{
-       u_char *sp;
-       u_char byte;
-
-       vga_screen_off();
-
-       outb(addr_6845, 0x38);
-       outb(addr_6845+1, 0x48);        /* unlock registers */
-       outb(addr_6845, 0x39);
-       outb(addr_6845+1, 0xa0);        /* unlock registers */
-
-       /* enable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       byte = inb(addr_6845+1);
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte & 0x7f);
-
-       if(cols == SCR_COL132)          /* switch 80 -> 132 */
-       {
-               /* save state of board for 80 columns */
-
-               if(!regsaved)
-               {
-                       regsaved = 1;
-
-                       sp = savearea.s3_928;
-
-                       outb(addr_6845, 0x00);  /* Horizontal Total */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x01);  /* Horizontal Display End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x03);  /* Horizontal Blank End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x13);  /* Row Offset Register */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x34);  /* Backward Compat 3 Reg */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x3b);  /* Data Xfer Exec Position */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x42);  /* (Clock) Mode Control */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-                       *sp++ = inb(TS_DATA);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Mode control */
-                       outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Horizontal Pixel Panning */
-                       outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       *sp++ = inb(GN_MISCOUTR);       /* Misc output register */
-               }
-
-               /* setup chipset for 132 column operation */
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, 0x9a);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, 0x83);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, 0x86);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, 0x9d);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, 0x87);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, 0x1b);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, 0x42);
-
-               outb(addr_6845, 0x34);
-               outb(addr_6845+1, 0x10);/* enable data xfer pos control */
-               outb(addr_6845, 0x3b);
-               outb(addr_6845+1, 0x90);/* set data xfer pos value */
-
-               outb(addr_6845, 0x42);  /* (Clock) Mode Control */
-               outb(addr_6845+1, 0x02);/* Select 40MHz Clock */
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, 0x01);    /* 8 dot char clock */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */
-               outb(ATC_DATAW, 0x08);  /* Line graphics disable */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); /* ATC Horizontal Pixel Panning */
-               outb(ATC_DATAW, 0x00);
-
-               /* Misc output register */
-
-               outb(GN_MISCOUTW, (inb(GN_MISCOUTR) | 0x0c));
-       }
-       else    /* switch 132 -> 80 */
-       {
-               if(!regsaved)                   /* failsafe */
-               {
-                       /* disable access to first 7 CRTC registers */
-                       outb(addr_6845, CRTC_VSYNCE);
-                       outb(addr_6845+1, byte);
-
-                       outb(addr_6845, 0x38);
-                       outb(addr_6845+1, 0x00);        /* lock registers */
-                       outb(addr_6845, 0x39);
-                       outb(addr_6845+1, 0x00);        /* lock registers */
-
-                       vga_screen_on();
-                       return(0);
-               }
-
-               sp = savearea.s3_928;
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x34);
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x3b);
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x42);  /* Mode control */
-               outb(addr_6845+1, *sp++);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Mode control */
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Horizontal Pixel Panning */
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               outb(GN_MISCOUTW, *sp++);       /* Misc output register */
-       }
-
-       /* disable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte);
-
-       outb(addr_6845, 0x38);
-       outb(addr_6845+1, 0x00);        /* lock registers */
-       outb(addr_6845, 0x39);
-       outb(addr_6845+1, 0x00);        /* lock registers */
-
-       vga_screen_on();
-
-       return(1);
-}
-
-/*---------------------------------------------------------------------------*
- *     toggle 80/132 column operation for Cirrus Logic 542x based boards
- *---------------------------------------------------------------------------*/
-int
-cl_gd542x_col(int cols)
-{
-       u_char *sp;
-       u_char byte;
-
-       vga_screen_off();
-
-       /* enable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       byte = inb(addr_6845+1);
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte & 0x7f);
-
-       /* enable access to cirrus extension registers */
-       outb(TS_INDEX, 6);
-       outb(TS_DATA, 0x12);
-
-       if(cols == SCR_COL132)          /* switch 80 -> 132 */
-       {
-               /* save state of board for 80 columns */
-
-               if(!regsaved)
-               {
-                       regsaved = 1;
-
-                       sp = savearea.cirrus;
-
-                       outb(addr_6845, 0x00);  /* Horizontal Total */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x01);  /* Horizontal Display End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x03);  /* Horizontal Blank End */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-                       *sp++ = inb(addr_6845+1);
-                       outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(addr_6845, 0x13);  /* Row Offset Register */
-                       *sp++ = inb(addr_6845+1);
-
-                       outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-                       *sp++ = inb(TS_DATA);
-
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Mode control */
-                       outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       if(color)
-                               inb(GN_INPSTAT1C);
-                       else
-                               inb(GN_INPSTAT1M);
-                       /* ATC Horizontal Pixel Panning */
-                       outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-                       *sp++ = inb(ATC_DATAR);
-
-                       /* VCLK2 Numerator Register */
-                       outb(TS_INDEX, 0xd);
-                       *sp++ = inb(TS_DATA);
-
-                       /* VCLK2 Denominator and Post-Scalar Value Register */
-                       outb(TS_INDEX, 0x1d);
-                       *sp++ = inb(TS_DATA);
-
-                       /* Misc output register */
-                       *sp++ = inb(GN_MISCOUTR);
-               }
-
-               /* setup chipset for 132 column operation */
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, 0x9f);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, 0x83);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, 0x84);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, 0x82);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, 0x8a);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, 0x9e);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, 0x42);
-
-               /* set VCLK2 to 41.164 MHz ..... */
-               outb(TS_INDEX, 0xd);    /* VCLK2 Numerator Register */
-               outb(TS_DATA, 0x45);
-
-               outb(TS_INDEX, 0x1d);   /* VCLK2 Denominator and */
-               outb(TS_DATA, 0x30);   /* Post-Scalar Value Register */
-
-               /* and use it. */
-               outb(GN_MISCOUTW, (inb(GN_MISCOUTR) & ~0x0c) | (2 << 2));
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, 0x01);    /* 8 dot char clock */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */
-               outb(ATC_DATAW, 0x08);  /* Line graphics disable */
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); /* ATC Horizontal Pixel Panning */
-               outb(ATC_DATAW, 0x00);
-       }
-       else    /* switch 132 -> 80 */
-       {
-               if(!regsaved)                   /* failsafe */
-               {
-                       /* disable access to first 7 CRTC registers */
-                       outb(addr_6845, CRTC_VSYNCE);
-                       outb(addr_6845+1, byte);
-
-                       /* disable access to cirrus extension registers */
-                       outb(TS_INDEX, 6);
-                       outb(TS_DATA, 0);
-
-                       vga_screen_on();
-                       return(0);
-               }
-
-               sp = savearea.cirrus;
-
-               outb(addr_6845, 0x00);  /* Horizontal Total */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x01);  /* Horizontal Display End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x02);  /* Horizontal Blank Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x03);  /* Horizontal Blank End */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x04);  /* Horizontal Retrace Start */
-               outb(addr_6845+1, *sp++);
-               outb(addr_6845, 0x05);  /* Horizontal Retrace End */
-               outb(addr_6845+1, *sp++);
-
-               outb(addr_6845, 0x13);  /* Row Offset Register */
-               outb(addr_6845+1, *sp++);
-
-               outb(TS_INDEX, TS_MODE);/* Timing Sequencer */
-               outb(TS_DATA, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Mode control */
-               outb(ATC_INDEX, ATC_MODE | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               if(color)
-                       inb(GN_INPSTAT1C);
-               else
-                       inb(GN_INPSTAT1M);
-               /* ATC Horizontal Pixel Panning */
-               outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS);
-               outb(ATC_DATAW, *sp++);
-
-               /* VCLK2 Numerator Register */
-               outb(TS_INDEX, 0xd);
-               outb(TS_DATA, *sp++);
-
-               /* VCLK2 Denominator and Post-Scalar Value Register */
-               outb(TS_INDEX, 0x1d);
-               outb(TS_DATA, *sp++);
-
-               outb(GN_MISCOUTW, *sp++);       /* Misc output register */
-       }
-
-       /* disable access to cirrus extension registers */
-       outb(TS_INDEX, 6);
-       outb(TS_DATA, 0);
-
-       /* disable access to first 7 CRTC registers */
-
-       outb(addr_6845, CRTC_VSYNCE);
-       outb(addr_6845+1, byte);
-
-       vga_screen_on();
-
-       return(1);
-}
-
-#if PCVT_USL_VT_COMPAT
-/*---------------------------------------------------------------------------*
- *     switch screen from text mode to X-mode and vice versa
- *---------------------------------------------------------------------------*/
-void
-switch_screen(int n, int oldgrafx, int newgrafx)
-{
-
-#if PCVT_SCREENSAVER
-       static unsigned saved_scrnsv_tmo = 0;
-#endif /* PCVT_SCREENSAVER */
-
-#if !PCVT_KBD_FIFO
-       int x;
-#endif /* !PCVT_KBD_FIFO */
-
-       int cols = vsp->maxcol;         /* get current col val */
-
-       if(n < 0 || n >= totalscreens)
-               return;
-
-#if !PCVT_KBD_FIFO
-       x = spltty();                   /* protect us */
-#endif /* !PCVT_KBD_FIFO */
-
-       if(!oldgrafx && newgrafx)
-       {
-               /* switch from text to graphics */
-
-#if PCVT_SCREENSAVER
-               if((saved_scrnsv_tmo = scrnsv_timeout))
-                       pcvt_set_scrnsv_tmo(0); /* screensaver off */
-#endif /* PCVT_SCREENSAVER */
-
-               async_update(UPDATE_STOP);      /* status display off */
-       }
-
-       if(!oldgrafx)
-       {
-               /* switch from text mode */
-
-               /* video board memory -> kernel memory */
-               bcopy(vsp->Crtat, vsp->Memory,
-                     vsp->screen_rows * vsp->maxcol * CHR);
-
-               vsp->Crtat = vsp->Memory;       /* operate in memory now */
-       }
-
-       /* update global screen pointers/variables */
-       current_video_screen = n;       /* current screen no */
-
-#if !PCVT_NETBSD && !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
-       pcconsp = &pccons[n];           /* current tty */
-#elif PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200
-       pcconsp = pccons[n];            /* current tty */
-#else
-       pcconsp = pc_tty[n];            /* current tty */
-#endif
-
-       vsp = &vs[n];                   /* current video state ptr */
-
-       if(oldgrafx && !newgrafx)
-       {
-               /* switch from graphics to text mode */
-               unsigned i;
-
-               /* restore fonts */
-               for(i = 0; i < totalfonts; i++)
-                       if(saved_charsets[i])
-                               vga_move_charset(i, 0, 0);
-
-#if PCVT_SCREENSAVER
-               /* activate screen saver */
-               if(saved_scrnsv_tmo)
-                       pcvt_set_scrnsv_tmo(saved_scrnsv_tmo);
-#endif /* PCVT_SCREENSAVER */
-
-               /* re-initialize lost MDA information */
-               if(adaptor_type == MDA_ADAPTOR)
-               {
-                   /*
-                    * Due to the fact that HGC registers are write-only,
-                    * the Xserver can only make guesses about the state
-                    * the HGC adaptor has been before turning on X mode.
-                    * Thus, the display must be re-enabled now, and the
-                    * cursor shape and location restored.
-                    */
-                   outb(GN_DMCNTLM, 0x28); /* enable display, text mode */
-                   outb(addr_6845, CRTC_CURSORH); /* select high register */
-                   outb(addr_6845+1,
-                        ((vsp->Crtat + vsp->cur_offset) - Crtat) >> 8);
-                   outb(addr_6845, CRTC_CURSORL); /* select low register */
-                   outb(addr_6845+1,
-                        ((vsp->Crtat + vsp->cur_offset) - Crtat));
-
-                   outb(addr_6845, CRTC_CURSTART); /* select high register */
-                   outb(addr_6845+1, vsp->cursor_start);
-                   outb(addr_6845, CRTC_CUREND); /* select low register */
-                   outb(addr_6845+1, vsp->cursor_end);
-               }
-
-               /* make status display happy */
-               async_update(UPDATE_START);
-       }
-
-       if(!newgrafx)
-       {
-               /* to text mode */
-
-               /* kernel memory -> video board memory */
-               bcopy(vsp->Crtat, Crtat,
-                     vsp->screen_rows * vsp->maxcol * CHR);
-
-               vsp->Crtat = Crtat;             /* operate on screen now */
-
-               outb(addr_6845, CRTC_STARTADRH);
-               outb(addr_6845+1, 0);
-               outb(addr_6845, CRTC_STARTADRL);
-               outb(addr_6845+1, 0);
-       }
-
-#if !PCVT_KBD_FIFO
-       splx(x);
-#endif /* !PCVT_KBD_FIFO */
-
-       select_vga_charset(vsp->vga_charset);
-
-       if(vsp->maxcol != cols)
-               vga_col(vsp, vsp->maxcol);      /* select 80/132 columns */
-
-       outb(addr_6845, CRTC_CURSORH);  /* select high register */
-       outb(addr_6845+1, vsp->cur_offset >> 8);
-       outb(addr_6845, CRTC_CURSORL);  /* select low register */
-       outb(addr_6845+1, vsp->cur_offset);
-
-       if(vsp->cursor_on)
-       {
-               outb(addr_6845, CRTC_CURSTART); /* select high register */
-               outb(addr_6845+1, vsp->cursor_start);
-               outb(addr_6845, CRTC_CUREND);   /* select low register */
-               outb(addr_6845+1, vsp->cursor_end);
-       }
-       else
-       {
-               sw_cursor(0);
-       }
-
-       if(adaptor_type == VGA_ADAPTOR)
-       {
-               unsigned i;
-
-               /* switch VGA DAC palette entries */
-               for(i = 0; i < NVGAPEL; i++)
-                       vgapaletteio(i, &vsp->palette[i], 1);
-       }
-
-       if(!newgrafx)
-       {
-               update_led();   /* update led's */
-               update_hp(vsp); /* update fkey labels, if present */
-
-               /* if we switch to a vt with force 24 lines mode and    */
-               /* pure VT emulation and 25 rows charset, then we have  */
-               /* to clear the last line on display ...                */
-
-               if(vsp->force24 && (vsp->vt_pure_mode == M_PUREVT) &&
-                       (vgacs[vsp->vga_charset].screen_size == SIZ_25ROWS))
-               {
-                       fillw(' ', vsp->Crtat + vsp->screen_rows * vsp->maxcol,
-                               vsp->maxcol);
-               }
-       }
-}
-
-/*---------------------------------------------------------------------------*
- *     Change specified vt to VT_AUTO mode
- *     xxx Maybe this should also reset VT_GRAFX mode; since switching and
- *     graphics modes are not going to work without VT_PROCESS mode.
- *---------------------------------------------------------------------------*/
-static void
-set_auto_mode (struct video_state *vsx)
-{
-       unsigned ostatus = vsx->vt_status;
-       vsx->smode.mode = VT_AUTO;
-       vsx->proc = NULL;
-       vsx->pid = 0;
-       vsx->vt_status &= ~(VT_WAIT_REL|VT_WAIT_ACK);
-       if (ostatus & VT_WAIT_ACK) {
-#if 0
-               assert (!(ostatus&VT_WAIT_REL));
-               assert (vsp == vsx &&
-                       vt_switch_pending == current_video_screen + 1);
-               vt_switch_pending = 0;
-#else
-               if (vsp == vsx &&
-                   vt_switch_pending == current_video_screen + 1)
-                       vt_switch_pending = 0;
-#endif
-       }
-       if (ostatus&VT_WAIT_REL) {
-               int new_screen = vt_switch_pending - 1;
-#if 0
-               assert(vsp == vsx && vt_switch_pending);
-               vt_switch_pending = 0;
-               vgapage (new_screen);
-#else
-               if (vsp == vsx && vt_switch_pending) {
-                       vt_switch_pending = 0;
-                       vgapage (new_screen);
-               }
-#endif
-       }
-}
-
-/*---------------------------------------------------------------------------*
- *     Exported function; to be called when a vt is closed down.
- *
- *     Ideally, we would like to be able to recover from an X server crash;
- *     but in reality, if the server crashes hard while in control of the
- *     vga board, then you're not likely to be able to use pcvt ttys
- *     without rebooting.
- *---------------------------------------------------------------------------*/
-void
-reset_usl_modes (struct video_state *vsx)
-{
-       /* Clear graphics mode */
-       if (vsx->vt_status & VT_GRAFX) {
-           vsx->vt_status &= ~VT_GRAFX;
-           if (vsp == vsx)
-               switch_screen(current_video_screen, 1, 0);
-       }
-
-       /* Take kbd out of raw mode */
-       if (pcvt_kbd_raw && vsp == vsx) {
-#if PCVT_SCANSET > 1
-               kbd_emulate_pc(0);
-#endif /* PCVT_SCANSET > 1 */
-               pcvt_kbd_raw = 0;
-       }
-
-       /* Clear process controlled mode */
-       set_auto_mode (vsx);
-}
-
-/*---------------------------------------------------------------------------*
- *     switch to virtual screen n (0 ... PCVT_NSCREENS-1), VT_USL version
- *     (the name vgapage() stands for historical reasons)
- *---------------------------------------------------------------------------*/
-int
-vgapage(int new_screen)
-{
-       int x;
-
-       if(new_screen < 0 || new_screen >= totalscreens)
-               return EINVAL;
-
-       /* fallback to VT_AUTO if controlling processes died */
-       if(vsp->proc && vsp->proc != pfind(vsp->pid))
-               set_auto_mode(vsp);
-
-       if(vs[new_screen].proc
-          && vs[new_screen].proc != pfind(vs[new_screen].pid))
-               set_auto_mode(&vs[new_screen]);
-
-       if (!vt_switch_pending && new_screen == current_video_screen)
-               return 0;
-
-       if(vt_switch_pending && vt_switch_pending != new_screen + 1) {
-               /* Try resignaling uncooperative X-window servers */
-               if (vsp->smode.mode == VT_PROCESS) {
-                       if (vsp->vt_status & VT_WAIT_REL) {
-                               if(vsp->smode.relsig)
-                                       psignal(vsp->proc, vsp->smode.relsig);
-                       } else if (vsp->vt_status & VT_WAIT_ACK) {
-                               if(vsp->smode.acqsig)
-                                       psignal(vsp->proc, vsp->smode.acqsig);
-                       }
-               }
-               return EAGAIN;
-       }
-
-       vt_switch_pending = new_screen + 1;
-
-       if(vsp->smode.mode == VT_PROCESS)
-       {
-               /* we cannot switch immediately here */
-               vsp->vt_status |= VT_WAIT_REL;
-               if(vsp->smode.relsig)
-                       psignal(vsp->proc, vsp->smode.relsig);
-       }
-       else
-       {
-               struct video_state *old_vsp = vsp;
-
-               switch_screen(new_screen,
-                             vsp->vt_status & VT_GRAFX,
-                             vs[new_screen].vt_status & VT_GRAFX);
-
-               x = spltty();
-
-               if(old_vsp->vt_status & VT_WAIT_ACT)
-               {
-                       old_vsp->vt_status &= ~VT_WAIT_ACT;
-                       wakeup((caddr_t)&old_vsp->smode);
-               }
-
-               if(vsp->vt_status & VT_WAIT_ACT)
-               {
-                       vsp->vt_status &= ~VT_WAIT_ACT;
-                       wakeup((caddr_t)&vsp->smode);
-               }
-
-               splx(x);
-
-               if(vsp->smode.mode == VT_PROCESS)
-               {
-                       /* if _new_ vt is under process control... */
-                       vsp->vt_status |= VT_WAIT_ACK;
-                       if(vsp->smode.acqsig)
-                               psignal(vsp->proc, vsp->smode.acqsig);
-               }
-               else
-               {
-                       /* we are committed */
-                       vt_switch_pending = 0;
-
-#if PCVT_FREEBSD > 206
-                       /*
-                        * XXX: If pcvt is acting as the systems console,
-                        * avoid panics going to the debugger while we are in
-                        * process mode.
-                        */
-                       if(pcvt_is_console)
-                               cons_unavail = 0;
-#endif
-               }
-       }
-       return 0;
-}
-
-/*---------------------------------------------------------------------------*
- *     ioctl handling for VT_USL mode
- *---------------------------------------------------------------------------*/
-int
-usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
-{
-       int i, j, error, opri;
-       struct vt_mode newmode;
-
-       switch(cmd)
-       {
-
-       case VT_SETMODE:
-               newmode = *(struct vt_mode *)data;
-
-               opri = spltty();
-
-               if (newmode.mode != VT_PROCESS) {
-                       struct video_state *vsx = &vs[minor(dev)];
-                       if (vsx->smode.mode == VT_PROCESS) {
-                               if (vsx->proc != p) {
-                                       splx(opri);
-                                       return EPERM;
-                               }
-                               set_auto_mode(vsx);
-                       }
-                       splx(opri);
-                       return 0;
-               }
-
-               /*
-                * NB: XFree86-3.1.1 does the following:
-                *              VT_ACTIVATE (vtnum)
-                *              VT_WAITACTIVE (vtnum)
-                *              VT_SETMODE (VT_PROCESS)
-                * So it is possible that the screen was switched
-                * between the WAITACTIVE and the SETMODE (here).  This
-                * can actually happen quite frequently, and it was
-                * leading to dire consequences. Now it is detected by
-                * requiring that minor(dev) match current_video_screen.
-                * An alternative would be to operate on vs[minor(dev)]
-                * instead of *vsp, but that would leave the server
-                * confused, because it would believe that its vt was
-                * currently activated.
-                */
-               if (minor(dev) != current_video_screen) {
-                       splx(opri);
-                       return EPERM;
-               }
-
-               /* Check for server died */
-               if(vsp->proc && vsp->proc != pfind(vsp->pid))
-                       set_auto_mode(vsp);
-
-               /* Check for server already running */
-               if (vsp->smode.mode == VT_PROCESS && vsp->proc != p)
-               {
-                       splx(opri);
-                       return EBUSY; /* already in use on this VT */
-               }
-
-               if (!ISSIGVALID(newmode.relsig) || !ISSIGVALID(newmode.acqsig)
-                   || !ISSIGVALID(newmode.frsig))
-               {
-                       splx(opri);
-                       return EINVAL;
-               }
-
-               vsp->smode = newmode;
-               vsp->proc = p;
-               vsp->pid = p->p_pid;
-
-#if PCVT_FREEBSD > 206
-               /*
-                * XXX: If pcvt is acting as the systems console,
-                * avoid panics going to the debugger while we are in
-                * process mode.
-                */
-               if(pcvt_is_console)
-                       cons_unavail = (newmode.mode == VT_PROCESS);
-#endif
-               splx(opri);
-               return 0;
-
-       case VT_GETMODE:
-               *(struct vt_mode *)data = vsp->smode;
-               return 0;
-
-       case VT_RELDISP:
-               if (minor(dev) != current_video_screen)
-                       return EPERM;
-               if (vsp->smode.mode != VT_PROCESS)
-                       return EINVAL;
-               if (vsp->proc != p)
-                       return EPERM;
-               switch(*(int *)data) {
-               case VT_FALSE:
-                       /* process refuses to release screen; abort */
-                       if(vt_switch_pending
-                          && (vsp->vt_status & VT_WAIT_REL)) {
-                               vsp->vt_status &= ~VT_WAIT_REL;
-                               vt_switch_pending = 0;
-                               return 0;
-                       }
-                       break;
-
-               case VT_TRUE:
-                       /* process releases its VT */
-                       if(vt_switch_pending
-                          && (vsp->vt_status & VT_WAIT_REL)) {
-                               int new_screen = vt_switch_pending - 1;
-                               struct video_state *old_vsp = vsp;
-
-                               vsp->vt_status &= ~VT_WAIT_REL;
-
-                               switch_screen(new_screen,
-                                             vsp->vt_status & VT_GRAFX,
-                                             vs[new_screen].vt_status
-                                             & VT_GRAFX);
-
-                               opri = spltty();
-                               if(old_vsp->vt_status & VT_WAIT_ACT)
-                               {
-                                       old_vsp->vt_status &= ~VT_WAIT_ACT;
-                                       wakeup((caddr_t)&old_vsp->smode);
-                               }
-                               if(vsp->vt_status & VT_WAIT_ACT)
-                               {
-                                       vsp->vt_status &= ~VT_WAIT_ACT;
-                                       wakeup((caddr_t)&vsp->smode);
-                               }
-                               splx(opri);
-
-                               if(vsp->smode.mode == VT_PROCESS) {
-                                       /*
-                                        * if the new vt is also in process
-                                        * mode, we have to wait until its
-                                        * controlling process acknowledged
-                                        * the switch
-                                        */
-                                       vsp->vt_status
-                                               |= VT_WAIT_ACK;
-                                       if(vsp->smode.acqsig)
-                                               psignal(vsp->proc,
-                                                       vsp->smode.acqsig);
-                               }
-                               else
-                               {
-                                       /* we are committed */
-                                       vt_switch_pending = 0;
-#if PCVT_FREEBSD > 206
-                                       /* XXX */
-                                       if(pcvt_is_console)
-                                               cons_unavail = 0;
-#endif
-                               }
-                               return 0;
-                       }
-                       break;
-
-               case VT_ACKACQ:
-                       /* new vts controlling process acknowledged */
-                       if(vsp->vt_status & VT_WAIT_ACK) {
-                               vt_switch_pending = 0;
-                               vsp->vt_status &= ~VT_WAIT_ACK;
-#if PCVT_FREEBSD > 206
-                               /* XXX */
-                               if(pcvt_is_console)
-                                       cons_unavail = 1;
-#endif
-                               return 0;
-                       }
-                       break;
-               }
-               return EINVAL;  /* end case VT_RELDISP */
-
-
-       case VT_OPENQRY:
-               /* return free vt */
-               for(i = 0; i < PCVT_NSCREENS; i++)
-                       if(!vs[i].openf) {
-                               *(int *)data = i + 1;
-                               return 0;
-                       }
-               return EAGAIN;
-
-       case VT_GETACTIVE:
-               *(int *)data = current_video_screen + 1;
-               return 0;
-
-       case VT_ACTIVATE:
-               return vgapage(*(int *)data - 1);
-
-       case VT_WAITACTIVE:
-               /* sleep until vt switch happened */
-               i = *(int *)data - 1;
-
-               if(i != -1
-                  && (i < 0 || i >= PCVT_NSCREENS))
-                       return EINVAL;
-
-               if(i != -1 && current_video_screen == i)
-                       return 0;
-
-               if(i == -1)
-                       i = minor(dev);
-
-               {
-                       int x = spltty();
-                       error = 0;
-                       while (current_video_screen != i &&
-                              (error == 0 || error == ERESTART))
-                       {
-                               vs[i].vt_status |= VT_WAIT_ACT;
-                               error = tsleep((caddr_t)&vs[i].smode,
-                                              PCATCH, "waitvt", 0);
-                       }
-                       splx(x);
-               }
-               return error;
-
-       case KDENABIO:
-               /* grant the process IO access; only allowed if euid == 0 */
-               /* and insecure */
-       {
-
-#if PCVT_NETBSD > 9 || PCVT_FREEBSD >= 200
-               struct trapframe *fp = p->p_md.md_regs;
-#elif PCVT_NETBSD || (PCVT_FREEBSD && PCVT_FREEBSD > 102)
-               struct trapframe *fp = (struct trapframe *)p->p_regs;
-#else
-               struct syscframe *fp = (struct syscframe *)p->p_regs;
-#endif
-
-               error = suser(p->p_thread);
-               if (error != 0)
-                       return (error);
-               if (securelevel > 0)
-                       return (EPERM);
-
-#if PCVT_NETBSD || (PCVT_FREEBSD && PCVT_FREEBSD > 102)
-               fp->tf_eflags |= PSL_IOPL;
-#else
-               fp->sf_eflags |= PSL_IOPL;
-#endif
-
-               return 0;
-       }
-
-       case KDDISABIO:
-               /* abandon IO access permission */
-       {
-
-#if PCVT_NETBSD > 9 || PCVT_FREEBSD >= 200
-               struct trapframe *fp = p->p_md.md_regs;
-               fp->tf_eflags &= ~PSL_IOPL;
-#elif PCVT_NETBSD || (PCVT_FREEBSD && PCVT_FREEBSD > 102)
-               struct trapframe *fp = (struct trapframe *)p->p_regs;
-               fp->tf_eflags &= ~PSL_IOPL;
-#else
-               struct syscframe *fp = (struct syscframe *)p->p_regs;
-               fp->sf_eflags &= ~PSL_IOPL;
-#endif
-
-               return 0;
-       }
-
-       case KDSETMODE:
-       {
-               struct video_state *vsx = &vs[minor(dev)];
-               int haschanged = 0;
-
-               if(adaptor_type != VGA_ADAPTOR
-                  && adaptor_type != MDA_ADAPTOR)
-                       /* X will only run on those adaptors */
-                       return (EINVAL);
-
-               /* set text/graphics mode of current vt */
-               switch(*(int *)data)
-               {
-               case KD_TEXT:
-                       haschanged = (vsx->vt_status & VT_GRAFX) != 0;
-                       vsx->vt_status &= ~VT_GRAFX;
-                       if(haschanged && vsx == vsp)
-                               switch_screen(current_video_screen, 1, 0);
-                       return 0;
-
-               case KD_GRAPHICS:
-                       /* xxx It might be a good idea to require that
-                          the vt be in process controlled mode here,
-                          and that the calling process is the owner */
-                       haschanged = (vsx->vt_status & VT_GRAFX) == 0;
-                       vsx->vt_status |= VT_GRAFX;
-                       if(haschanged && vsx == vsp)
-                               switch_screen(current_video_screen, 0, 1);
-                       return 0;
-
-               }
-               return EINVAL;  /* end case KDSETMODE */
-       }
-
-       case KDSETRAD:
-               /* set keyboard repeat and delay */
-               return kbdioctl(dev, KBDSTPMAT, data, flag);
-
-       case KDSKBMODE:
-               switch(*(int *)data)
-               {
-               case K_RAW:
-
-#if PCVT_SCANSET > 1
-                       /* put keyboard to return ancient PC scan codes */
-                       kbd_emulate_pc(1);
-#endif /* PCVT_SCANSET > 1 */
-
-                       pcvt_kbd_raw = 1;
-                       shift_down = meta_down = altgr_down = ctrl_down = 0;
-                       return 0;
-
-               case K_XLATE:
-
-#if PCVT_SCANSET > 1
-                       kbd_emulate_pc(0);
-#endif /* PCVT_SCANSET > 1 */
-
-                       pcvt_kbd_raw = 0;
-                       return 0;
-               }
-               return EINVAL;  /* end KDSKBMODE */
-
-       case KDMKTONE:
-               /* ring the speaker */
-               if(data)
-               {
-                       int duration = *(int *)data >> 16;
-                       int pitch = *(int *)data & 0xffff;
-
-#if PCVT_NETBSD
-                       if(pitch != 0)
-                       {
-                           sysbeep(PCVT_SYSBEEPF / pitch,
-                                   duration * hz / 1000);
-                       }
-#else /* PCVT_NETBSD */
-                       sysbeep(pitch, duration * hz / 3000);
-#endif /* PCVT_NETBSD */
-
-               }
-               else
-               {
-                       sysbeep(PCVT_SYSBEEPF / 1493, hz / 4);
-               }
-               return 0;
-
-       case KDSETLED:
-               /* set kbd LED status */
-               /* unfortunately, the LED definitions between pcvt and */
-               /* USL differ some way :-( */
-               i = *(int *)data;
-               j = (i & LED_CAP? KBD_CAPSLOCK: 0)
-                       + (i & LED_NUM? KBD_NUMLOCK: 0)
-                       + (i & LED_SCR? KBD_SCROLLLOCK: 0);
-               return kbdioctl(dev, KBDSLOCK, (caddr_t)&j, flag);
-
-       case KDGETLED:
-               /* get kbd LED status */
-               if((error = kbdioctl(dev, KBDGLOCK, (caddr_t)&j, flag)))
-                       return error;
-               i = (j & KBD_CAPSLOCK? LED_CAP: 0)
-                       + (j & KBD_NUMLOCK? LED_NUM: 0)
-                       + (j & KBD_SCROLLLOCK? LED_SCR: 0);
-               *(int *)data = i;
-               return 0;
-
-       case GIO_KEYMAP:
-               get_usl_keymap((keymap_t *)data);
-               return 0;
-       }                       /* end case cmd */
-
-       return -1;              /* inappropriate usl_vt_compat ioctl */
-}
-#endif /* PCVT_USL_VT_COMPAT */
-
-#endif /* NVT > 0 */
-
-/* ------------------------- E O F ------------------------------------------*/
-
diff --git a/sys/dev/video/pcvt/i386/pcvt_hdr.h b/sys/dev/video/pcvt/i386/pcvt_hdr.h
deleted file mode 100644 (file)
index e555247..0000000
+++ /dev/null
@@ -1,1432 +0,0 @@
-/*
- * Copyright (c) 1999 Hellmuth Michaelis
- *
- * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
- *
- * Copyright (c) 1992, 1993 Brian Dunford-Shore.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by
- *     Hellmuth Michaelis, Brian Dunford-Shore and Joerg Wunsch.
- * 4. The name authors may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*---------------------------------------------------------------------------
- *
- *     pcvt_hdr.h      VT220 Driver Global Include File
- *     ------------------------------------------------
- *
- *     Last Edit-Date: [Mon Dec 27 14:06:31 1999]
- *
- * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_hdr.h,v 1.36.2.3 2001/08/06 15:30:21 joerg Exp $
- * $DragonFly: src/sys/dev/video/pcvt/i386/Attic/pcvt_hdr.h,v 1.6 2004/09/18 20:23:04 dillon Exp $
- *
- *---------------------------------------------------------------------------*/
-
-#define        PCVT_REL "3.20-b24"     /* driver attach announcement   */
-                               /* see also: pcvt_ioctl.h       */
-
-#include "opt_pcvt.h"
-#if (defined(__DragonFly__) || defined(__FreeBSD__)) && !defined(PCVT_FREEBSD)
-#  define PCVT_FREEBSD 210
-#endif
-
-#if PCVT_FREEBSD >= 200
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/signalvar.h>
-#include <sys/tty.h>
-#include <sys/uio.h>
-#include <sys/callout.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/malloc.h>
-#include <sys/time.h>
-/*
- * XXX sys/kbio.h declares a lot of junk, but we need it for NUM_KEYS which
- * is used in dev/kbd/kbdreg.h.
- */
-#include <sys/kbio.h>
-#undef KB_OTHER
-#undef S
-#undef F
-
-#if PCVT_FREEBSD > 210
-#include <sys/random.h>
-#endif /* PCVT_FREEBSD > 210 */
-#else /* ! PCVT_FREEBSD >= 200 */
-
-#include "param.h"
-#include "conf.h"
-#include "ioctl.h"
-#include "proc.h"
-#include "signalvar.h"
-#include "tty.h"
-#include "uio.h"
-#include "callout.h"
-#include "systm.h"
-#include "kernel.h"
-#include "syslog.h"
-#include "malloc.h"
-#include "time.h"
-
-#endif /* PCVT_FREEBSD >= 200 */
-
-#include "pcvt_conf.h"
-
-#include <machine/bus.h>
-
-#include <dev/misc/kbd/kbdreg.h>
-#include <dev/misc/kbd/atkbdcreg.h>
-
-#if PCVT_NETBSD > 9
-#include "device.h"
-#endif
-
-#if PCVT_NETBSD > 9
-#include "i386/isa/isavar.h"
-#include "i386/cpufunc.h"
-#elif PCVT_FREEBSD >= 200
-#include <bus/isa/i386/isa_device.h>
-#else
-#include "i386/isa/isa_device.h"
-#endif
-
-#if PCVT_FREEBSD >= 200
-#include <i386/isa/icu.h>
-#else
-#include "i386/isa/icu.h"
-#endif
-
-#if PCVT_NETBSD > 100
-#include "i386/isa/isareg.h"
-#elif PCVT_FREEBSD >= 200
-#include <bus/isa/i386/isa.h>
-#else
-#include "i386/isa/isa.h"
-#endif
-
-#if PCVT_NETBSD > 9
-#include "dev/cons.h"
-#elif PCVT_FREEBSD >= 200
-#include <sys/cons.h>
-#else
-#include "i386/i386/cons.h"
-#endif
-
-#if PCVT_NETBSD <= 9
-#if PCVT_FREEBSD >= 200
-#include <machine/psl.h>
-#include <machine/frame.h>
-#else /* ! PCVT_FREEBSD >= 200 */
-#include "machine/psl.h"
-#include "machine/frame.h"
-#endif /* PCVT_FREEBSD >= 200 */
-#endif /* PCVT_NETBSD <= 9 */
-
-#if PCVT_NETBSD > 9
-#include <i386/isa/pcvt/pcvt_ioctl.h>
-#elif PCVT_FREEBSD >= 200
-#include <machine/pcvt_ioctl.h>
-#else
-#include "machine/pcvt_ioctl.h"
-#endif
-
-#if PCVT_FREEBSD >= 200
-#include <machine/pc/display.h>
-#if PCVT_FREEBSD > 200
-#include <machine/clock.h>
-#include <machine/md_var.h>
-#endif
-/*
- * The following values are defined in machine/console.h, but the header
- * file is not included here due to conflicts with pcvt_ioctl.h.
- */
-#define KDGKBTYPE      _IOR('K', 64, int)
-#define KB_84          1
-#define KB_101         2
-#define KB_OTHER       3
-#else /* PCVT_FREEBSD >= 200 */
-#include "machine/pc/display.h"
-#endif /* PCVT_FREEBSD >= 200 */
-
-/* setup irq disable function to use */
-
-#if !(PCVT_SLOW_INTERRUPT) && (PCVT_NETBSD > 9)
-# define PCVT_DISABLE_INTR()   disable_intr()
-# define PCVT_ENABLE_INTR()    enable_intr()
-# undef PCVT_SLOW_INTERRUPT
-#else
-# define PCVT_DISABLE_INTR()   s = spltty()
-# define PCVT_ENABLE_INTR()    splx(s)
-# undef PCVT_SLOW_INTERRUPT
-# define PCVT_SLOW_INTERRUPT 1
-#endif
-
-/* perform option consistency checks */
-
-#if defined PCVT_FREEBSD && PCVT_FREEBSD == 1
-# undef PCVT_FREEBSD
-# define PCVT_FREEBSD 102      /* assume 1.0 release */
-#endif
-
-#if defined PCVT_NETBSD && PCVT_NETBSD == 1
-#undef PCVT_NETBSD
-#define PCVT_NETBSD 9          /* assume 0.9 release for now */
-#endif
-
-#if PCVT_FREEBSD + PCVT_NETBSD == 0
-# error "pcvt_hdr.h: You MUST define one of PCVT_{NET,FREE}BSD \
-in the config file"
-#elif (PCVT_FREEBSD && PCVT_NETBSD)
-# error "pcvt_hdr.h: You CAN only define *one* of PCVT_{NET,FREE}BSD \
-in the config file"
-#endif
-
-#ifdef XSERVER
-
-/* PCVT_NULLCHARS is mandatory for X server */
-#if !PCVT_NULLCHARS
-#undef PCVT_NULLCHARS
-#define PCVT_NULLCHARS 1
-#endif
-
-/* PCVT_BACKUP_FONTS is mandatory for PCVT_USL_VT_COMPAT */
-#if PCVT_USL_VT_COMPAT && !PCVT_BACKUP_FONTS
-#undef PCVT_BACKUP_FONTS
-#define PCVT_BACKUP_FONTS 1
-#endif
-
-#else /* XSERVER */
-
-#if PCVT_USL_VT_COMPAT
-#warning "Option PCVT_USL_VT_COMPAT meaningless without XSERVER"
-#undef PCVT_USL_VT_COMPAT
-#define PCVT_USL_VT_COMPAT 0
-#endif
-
-#endif /* XSERVER */
-
-/* PCVT_SCREENSAVER is mandatory for PCVT_PRETTYSCRNS */
-#if PCVT_PRETTYSCRNS && !PCVT_SCREENSAVER
-#undef PCVT_SCREENSAVER
-#define PCVT_SCREENSAVER 1
-#endif
-
-/* get the inline inb/outb back again ... */
-
-#if PCVT_NETBSD
-#if PCVT_NETBSD == 9
-#include "machine/cpufunc.h"   /* NetBSD 0.9 [...and earlier -currents] */
-#undef PCVT_USL_VT_COMPAT
-#define PCVT_USL_VT_COMPAT 0   /* does not work, workaround ... */
-#else
-#include "machine/pio.h"       /* recent NetBSD -currents */
-#define NEW_AVERUNNABLE                /* averunnable changes for younger currents */
-#endif /* PCVT_NETBSD == 9 */
-#endif /* PCVT_NETBSD */
-
-#if PCVT_FREEBSD >= 200
-#define NEW_AVERUNNABLE                /* new averunnable changes for FreeBSD 2.0 */
-#endif
-
-#if PCVT_SCANSET !=1 && PCVT_SCANSET !=2
-#error "Supported keyboard scancode sets are 1 and 2 only (for now)!!!"
-#endif
-
-/* initial default scrollback buffer size (in pages) */
-#define SCROLLBACK_PAGES       8
-
-/*---------------------------------------------------------------------------*
- *     Keyboard and Keyboard Controller
- *---------------------------------------------------------------------------*/
-
-#ifndef _DEV_KBD_KBDREG_H_
-
-#define CONTROLLER_CTRL        0x64    /* W - command, R - status      */
-#define CONTROLLER_DATA        0x60    /* R/W - data                   */
-
-/* commands to control the CONTROLLER (8042) on the mainboard */
-
-#define CONTR_READ     0x20    /* read command byte from controller */
-#define CONTR_WRITE    0x60    /* write command to controller, see below */
-#define CONTR_SELFTEST 0xaa    /* controller selftest, returns 0x55 when ok */
-#define CONTR_IFTEST   0xab    /* interface selftest */
-#define CONTR_KBDISABL 0xad    /* disable keyboard */
-#define CONTR_KBENABL  0xae    /* enable keyboard */
-
-/* command byte for writing to CONTROLLER (8042) via CONTR_WRITE */
-
-#define         COMMAND_RES7   0x80    /* bit 7, reserved, always write a ZERO ! */
-#define         COMMAND_PCSCAN 0x40    /* bit 6, 1 = convert to pc scan codes */
-#define         COMMAND_RES5   0x20    /* bit 5, perhaps (!) use 9bit frame
-                                * instead of 11 */
-#define         COMMAND_DISABL 0x10    /* bit 4, 1 = disable keyboard */
-#define         COMMAND_INHOVR 0x08    /* bit 3, 1 = override security lock inhibit */
-#define         COMMAND_SYSFLG 0x04    /* bit 2, value stored as "system flag" */
-#define         COMMAND_RES2   0x02    /* bit 1, reserved, always write a ZERO ! */
-#define         COMMAND_IRQEN  0x01    /* bit 0, 1 = enable output buffer full
-                                * interrupt */
-
-/* status from CONTROLLER (8042) on the mainboard */
-
-#define        STATUS_PARITY   0x80    /* bit 7, 1 = parity error on last byte */
-#define STATUS_RXTIMO  0x40    /* bit 6, 1 = receive timeout error occured */
-#define STATUS_TXTIMO  0x20    /* bit 5, 1 = transmit timeout error occured */
-#define STATUS_ENABLE  0x10    /* bit 4, 1 = keyboard unlocked */
-#define STATUS_WHAT    0x08    /* bit 3, 1 = wrote cmd to 0x64, 0 = wrote
-                                * data to 0x60 */
-#define STATUS_SYSFLG  0x04    /* bit 2, value stored as "system flag" */
-#define STATUS_INPBF   0x02    /* bit 1, 1 = input buffer full (to 8042) */
-#define STATUS_OUTPBF  0x01    /* bit 0, 1 = output buffer full (from 8042) */
-
-/* commands to the KEYBOARD (via the 8042 controller on mainboard..) */
-
-#define KEYB_C_RESET   0xff    /* reset keyboard to power-on status */
-#define        KEYB_C_RESEND   0xfe    /* resend last byte in case of error */
-#define KEYB_C_TYPEM   0xf3    /* set keyboard typematic rate/delay */
-#define KEYB_C_ID      0xf2    /* return keyboard id */
-#define KEYB_C_ECHO    0xee    /* diagnostic, echo 0xee */
-#define KEYB_C_LEDS    0xed    /* set/reset numlock,capslock & scroll lock */
-
-#endif /* _DEV_KBD_KBDREG_H_ */
-
-/* responses from the KEYBOARD (via the 8042 controller on mainboard..) */
-
-#define        KEYB_R_OVERRUN0 0x00    /* keyboard buffer overflow */
-#define KEYB_R_SELFOK  0xaa    /* keyboard selftest ok after KEYB_C_RESET */
-#define KEYB_R_EXT0    0xe0    /* keyboard extended scancode prefix 1 */
-#define KEYB_R_EXT1    0xe1    /* keyboard extended scancode prefix 2 */
-#define KEYB_R_ECHO    0xee    /* keyboard response to KEYB_C_ECHO */
-#define KEYB_R_BREAKPFX        0xf0    /* break code prefix for set 2 and 3 */
-#define KEYB_R_ACK     0xfa    /* acknowledge after a command has rx'd */
-#define KEYB_R_SELFBAD 0xfc    /*keyboard selftest FAILED after KEYB_C_RESET*/
-#define KEYB_R_DIAGBAD 0xfd    /* keyboard self diagnostic failure */
-#define KEYB_R_RESEND  0xfe    /* keyboard wants command resent or illegal
-                                * command rx'd */
-#define        KEYB_R_OVERRUN1 0xff    /* keyboard buffer overflow */
-
-#define KEYB_R_MF2ID1  0xab    /* MF II Keyboard id-byte #1 */
-#define KEYB_R_MF2ID2  0x41    /* MF II Keyboard id-byte #2 */
-#define KEYB_R_MF2ID2HP        0x83    /* MF II Keyboard id-byte #2 from HP keybd's */
-
-/* internal Keyboard Type */
-
-#define KB_UNKNOWN     0       /* unknown keyboard type */
-#define KB_AT          1       /* AT (84 keys) Keyboard */
-#define KB_MFII                2       /* MF II (101/102 keys) Keyboard */
-
-/*---------------------------------------------------------------------------*
- *     CMOS ram access to get the "Equipment Byte"
- *---------------------------------------------------------------------------*/
-
-#define RTC_EQUIPMENT  0x14    /* equipment byte in cmos ram   */
-#define EQ_EGAVGA      0       /* reserved (= ega/vga)         */
-#define EQ_40COLOR     1       /* display = 40 col color       */
-#define EQ_80COLOR     2       /* display = 80 col color       */
-#define EQ_80MONO      3       /* display = 80 col mono        */
-
-/*---------------------------------------------------------------------------*
- *     VT220 -> internal color conversion table fields
- *---------------------------------------------------------------------------*/
-
-#define VT_NORMAL      0x00            /* no attributes at all */
-#define VT_BOLD                0x01            /* bold attribute */
-#define VT_UNDER       0x02            /* underline attribute */
-#define VT_BLINK       0x04            /* blink attribute */
-#define VT_INVERSE     0x08            /* inverse attribute */
-
-/*---------------------------------------------------------------------------*
- *     VGA GENERAL/EXTERNAL Registers          (3BA or 3DA and 3CA, 3C2, 3CC)
- *---------------------------------------------------------------------------*/
-
-#define GN_MISCOUTR    0x3CC           /* misc output register read */
-#define GN_MISCOUTW    0x3C2           /* misc output register write */
-#define GN_INPSTAT0    0x3C2           /* input status 0, r/o */
-#define GN_INPSTAT1M   0x3BA           /* input status 1, r/o, mono */
-#define GN_INPSTAT1C   0x3DA           /* input status 1, r/o, color */
-#define GN_FEATR       0x3CA           /* feature control, read */
-#define GN_FEATWM      0x3BA           /* feature control, write, mono */
-#define GN_FEATWC      0x3DA           /* feature control, write, color */
-#define GN_VSUBSYS     0x3C3           /* video subsystem register r/w */
-#define GN_DMCNTLM     0x3B8           /* display mode control, r/w, mono */
-#define GN_DMCNTLC     0x3D8           /* display mode control, r/w, color */
-#define GN_COLORSEL    0x3D9           /* color select register, w/o */
-#define GN_HERCOMPAT   0x3BF           /* Hercules compatibility reg, w/o */
-
-/*---------------------------------------------------------------------------*
- *     VGA CRTC Registers                        (3B4 and 3B5 or 3D4 and 3D5)
- *---------------------------------------------------------------------------*/
-
-#define MONO_BASE      0x3B4           /* crtc index register address mono */
-#define CGA_BASE       0x3D4           /* crtc index register address color */
-
-#define        CRTC_ADDR       0x00            /* index register */
-
-#define CRTC_HTOTAL    0x00            /* horizontal total */
-#define CRTC_HDISPLE   0x01            /* horizontal display end */
-#define CRTC_HBLANKS   0x02            /* horizontal blank start */
-#define CRTC_HBLANKE   0x03            /* horizontal blank end */
-#define CRTC_HSYNCS    0x04            /* horizontal sync start */
-#define CRTC_HSYNCE    0x05            /* horizontal sync end */
-#define CRTC_VTOTAL    0x06            /* vertical total */
-#define CRTC_OVERFLL   0x07            /* overflow low */
-#define CRTC_IROWADDR  0x08            /* inital row address */
-#define CRTC_MAXROW    0x09            /* maximum row address */
-#define CRTC_CURSTART  0x0A            /* cursor start row address */
-#define        CURSOR_ON_BIT 0x20      /* cursor on/off on mda/cga/vga */
-#define CRTC_CUREND    0x0B            /* cursor end row address */
-#define CRTC_STARTADRH 0x0C            /* linear start address mid */
-#define CRTC_STARTADRL 0x0D            /* linear start address low */
-#define CRTC_CURSORH   0x0E            /* cursor address mid */
-#define CRTC_CURSORL   0x0F            /* cursor address low */
-#define CRTC_VSYNCS    0x10            /* vertical sync start */
-#define CRTC_VSYNCE    0x11            /* vertical sync end */
-#define CRTC_VDE       0x12            /* vertical display end */
-#define CRTC_OFFSET    0x13            /* row offset */
-#define CRTC_ULOC      0x14            /* underline row address */
-#define CRTC_VBSTART   0x15            /* vertical blank start */
-#define CRTC_VBEND     0x16            /* vertical blank end */
-#define CRTC_MODE      0x17            /* CRTC mode register */
-#define CRTC_SPLITL    0x18            /* split screen start low */
-
-/* start of ET4000 extensions */
-
-#define CRTC_RASCAS    0x32            /* ras/cas configuration */
-#define CRTC_EXTSTART  0x33            /* extended start address */
-#define CRTC_COMPAT6845        0x34            /* 6845 comatibility control */
-#define CRTC_OVFLHIGH  0x35            /* overflow high */
-#define CRTC_SYSCONF1  0x36            /* video system configuration 1 */
-#define CRTC_SYSCONF2  0x36            /* video system configuration 2 */
-
-/* start of WD/Paradise extensions */
-
-#define        CRTC_PR10       0x29            /* r/w unlocking */
-#define        CRTC_PR11       0x2A            /* ega switches */
-#define        CRTC_PR12       0x2B            /* scratch pad */
-#define        CRTC_PR13       0x2C            /* interlace h/2 start */
-#define        CRTC_PR14       0x2D            /* interlace h/2 end */
-#define        CRTC_PR15       0x2E            /* misc control #1 */
-#define        CRTC_PR16       0x2F            /* misc control #2 */
-#define        CRTC_PR17       0x30            /* misc control #3 */
-                                       /* 0x31 .. 0x3f reserved */
-/* Video 7 */
-
-#define CRTC_V7ID      0x1f            /* identification register */
-
-/* Trident */
-
-#define CRTC_MTEST     0x1e            /* module test register */
-#define CRTC_SOFTPROG  0x1f            /* software programming */
-#define CRTC_LATCHRDB  0x22            /* latch read back register */
-#define CRTC_ATTRSRDB  0x24            /* attribute state read back register*/
-#define CRTC_ATTRIRDB  0x26            /* attribute index read back register*/
-#define CRTC_HOSTAR    0x27            /* high order start address register */
-
-/*---------------------------------------------------------------------------*
- *     VGA TIMING & SEQUENCER Registers                         (3C4 and 3C5)
- *---------------------------------------------------------------------------*/
-
-#define TS_INDEX       0x3C4           /* index register */
-#define TS_DATA                0x3C5           /* data register */
-
-#define TS_SYNCRESET   0x00            /* synchronous reset */
-#define TS_MODE                0x01            /* ts mode register */
-#define TS_WRPLMASK    0x02            /* write plane mask */
-#define TS_FONTSEL     0x03            /* font select register */
-#define TS_MEMMODE     0x04            /* memory mode register */
-
-/* ET4000 only */
-
-#define TS_RESERVED    0x05            /* undef, reserved */
-#define TS_STATECNTL   0x06            /* state control register */
-#define TS_AUXMODE     0x07            /* auxiliary mode control */
-
-/* WD/Paradise only */
-
-#define TS_UNLOCKSEQ   0x06            /* PR20 - unlock sequencer register */
-#define TS_DISCFSTAT   0x07            /* PR21 - display config status */
-#define TS_MEMFIFOCTL  0x10            /* PR30 - memory i/f & fifo control */
-#define TS_SYSIFCNTL   0x11            /* PR31 - system interface control */
-#define TS_MISC4       0x12            /* PR32 - misc control #4 */
-
-/* Video 7 */
-
-#define TS_EXTCNTL     0x06            /* extensions control */
-#define TS_CLRVDISP    0x30            /* clear vertical display 0x30-0x3f */
-#define TS_V7CHIPREV   0x8e            /* chipset revision 0x8e-0x8f */
-#define TS_SWBANK      0xe8            /* single/write bank register, rev 5+*/
-#define TS_RDBANK      0xe8            /* read bank register, rev 4+ */
-#define TS_MISCCNTL    0xe8            /* misc control register, rev 4+ */
-#define TS_SWSTROBE    0xea            /* switch strobe */
-#define TS_MWRCNTL     0xf3            /* masked write control */
-#define TS_MWRMVRAM    0xf4            /* masked write mask VRAM only */
-#define TS_BANKSEL     0xf6            /* bank select */
-#define TS_SWREADB     0xf7            /* switch readback */
-#define TS_PAGESEL     0xf9            /* page select */
-#define TS_COMPAT      0xfc            /* compatibility control */
-#define TS_16BITCTL    0xff            /* 16 bit interface control */
-
-/* Trident */
-
-#define TS_HWVERS      0x0b            /* hardware version, switch old/new! */
-#define TS_CONFPORT1   0x0c            /* config port 1 and 2    - caution! */
-#define TS_MODEC2      0x0d            /* old/new mode control 2 - caution! */
-#define TS_MODEC1      0x0e            /* old/new mode control 1 - caution! */
-#define        TS_PUPM2        0x0f            /* power up mode 2 */
-
-/*---------------------------------------------------------------------------*
- *     VGA GRAPHICS DATA CONTROLLER Registers              (3CE, 3CF and 3CD)
- *---------------------------------------------------------------------------*/
-
-#define GDC_SEGSEL     0x3CD           /* segment select register */
-#define GDC_INDEX      0x3CE           /* index register */
-#define GDC_DATA       0x3CF           /* data register */
-
-#define GDC_SETRES     0x00            /* set / reset bits */
-#define GDC_ENSETRES   0x01            /* enable set / reset */
-#define GDC_COLORCOMP  0x02            /* color compare register */
-#define GDC_ROTFUNC    0x03            /* data rotate / function select */
-#define GDC_RDPLANESEL 0x04            /* read plane select */
-#define GDC_MODE       0x05            /* gdc mode register */
-#define GDC_MISC       0x06            /* gdc misc register */
-#define GDC_COLORCARE  0x07            /* color care register */
-#define GDC_BITMASK    0x08            /* bit mask register */
-
-/* WD/Paradise only */
-
-#define GDC_BANKSWA    0x09            /* PR0A - bank switch a */
-#define GDC_BANKSWB    0x0a            /* PR0B - bank switch b */
-#define GDC_MEMSIZE    0x0b            /* PR1 memory size */
-#define GDC_VIDEOSEL   0x0c            /* PR2 video configuration */
-#define GDC_CRTCNTL    0x0d            /* PR3 crt address control */
-#define GDC_VIDEOCNTL  0x0e            /* PR4 video control */
-#define GDC_PR5GPLOCK  0x0f            /* PR5 gp status and lock */
-
-/* Video 7 */
-
-#define GDC_DATALATCH  0x22            /* gdc data latch */
-
-/*---------------------------------------------------------------------------*
- *     VGA ATTRIBUTE CONTROLLER Registers                       (3C0 and 3C1)
- *---------------------------------------------------------------------------*/
-
-#define ATC_INDEX      0x3C0           /* index register  AND  */
-#define ATC_DATAW      0x3C0           /* data write      !!!  */
-#define ATC_DATAR      0x3C1           /* data read */
-
-#define ATC_ACCESS     0x20            /* access bit in ATC index register */
-
-#define ATC_PALETTE0   0x00            /* color palette register 0 */
-#define ATC_PALETTE1   0x01            /* color palette register 1 */
-#define ATC_PALETTE2   0x02            /* color palette register 2 */
-#define ATC_PALETTE3   0x03            /* color palette register 3 */
-#define ATC_PALETTE4   0x04            /* color palette register 4 */
-#define ATC_PALETTE5   0x05            /* color palette register 5 */
-#define ATC_PALETTE6   0x06            /* color palette register 6 */
-#define ATC_PALETTE7   0x07            /* color palette register 7 */
-#define ATC_PALETTE8   0x08            /* color palette register 8 */
-#define ATC_PALETTE9   0x09            /* color palette register 9 */
-#define ATC_PALETTEA   0x0A            /* color palette register 10 */
-#define ATC_PALETTEB   0x0B            /* color palette register 11 */
-#define ATC_PALETTEC   0x0C            /* color palette register 12 */
-#define ATC_PALETTED   0x0D            /* color palette register 13 */
-#define ATC_PALETTEE   0x0E            /* color palette register 14 */
-#define ATC_PALETTEF   0x0F            /* color palette register 15 */
-#define ATC_MODE       0x10            /* atc mode register */
-#define ATC_OVERSCAN   0x11            /* overscan register */
-#define ATC_COLPLEN    0x12            /* color plane enable register */
-#define ATC_HORPIXPAN  0x13            /* horizontal pixel panning */
-#define ATC_COLRESET   0x14            /* color reset */
-#define ATC_MISC       0x16            /* misc register (ET3000/ET4000) */
-
-/*---------------------------------------------------------------------------*
- *     VGA palette handling (output DAC palette)
- *---------------------------------------------------------------------------*/
-
-#define VGA_DAC                0x3C6           /* vga dac address */
-#define VGA_PMSK       0x3F            /* palette mask, 64 distinct values */
-#define NVGAPEL        256             /* number of palette entries */
-
-/*---------------------------------------------------------------------------*
- *     function key labels
- *---------------------------------------------------------------------------*/
-
-#define LABEL_LEN      9               /* length of one label */
-#define LABEL_MID      8               /* mid-part (row/col)   */
-
-#define LABEL_ROWH     ((4*LABEL_LEN)+1)
-#define LABEL_ROWL     ((4*LABEL_LEN)+2)
-#define LABEL_COLU     ((4*LABEL_LEN)+4)
-#define LABEL_COLH     ((4*LABEL_LEN)+5)
-#define LABEL_COLL     ((4*LABEL_LEN)+6)
-
-/* tab setting */
-
-#define MAXTAB 132             /* no of possible tab stops */
-
-/* escape detection state machine */
-
-#define STATE_INIT     0       /* normal       */
-#define        STATE_ESC       1       /* got ESC      */
-#define STATE_BLANK    2       /* got ESC space*/
-#define STATE_HASH     3       /* got ESC #    */
-#define STATE_BROPN    4       /* got ESC (    */
-#define STATE_BRCLO    5       /* got ESC )    */
-#define STATE_CSI      6       /* got ESC [    */
-#define STATE_CSIQM    7       /* got ESC [ ?  */
-#define STATE_AMPSND   8       /* got ESC &    */
-#define STATE_STAR     9       /* got ESC *    */
-#define STATE_PLUS     10      /* got ESC +    */
-#define STATE_DCS      11      /* got ESC P    */
-#define STATE_SCA      12      /* got ESC <Ps> " */
-#define STATE_STR      13      /* got ESC !    */
-#define STATE_MINUS    14      /* got ESC -    */
-#define STATE_DOT      15      /* got ESC .    */
-#define STATE_SLASH    16      /* got ESC /    */
-
-/* for storing escape sequence parameters */
-
-#define MAXPARMS       10      /* maximum no of parms */
-
-/* terminal responses */
-
-#define DA_VT220       "\033[?62;1;2;6;7;8;9c"
-
-/* sub-states for Device Control String processing */
-
-#define DCS_INIT       0       /* got ESC P ... */
-#define DCS_AND_UDK    1       /* got ESC P ... | */
-#define DCS_UDK_DEF    2       /* got ESC P ... | fnckey / */
-#define DCS_UDK_ESC    3       /* got ESC P ... | fnckey / ... ESC */
-#define DCS_DLD_DSCS   4       /* got ESC P ... { */
-#define DCS_DLD_DEF    5       /* got ESC P ... { dscs */
-#define DCS_DLD_ESC    6       /* got ESC P ... { dscs ... / ... ESC */
-
-/* vt220 user defined keys and vt220 downloadable charset */
-
-#define MAXUDKDEF      300     /* max 256 char + 1 '\0' + space.. */
-#define        MAXUDKEYS       18      /* plus holes .. */
-#define DSCS_LENGTH    3       /* descriptor length */
-#define MAXSIXEL       8       /* sixels forever ! */
-
-/* sub-states for HP-terminal emulator */
-
-#define SHP_INIT       0
-
-/* esc & f family */
-
-#define SHP_AND_F      1
-#define SHP_AND_Fa     2
-#define SHP_AND_Fak    3
-#define SHP_AND_Fak1   4
-#define SHP_AND_Fakd   5
-#define SHP_AND_FakdL  6
-#define SHP_AND_FakdLl 7
-#define SHP_AND_FakdLls        8
-
-/* esc & j family */
-
-#define SHP_AND_J      9
-#define SHP_AND_JL     10
-
-/* esc & every-thing-else */
-
-#define SHP_AND_ETE    11
-
-/* additionals for function key labels */
-
-#define MAX_LABEL      16
-#define MAX_STRING     80
-#define MAX_STATUS     160
-
-/* MAX values for screen sizes for possible video adaptors */
-
-#define MAXROW_MDACGA  25              /* MDA/CGA can do 25 x 80 max */
-#define MAXCOL_MDACGA  80
-
-#define MAXROW_EGA     43              /* EGA can do 43 x 80 max */
-#define MAXCOL_EGA     80
-
-#define MAXROW_VGA     50              /* VGA can do 50 x 80 max */
-#define MAXCOL_VGA     80
-#define MAXCOL_SVGA    132             /* Super VGA can do 50 x 132 max */
-
-/* switch 80/132 columns */
-
-#define SCR_COL80      80              /* in 80 col mode */
-#define SCR_COL132     132             /* in 132 col mode */
-
-#define MAXDECSCA      (((MAXCOL_SVGA * MAXROW_VGA) \
-                       / (8 * sizeof(unsigned int)) ) + 1 )
-
-/* screen memory start, monochrome */
-
-#ifndef        MONO_BUF
-# if PCVT_FREEBSD && (PCVT_FREEBSD > 102)
-#  define MONO_BUF     (KERNBASE+0xB0000)
-# else
-#  define MONO_BUF     0xfe0B0000               /* NetBSD-current: isa.h */
-# endif
-#endif
-
-/* screen memory start, color */
-
-#ifndef        CGA_BUF
-# if PCVT_FREEBSD && (PCVT_FREEBSD > 102)
-#  define CGA_BUF      (KERNBASE+0xB8000)
-# else
-#  define CGA_BUF      0xfe0B8000               /* NetBSD-current: isa.h */
-# endif
-#endif
-
-#define        CHR             2               /* bytes per word in screen mem */
-
-#define NVGAFONTS      8               /* number of vga fonts loadable */
-
-#define MAXKEYNUM      127             /* max no of keys in table */
-
-/* charset tables */
-
-#define        CSL     0x0000          /* ega/vga charset, lower half of 512 */
-#define        CSH     0x0800          /* ega/vga charset, upper half of 512 */
-#define CSSIZE 96              /* (physical) size of a character set */
-
-/* charset designations */
-
-#define D_G0           0       /* designated as G0 */
-#define D_G1           1       /* designated as G1 */
-#define D_G2           2       /* designated as G2 */
-#define D_G3           3       /* designated as G3 */
-#define D_G1_96                4       /* designated as G1 for 96-char charsets */
-#define D_G2_96                5       /* designated as G2 for 96-char charsets */
-#define D_G3_96                6       /* designated as G3 for 96-char charsets */
-
-/* which fkey-labels */
-
-#define SYS_FKL                0       /* in hp mode, sys-fkls are active */
-#define USR_FKL                1       /* in hp mode, user-fkls are active */
-
-/* arguments to async_update() */
-
-#define UPDATE_START   ((void *)0)     /* do cursor update and requeue */
-#define UPDATE_STOP    ((void *)1)     /* suspend cursor updates */
-#define UPDATE_KERN    ((void *)2)     /* do cursor updates for kernel output */
-
-/* variables */
-
-#ifdef EXTERN
-#define WAS_EXTERN
-#else
-#define EXTERN extern
-#endif
-
-EXTERN u_char  *more_chars;            /* response buffer via kbd */
-EXTERN u_char  color;                  /* color or mono display */
-
-EXTERN u_short kern_attr;              /* kernel messages char attributes */
-EXTERN u_short user_attr;              /* character attributes */
-
-#if !PCVT_EMU_MOUSE
-
-#if PCVT_NETBSD
-EXTERN struct tty *pc_tty[PCVT_NSCREENS];
-#elif !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
-EXTERN struct tty pccons[PCVT_NSCREENS];
-#else
-EXTERN struct tty *pccons[PCVT_NSCREENS];
-#endif /* PCVT_NETBSD */
-
-#else /* PCVT_EMU_MOUSE */
-
-#if PCVT_NETBSD
-EXTERN struct tty *pc_tty[PCVT_NSCREENS + 1];
-#elif !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
-EXTERN struct tty pccons[PCVT_NSCREENS + 1];
-#else
-EXTERN struct tty *pccons[PCVT_NSCREENS + 1];
-#endif
-
-#endif /* PCVT_EMU_MOUSE */
-
-struct sixels {
-       u_char lower[MAXSIXEL];         /* lower half of char */
-       u_char upper[MAXSIXEL];         /* upper half of char */
-};
-
-struct udkentry {
-       u_char  first[MAXUDKEYS];       /* index to first char */
-       u_char  length[MAXUDKEYS];      /* length of this entry */
-};
-
-/* VGA palette handling */
-struct rgb {
-       u_char  r, g, b;                /* red/green/blue, valid 0..VGA_PMSK */
-};
-
-typedef struct video_state {
-       u_short *Crtat;                 /* video page start addr */
-       u_short *Memory;                /* malloc'ed memory start address */
-       struct tty *vs_tty;             /* pointer to this screen's tty */
-       u_char  maxcol;                 /* 80 or 132 cols on screen */
-       u_char  row, col;               /* current cursor position */
-       u_short c_attr;                 /* current character attributes */
-       u_char  vtsgr;                  /* current sgr configuration */
-       u_short cur_offset;             /* current cursor position offset */
-       u_char  bell_on;                /* flag, bell enabled */
-       u_char  sevenbit;               /* flag, data path 7 bits wide */
-       u_char  dis_fnc;                /* flag, display functions enable */
-       u_char  transparent;            /* flag, mk path tmp trnsprnt for ctls*/
-       u_char  scrr_beg;               /* scrolling region, begin */
-       u_char  scrr_len;               /* scrolling region, length */
-       u_char  scrr_end;               /* scrolling region, end */
-       u_char  screen_rows;            /* screen size, length - status lines */
-       u_char  screen_rowsize;         /* screen size, length */
-       u_char  vga_charset;            /* VGA character set value */
-       u_char  lastchar;               /* flag, vt100 behaviour of last char */
-       u_char  lastrow;                /* save row, --------- " -----------  */
-       u_char  *report_chars;          /* ptr, status reports from terminal */
-       u_char  report_count;           /* count, ----------- " ------------ */
-       u_char  state;                  /* escape sequence state machine */
-       u_char  m_awm;                  /* flag, vt100 mode, auto wrap */
-       u_char  m_om;                   /* flag, vt100 mode, origin mode */
-       u_char  sc_flag;                /* flag, vt100 mode,saved parms valid */
-       u_char  sc_row;                 /* saved row */
-       u_char  sc_col;                 /* saved col */
-       u_short sc_cur_offset;          /* saved cursor addr offset */
-       u_short sc_attr;                /* saved attributes */
-       u_char  sc_vtsgr;               /* saved sgr configuration */
-       u_char  sc_awm;                 /* saved auto wrap mode */
-       u_char  sc_om;                  /* saved origin mode */
-       u_short *sc_G0;                 /* save G0 ptr */
-       u_short *sc_G1;                 /* save G1 ptr */
-       u_short *sc_G2;                 /* save G2 ptr */
-       u_short *sc_G3;                 /* save G3 ptr */
-       u_short **sc_GL;                /* save GL ptr */
-       u_short **sc_GR;                /* save GR ptr */
-       u_char  sc_sel;                 /* selective erase state */
-       u_char  ufkl[8][17];            /* user fkey-labels */
-       u_char  sfkl[8][17];            /* system fkey-labels */
-       u_char  labels_on;              /* display fkey labels etc. on/off */
-       u_char  which_fkl;              /* which fkey labels are active */
-       char    tab_stops[MAXTAB];      /* table of active tab stops */
-       u_char  parmi;                  /* parameter index */
-       u_char  parms[MAXPARMS];        /* parameter array */
-       u_char  hp_state;               /* hp escape sequence state machine */
-       u_char  attribute;              /* attribute normal, tx only, local */
-       u_char  key;                    /* fkey label no */
-       u_char  l_len;                  /* buffer length's */
-       u_char  s_len;
-       u_char  m_len;
-       u_char  i;                      /* help (got short of names ...) */
-       u_char  l_buf[MAX_LABEL+1];     /* buffers */
-       u_char  s_buf[MAX_STRING+1];
-       u_char  m_buf[MAX_STATUS+1];
-       u_char  openf;                  /* we are opened ! */
-       u_char  vt_pure_mode;           /* no fkey labels, row/col, status */
-       u_char  cursor_start;           /* Start of cursor */
-       u_char  cursor_end;             /* End of cursor */
-       u_char  cursor_on;              /* cursor switched on */
-       u_char  ckm;                    /* true = cursor key normal mode */
-       u_char  irm;                    /* true = insert mode */
-       u_char  lnm;                    /* Line Feed/New Line Mode */
-       u_char  dcs_state;              /* dcs escape sequence state machine */
-       u_char  udk_def[MAXUDKDEF];     /* new definitions for vt220 FKeys */
-       u_char  udk_defi;               /* index for FKey definitions */
-       u_char  udk_deflow;             /* low or high nibble in sequence */
-       u_char  udk_fnckey;             /* function key to assign to */
-       u_char  dld_dscs[DSCS_LENGTH];  /* designate soft character set id */
-       u_char  dld_dscsi;              /* index for dscs */
-       u_char  dld_sixel_lower;        /* upper/lower sixels of character */
-       u_char  dld_sixelli;            /* index for lower sixels */
-       u_char  dld_sixelui;            /* index for upper sixels */
-       struct sixels sixel;            /* structure for storing char sixels */
-       u_char  selchar;                /* true = selective attribute on */
-       u_int   decsca[MAXDECSCA];      /* Select Character Attrib bit array */
-       u_short **GL;                   /* ptr to current GL conversion table*/
-       u_short **GR;                   /* ptr to current GR conversion table*/
-       u_short *G0;                    /* ptr to current G0 conversion table*/
-       u_short *G1;                    /* ptr to current G1 conversion table*/
-       u_char force24;                 /* force 24 lines in DEC 25 and HP 28*/
-       u_short *G2;                    /* ptr to current G2 conversion table*/
-       u_short *G3;                    /* ptr to current G3 conversion table*/
-       u_char  dld_id[DSCS_LENGTH+1];  /* soft character set id */
-       u_char  which[DSCS_LENGTH+1];   /* which set to designate */
-       u_char  whichi;                 /* index into which ..  */
-       u_char  ss;                     /* flag, single shift G2 / G3 -> GL */
-       u_short **Gs;                   /* ptr to cur. G2/G3 conversion table*/
-       u_char  udkbuf[MAXUDKDEF];      /* buffer for user defined keys */
-       struct udkentry ukt;            /* index & length for each udk */
-       u_char  udkff;                  /* index into buffer first free entry*/
-       struct rgb palette[NVGAPEL];    /* saved VGA DAC palette */
-       u_char  wd132col;               /* we are on a wd vga and in 132 col */
-       u_char  scroll_lock;            /* scroll lock active */
-       u_char  caps_lock;              /* caps lock active */
-       u_char  shift_lock;             /* shiftlock flag (virtual ..) */
-       u_char  num_lock;               /* num lock, true = keypad num mode */
-       u_char  abs_write;              /* write outside of scroll region */
-
-       u_short *Scrollback;            /* scrollback buffer */
-       u_short scrollback_pages;       /* size of scrollback buffer */
-       u_short scr_offset;             /* current scrollback offset (lines) */
-       short scrolling;                /* current scrollback page */
-       u_short max_off;                /* maximum scrollback offset */
-       
-#if PCVT_USL_VT_COMPAT                 /* SysV compatibility :-( */
-
-       struct vt_mode smode;
-       struct proc *proc;
-       pid_t pid;
-       unsigned vt_status;
-#define        VT_WAIT_REL 1                   /* wait till process released vt */
-#define VT_WAIT_ACK 2                  /* wait till process ack vt acquire */
-#define VT_GRAFX    4                  /* vt runs graphics mode */
-#define VT_WAIT_ACT 8                  /* a process is sleeping on this vt */
-                                       /*  becoming active */
-#endif /* PCVT_USL_VT_COMPAT */
-
-} video_state;
-
-EXTERN video_state vs[PCVT_NSCREENS];  /* parameters for screens */
-
-struct vga_char_state {
-       int     loaded;         /* Whether a font is loaded here */
-       int     secondloaded;   /* an extension characterset was loaded, */
-                               /*      the number is found here         */
-       u_char  char_scanlines; /* Scanlines per character */
-       u_char  scr_scanlines;  /* Low byte of scanlines per screen */
-       int     screen_size;    /* Screen size in SIZ_YYROWS */
-};
-
-EXTERN struct vga_char_state vgacs[NVGAFONTS]; /* Character set states */
-
-#if PCVT_EMU_MOUSE
-struct mousestat {
-       struct timeval lastmove; /* last time the pointer moved */
-       u_char opened;           /* someone would like to use a mouse */
-       u_char minor;            /* minor device number */
-       u_char buttons;          /* current "buttons" pressed */
-       u_char extendedseen;     /* 0xe0 has been seen, do not use next key */
-       u_char breakseen;        /* key break has been seen for a sticky btn */
-};
-#endif /* PCVT_EMU_MOUSE */
-
-#ifdef WAS_EXTERN
-
-#if PCVT_NETBSD > 9
-
-int pcprobe ();
-void pcattach ();
-
-struct cfdriver vtcd = {
-       NULL, "vt", pcprobe, pcattach, DV_TTY, sizeof(struct device)
-};
-
-#else
-
-int pcprobe ( struct isa_device *dev );
-int pcattach ( struct isa_device *dev );
-
-struct isa_driver vtdriver = {         /* driver routines */
-       pcprobe, pcattach, "vt", 1,
-};
-
-#endif /* PCVT_NETBSD > 9 */
-
-u_char fgansitopc[] = {                        /* foreground ANSI color -> pc */
-       FG_BLACK, FG_RED, FG_GREEN, FG_BROWN, FG_BLUE,
-       FG_MAGENTA, FG_CYAN, FG_LIGHTGREY
-};
-
-u_char bgansitopc[] = {                        /* background ANSI color -> pc */
-       BG_BLACK, BG_RED, BG_GREEN, BG_BROWN, BG_BLUE,
-       BG_MAGENTA, BG_CYAN, BG_LIGHTGREY
-};
-
-#if !PCVT_NETBSD
-u_short *Crtat;                        /* screen start address */
-#if !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
-struct tty *pcconsp =  &pccons[0];             /* ptr to current device */
-#else /* PCVT_FREEBSD > 110 */
-struct tty *pcconsp;
-#endif /* !(PCVT_FREEBSD > 110) */
-#else
-struct tty *pcconsp;           /* ptr to current device, see pcattach() */
-#endif /* PCVT_NETBSD */
-
-#if PCVT_EMU_MOUSE
-struct mousestat       mouse;
-struct mousedefs       mousedef = {0x3b, 0x3c, 0x3d, 0,     250000};
-#endif /* PCVT_EMU_MOUSE */    /*  F1,   F2,   F3,   false, 0.25 sec */
-
-video_state *vsp               = &vs[0]; /* ptr to current screen parms */
-
-#if PCVT_USL_VT_COMPAT
-int    vt_switch_pending       = 0;            /* if > 0, a vt switch is */
-#endif /* PCVT_USL_VT_COMPAT */                        /* pending; contains the # */
-                                               /* of the old vt + 1 */
-
-u_int  addr_6845               = MONO_BASE;    /* crtc base addr */
-u_char do_initialization       = 1;            /* we have to init ourselves */
-u_char pcvt_is_console         = 0;            /* until we know it */
-u_char         shift_down              = 0;            /* shift key down flag */
-u_char ctrl_down               = 0;            /* ctrl key down flag */
-u_char meta_down               = 0;            /* alt key down flag */
-u_char altgr_down              = 0;            /* altgr key down flag */
-u_char kbrepflag               = 1;            /* key repeat flag */
-u_char totalscreens            = 1;            /* screens available */
-u_char current_video_screen    = 0;            /* displayed screen no */
-u_char adaptor_type            = UNKNOWN_ADAPTOR;/* adaptor type */
-u_char         vga_type                = VGA_UNKNOWN;  /* vga chipset */
-u_char can_do_132col           = 0;            /* vga chipset can 132 cols */
-u_char vga_family              = 0;            /* vga manufacturer */
-u_char totalfonts              = 0;            /* fonts available */
-u_char chargen_access          = 0;            /* synchronize access */
-u_char keyboard_type           = KB_UNKNOWN;   /* type of keyboard */
-u_char keyboard_is_initialized = 0;            /* for ddb sanity */
-u_char kbd_polling             = 0;            /* keyboard is being polled */
-#ifdef _DEV_KBD_KBDREG_H_
-u_char reset_keyboard          = 0;            /* OK to reset keyboard */
-keyboard_t *kbd                        = NULL;
-#endif /* _DEV_KBD_KBDREG_H_ */
-
-#if PCVT_SHOWKEYS
-u_char keyboard_show           = 0;            /* normal display */
-#endif /* PCVT_SHOWKEYS */
-
-u_char cursor_pos_valid        = 0;            /* sput left a valid position*/
-
-u_char critical_scroll         = 0;            /* inside scrolling up */
-int    switch_page             = -1;           /* which page to switch to */
-
-#if PCVT_SCREENSAVER
-u_char reset_screen_saver      = 1;            /* reset the saver next time */
-u_char scrnsv_active           = 0;            /* active flag */
-#endif /* PCVT_SCREENSAVER */
-
-#ifdef XSERVER
-unsigned scrnsv_timeout                = 0;            /* initially off */
-#if !PCVT_USL_VT_COMPAT
-u_char pcvt_xmode              = 0;            /* display is grafx */
-#endif /* PCVT_USL_VT_COMPAT */
-u_char pcvt_kbd_raw            = 0;            /* keyboard sends scans */
-#endif /* XSERVER */
-
-#if PCVT_BACKUP_FONTS
-u_char *saved_charsets[NVGAFONTS] = {0};       /* backup copy of fonts */
-#endif /* PCVT_BACKUP_FONTS */
-
-/*---------------------------------------------------------------------------
-
-       VT220 attributes -> internal emulator attributes conversion tables
-
-       be careful when designing color combinations, because on
-       EGA and VGA displays, bit 3 of the attribute byte is used
-       for characterset switching, and is no longer available for
-       foreground intensity (bold)!
-
----------------------------------------------------------------------------*/
-
-/* color displays */
-
-u_char sgr_tab_color[16] = {
-/*00*/  (BG_BLACK     | FG_LIGHTGREY),             /* normal               */
-/*01*/  (BG_BLUE      | FG_LIGHTGREY),             /* bold                 */
-/*02*/  (BG_BROWN     | FG_LIGHTGREY),             /* underline            */
-/*03*/  (BG_MAGENTA   | FG_LIGHTGREY),             /* bold+underline       */
-/*04*/  (BG_BLACK     | FG_LIGHTGREY | FG_BLINK),  /* blink                */
-/*05*/  (BG_BLUE      | FG_LIGHTGREY | FG_BLINK),  /* bold+blink           */
-/*06*/  (BG_BROWN     | FG_LIGHTGREY | FG_BLINK),  /* underline+blink      */
-/*07*/  (BG_MAGENTA   | FG_LIGHTGREY | FG_BLINK),  /* bold+underline+blink */
-/*08*/  (BG_LIGHTGREY | FG_BLACK),                 /* invers               */
-/*09*/  (BG_LIGHTGREY | FG_BLUE),                  /* bold+invers          */
-/*10*/  (BG_LIGHTGREY | FG_BROWN),                 /* underline+invers     */
-/*11*/  (BG_LIGHTGREY | FG_MAGENTA),               /* bold+underline+invers*/
-/*12*/  (BG_LIGHTGREY | FG_BLACK      | FG_BLINK), /* blink+invers         */
-/*13*/  (BG_LIGHTGREY | FG_BLUE       | FG_BLINK), /* bold+blink+invers    */
-/*14*/  (BG_LIGHTGREY | FG_BROWN      | FG_BLINK), /* underline+blink+invers*/
-/*15*/  (BG_LIGHTGREY | FG_MAGENTA    | FG_BLINK)  /*bold+underl+blink+invers*/
-};
-
-/* monochrome displays (VGA version, no intensity) */
-
-u_char sgr_tab_mono[16] = {
-/*00*/  (BG_BLACK     | FG_LIGHTGREY),            /* normal               */
-/*01*/  (BG_BLACK     | FG_UNDERLINE),            /* bold                 */
-/*02*/  (BG_BLACK     | FG_UNDERLINE),            /* underline            */
-/*03*/  (BG_BLACK     | FG_UNDERLINE),            /* bold+underline       */
-/*04*/  (BG_BLACK     | FG_LIGHTGREY | FG_BLINK), /* blink                */
-/*05*/  (BG_BLACK     | FG_UNDERLINE | FG_BLINK), /* bold+blink           */
-/*06*/  (BG_BLACK     | FG_UNDERLINE | FG_BLINK), /* underline+blink      */
-/*07*/  (BG_BLACK     | FG_UNDERLINE | FG_BLINK), /* bold+underline+blink */
-/*08*/  (BG_LIGHTGREY | FG_BLACK),                /* invers               */
-/*09*/  (BG_LIGHTGREY | FG_BLACK),                /* bold+invers          */
-/*10*/  (BG_LIGHTGREY | FG_BLACK),                /* underline+invers     */
-/*11*/  (BG_LIGHTGREY | FG_BLACK),                /* bold+underline+invers*/
-/*12*/  (BG_LIGHTGREY | FG_BLACK | FG_BLINK),     /* blink+invers         */
-/*13*/  (BG_LIGHTGREY | FG_BLACK | FG_BLINK),     /* bold+blink+invers    */
-/*14*/  (BG_LIGHTGREY | FG_BLACK | FG_BLINK),     /* underline+blink+invers*/
-/*15*/  (BG_LIGHTGREY | FG_BLACK | FG_BLINK)      /*bold+underl+blink+invers*/
-};
-
-/* monochrome displays (MDA version, with intensity) */
-
-u_char sgr_tab_imono[16] = {
-/*00*/  (BG_BLACK     | FG_LIGHTGREY),                /* normal               */
-/*01*/  (BG_BLACK     | FG_LIGHTGREY | FG_INTENSE),   /* bold                 */
-/*02*/  (BG_BLACK     | FG_UNDERLINE),                /* underline            */
-/*03*/  (BG_BLACK     | FG_UNDERLINE | FG_INTENSE),   /* bold+underline       */
-/*04*/  (BG_BLACK     | FG_LIGHTGREY | FG_BLINK),     /* blink                */
-/*05*/  (BG_BLACK     | FG_LIGHTGREY | FG_INTENSE | FG_BLINK), /* bold+blink  */
-/*06*/  (BG_BLACK     | FG_UNDERLINE | FG_BLINK),     /* underline+blink      */
-/*07*/  (BG_BLACK     | FG_UNDERLINE | FG_BLINK | FG_INTENSE), /* bold+underline+blink */
-/*08*/  (BG_LIGHTGREY | FG_BLACK),                    /* invers               */
-/*09*/  (BG_LIGHTGREY | FG_BLACK | FG_INTENSE),       /* bold+invers          */
-/*10*/  (BG_LIGHTGREY | FG_BLACK),                    /* underline+invers     */
-/*11*/  (BG_LIGHTGREY | FG_BLACK | FG_INTENSE),       /* bold+underline+invers*/
-/*12*/  (BG_LIGHTGREY | FG_BLACK | FG_BLINK),         /* blink+invers         */
-/*13*/  (BG_LIGHTGREY | FG_BLACK | FG_BLINK | FG_INTENSE),/* bold+blink+invers*/
-/*14*/  (BG_LIGHTGREY | FG_BLACK | FG_BLINK),         /* underline+blink+invers*/
-/*15*/  (BG_LIGHTGREY | FG_BLACK | FG_BLINK | FG_INTENSE) /* bold+underl+blink+invers */
-};
-
-#else /* WAS_EXTERN */
-
-extern u_char          vga_type;
-extern struct tty      *pcconsp;
-extern video_state     *vsp;
-extern struct cdevsw   pc_cdevsw;
-
-#if PCVT_EMU_MOUSE
-extern struct mousestat mouse;
-extern struct mousedefs mousedef;
-#endif /* PCVT_EMU_MOUSE */
-
-#if PCVT_USL_VT_COMPAT
-extern int             vt_switch_pending;
-#endif /* PCVT_USL_VT_COMPAT */
-
-extern u_int           addr_6845;
-extern u_short         *Crtat;
-extern u_char          do_initialization;
-extern u_char          pcvt_is_console;
-extern u_char          bgansitopc[];
-extern u_char          fgansitopc[];
-extern u_char          shift_down;
-extern u_char          ctrl_down;
-extern u_char          meta_down;
-extern u_char          altgr_down;
-extern u_char          kbrepflag;
-extern u_char          adaptor_type;
-extern u_char          current_video_screen;
-extern u_char          totalfonts;
-extern u_char          totalscreens;
-extern u_char          chargen_access;
-extern u_char          keyboard_type;
-extern u_char          can_do_132col;
-extern u_char          vga_family;
-extern u_char          keyboard_is_initialized;
-extern u_char          kbd_polling;
-#ifdef _DEV_KBD_KBDREG_H_
-extern u_char          reset_keyboard;
-extern keyboard_t      *kbd;
-#endif /* _DEV_KBD_KBDREG_H_ */
-
-#if PCVT_SHOWKEYS
-extern u_char          keyboard_show;
-#endif /* PCVT_SHOWKEYS */
-
-extern u_char  cursor_pos_valid;
-
-extern u_char  critical_scroll;
-extern int     switch_page;
-
-#if PCVT_SCREENSAVER
-extern u_char  reset_screen_saver;
-extern u_char  scrnsv_active;
-#endif /* PCVT_SCREENSAVER */
-
-extern u_char          sgr_tab_color[];
-extern u_char          sgr_tab_mono[];
-extern u_char          sgr_tab_imono[];
-
-#ifdef XSERVER
-extern unsigned                scrnsv_timeout;
-extern u_char          pcvt_xmode;
-extern u_char          pcvt_kbd_raw;
-#endif /* XSERVER */
-
-#if PCVT_BACKUP_FONTS
-extern u_char          *saved_charsets[NVGAFONTS];
-#endif /* PCVT_BACKUP_FONTS */
-
-#endif /* WAS_EXTERN */
-
-/*
- * FreeBSD > 1.0.2 cleaned up the kernel definitions (with the aim of
- * getting ANSI-clean). Since there has been a mixed usage of types like
- * "dev_t" (actually some short) in prototyped and non-prototyped fasion,
- * each of those types is declared as "int" within function prototypes
- * (which is what the compiler would actually promote it to).
- *
- * The macros below are used to clarify which type a parameter ought to
- * be, regardless of its actual promotion to "int".
- */
-
-#define Dev_t  int
-#define U_short        int
-#define U_char int
-
-/*
- * In FreeBSD >= 2.0, dev_t has type `unsigned long', so promoting it
- * doesn't cause any problems in prototypes.
- */
-
-#if PCVT_FREEBSD >= 200
-#undef Dev_t
-#define Dev_t  dev_t
-#endif
-
-#if !PCVT_FREEBSD || (PCVT_FREEBSD < 210)
-extern void bcopyb(void *from, void *to, u_int length);
-#endif
-
-#if !PCVT_FREEBSD || (PCVT_FREEBSD < 200)
-extern void fillw(U_short value, void *addr, u_int length);
-#endif
-
-int    pcparam ( struct tty *tp, struct termios *t );
-
-/*
- * In FreeBSD > 2.0.6, driver console functions are declared in machine/cons.h
- * and some return void, so don't declare them here.
- */
-#if PCVT_FREEBSD <= 205
-int    pccnprobe ( struct consdev *cp );
-int    pccninit ( struct consdev *cp );
-int    pccngetc ( Dev_t dev );
-int    pccncheckc ( Dev_t dev );
-int    pccnputc ( Dev_t dev, U_char c );
-#endif
-
-ointhand2_t    pcrint;
-void   pcstart ( struct tty *tp );
-void   pcstop ( struct tty *tp, int flag );
-
-# if PCVT_FREEBSD < 200
-void   consinit ( void );
-# endif
-
-#if PCVT_USL_VT_COMPAT
-void   switch_screen ( int n, int oldgrafx, int newgrafx );
-int    usl_vt_ioctl (Dev_t dev, int cmd, caddr_t data, int flag,
-                     struct proc *);
-int    vt_activate ( int newscreen );
-int    vgapage ( int n );
-void   get_usl_keymap( keymap_t *map );
-void   reset_usl_modes (struct video_state *vsx);
-#else
-void   vgapage ( int n );
-#endif /* PCVT_USL_VT_COMPAT */
-
-#if PCVT_EMU_MOUSE
-int    mouse_ioctl ( Dev_t dev, int cmd, caddr_t data );
-#endif /*  PCVT_EMU_MOUSE */
-
-#if PCVT_SCREENSAVER
-void   pcvt_scrnsv_reset ( void );
-#endif /* PCVT_SCREENSAVER */
-
-#if PCVT_SCREENSAVER && defined(XSERVER)
-void   pcvt_set_scrnsv_tmo ( int );
-#endif /* PCVT_SCREENSAVER && defined(XSERVER) */
-
-void   vga_move_charset ( unsigned n, unsigned char *b, int save_it);
-
-void   async_update ( void *arg );
-void   clr_parms ( struct video_state *svsp );
-void   cons_highlight ( void );
-void   cons_normal ( void );
-void   dprintf ( unsigned flgs, const char *fmt, ... );
-int    egavga_test ( void );
-void   fkl_off ( struct video_state *svsp );
-void   fkl_on ( struct video_state *svsp );
-struct tty *get_pccons ( Dev_t dev );
-void   init_sfkl ( struct video_state *svsp );
-void   init_ufkl ( struct video_state *svsp );
-#ifndef _DEV_KBD_KBDREG_H_
-int    kbd_cmd ( int val );
-int    kbd_response ( void );
-#endif /* _DEV_KBD_KBDREG_H_ */
-void   kbd_code_init ( void );
-void   kbd_code_init1 ( void );
-
-#if PCVT_SCANSET > 1
-void   kbd_emulate_pc(int do_emulation);
-#endif
-
-void   pcvt_support_init(void);
-int    kbdioctl ( Dev_t dev, int cmd, caddr_t data, int flag );
-void   loadchar ( int fontset, int character, int char_scanlines,
-                  u_char *char_table );
-void   mda2egaorvga ( void );
-void   roll_up ( struct video_state *svsp, int n );
-void   select_vga_charset ( int vga_charset );
-void   set_2ndcharset ( void );
-void   set_charset ( struct video_state *svsp, int curvgacs );
-void   set_emulation_mode ( struct video_state *svsp, int mode );
-void   set_screen_size ( struct video_state *svsp, int size );
-void   reallocate_scrollbuffer ( struct video_state *svsp, int pages );
-u_char *sgetc ( int noblock );
-void   sixel_vga ( struct sixels *charsixel, u_char *charvga );
-void   sput ( u_char *s, U_char attrib, int len, int page );
-void   sw_cursor ( int onoff );
-void   sw_sfkl ( struct video_state *svsp );
-void   sw_ufkl ( struct video_state *svsp );
-void   swritefkl ( int num, u_char *string, struct video_state *svsp );
-void   toggl_awm ( struct video_state *svsp );
-void   toggl_bell ( struct video_state *svsp );
-void   toggl_columns ( struct video_state *svsp );
-void   toggl_dspf ( struct video_state *svsp );
-void   toggl_sevenbit ( struct video_state *svsp );
-void   update_hp ( struct video_state *svsp );
-void   update_led ( void );
-void   vga10_vga10 ( u_char *invga, u_char *outvga );
-void   vga10_vga14 ( u_char *invga, u_char *outvga );
-void   vga10_vga16 ( u_char *invga, u_char *outvga );
-void   vga10_vga8 ( u_char *invga, u_char *outvga );
-u_char vga_chipset ( void );
-int    vga_col ( struct video_state *svsp, int cols );
-void   vga_screen_off ( void );
-void   vga_screen_on ( void );
-char   *vga_string ( int number );
-int    vga_test ( void );
-int    vgaioctl ( Dev_t dev, int cmd, caddr_t data, int flag );
-void   vgapaletteio ( unsigned idx, struct rgb *val, int writeit );
-void   vt_aln ( struct video_state *svsp );
-void   vt_clearudk ( struct video_state *svsp );
-void   vt_clreol ( struct video_state *svsp );
-void   vt_clreos ( struct video_state *svsp );
-void   vt_clrtab ( struct video_state *svsp );
-int    vt_col ( struct video_state *svsp, int cols );
-void   vt_coldmalloc ( void );
-void   vt_cub ( struct video_state *svsp );
-void   vt_cud ( struct video_state *svsp );
-void   vt_cuf ( struct video_state *svsp );
-void   vt_curadr ( struct video_state *svsp );
-void   vt_cuu ( struct video_state *svsp );
-void   vt_da ( struct video_state *svsp&