Substantially cleanup of the pcvt kernel part. This cleanup does

not introduce (hopefully) any functional changes but gets rid of
the #ifdef spaghetti pcvt suffered from more and more over the
years.

Several no more used parts of the source were removed, others
which are used by default are now non-optional components:

PCVT_NETBSD		removed completety
PCVT_FREEBSD		removed option, code is now standard
PCVT_KBD_FIFO		removed option, code is now standard
PCVT_EMU_MOUSE		removed completety
PCVT_SW0CNOUTP		removed completety
PCVT_PORTIO_DELAY	obsolete, removed
PCVT_KEYBDID		removed option, code is now standard
PCVT_SIGWINCH		removed option, code is now standard
PCVT_PALFLICKER		removed completety
PCVT_WAITRETRACE	removed completety
PCVT_NOFASTSCROLL	removed option, code is now standard
PCVT_USL_VT_COMPAT	removed the "old" non-vt Xserver code completely,
			depending on XSERVER, this code is now standard.

Pcvt userland cleanup will follow as well as newbusifying the
kernel part.
This commit is contained in:
hm 2000-03-26 09:17:14 +00:00
parent ec41ca2c28
commit f8b6d8c603
10 changed files with 411 additions and 3005 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Hellmuth Michaelis
* Copyright (c) 1999, 2000 Hellmuth Michaelis
*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
*
@ -39,122 +39,20 @@
* pcvt_conf.h VT220 driver global configuration file
* ------------------------------------------------------
*
* Last Edit-Date: [Mon Dec 27 14:09:58 1999]
* Last Edit-Date: [Sun Mar 26 10:38:19 2000]
*
* $FreeBSD$
*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
*
* 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 */
/* system. */
#if !defined PCVT_VT220KEYB /* ---------- DEFAULT: OFF ------------ */
# define PCVT_VT220KEYB 0 /* this compiles a more vt220-like */
@ -190,24 +88,6 @@
/* 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) */
@ -227,14 +107,6 @@
/* 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, */
@ -242,13 +114,6 @@
# 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 ------------------------------ */
/* -------------------------------------------------------------------- */
@ -274,20 +139,6 @@
# 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: */
@ -295,37 +146,12 @@
/* 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
#endif /* out nulls. */
#ifndef PCVT_UPDATEFAST /* this is the rate at which the cursor */
# define PCVT_UPDATEFAST (hz/10) /* gets updated with its new position */
@ -365,36 +191,6 @@
/* 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 */
@ -414,23 +210,6 @@
/* 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 */
@ -438,20 +217,6 @@
# 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

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Hellmuth Michaelis
* Copyright (c) 1999, 2000 Hellmuth Michaelis
*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
*
@ -42,7 +42,7 @@
* pcvt_ext.c VT220 Driver Extended Support Routines
* ------------------------------------------------------
*
* Last Edit-Date: [Mon Dec 27 14:05:16 1999]
* Last Edit-Date: [Sun Mar 26 10:38:27 2000]
*
* $FreeBSD$
*
@ -1002,11 +1002,6 @@ et4000_col(int cols)
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;
@ -1039,30 +1034,6 @@ wd90c11_col(int cols)
/* 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 */
@ -1184,17 +1155,9 @@ wd90c11_col(int cols)
/* 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);
@ -2092,31 +2055,22 @@ cl_gd542x_col(int cols)
return(1);
}
#if PCVT_USL_VT_COMPAT
#ifdef XSERVER
/*---------------------------------------------------------------------------*
* 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 */
@ -2143,13 +2097,7 @@ switch_screen(int n, int oldgrafx, int newgrafx)
/* 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 */
@ -2213,10 +2161,6 @@ switch_screen(int n, int oldgrafx, int newgrafx)
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)
@ -2418,7 +2362,6 @@ vgapage(int new_screen)
/* 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
@ -2426,7 +2369,6 @@ vgapage(int new_screen)
*/
if(pcvt_is_console)
cons_unavail = 0;
#endif
}
}
return 0;
@ -2436,7 +2378,7 @@ vgapage(int new_screen)
* ioctl handling for VT_USL mode
*---------------------------------------------------------------------------*/
int
usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
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;
@ -2504,7 +2446,6 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
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
@ -2512,7 +2453,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
*/
if(pcvt_is_console)
cons_unavail = (newmode.mode == VT_PROCESS);
#endif
splx(opri);
return 0;
@ -2582,11 +2523,10 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
{
/* we are committed */
vt_switch_pending = 0;
#if PCVT_FREEBSD > 206
/* XXX */
if(pcvt_is_console)
cons_unavail = 0;
#endif
}
return 0;
}
@ -2597,11 +2537,11 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
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;
@ -2657,14 +2597,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
/* 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);
if (error != 0)
@ -2672,11 +2605,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
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;
}
@ -2684,18 +2613,8 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
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;
}
@ -2769,16 +2688,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
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
{
@ -2813,7 +2723,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
return -1; /* inappropriate usl_vt_compat ioctl */
}
#endif /* PCVT_USL_VT_COMPAT */
#endif /* XSERVER */
#endif /* NVT > 0 */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Hellmuth Michaelis
* Copyright (c) 1999, 2000 Hellmuth Michaelis
*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
*
@ -39,7 +39,7 @@
* pcvt_hdr.h VT220 Driver Global Include File
* ------------------------------------------------
*
* Last Edit-Date: [Mon Dec 27 14:06:31 1999]
* Last Edit-Date: [Sun Mar 26 10:50:27 2000]
*
* $FreeBSD$
*
@ -49,11 +49,6 @@
/* see also: pcvt_ioctl.h */
#include "opt_pcvt.h"
#if defined(__FreeBSD__) && !defined(PCVT_FREEBSD)
# define PCVT_FREEBSD 210
#endif
#if PCVT_FREEBSD >= 200
#include <sys/param.h>
#include <sys/systm.h>
@ -67,93 +62,37 @@
#include <sys/syslog.h>
#include <sys/malloc.h>
#include <sys/time.h>
#if PCVT_FREEBSD > 210
#include <sys/cons.h>
#include <machine/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 <i386/isa/pcvt/pcvt_conf.h>
#include <machine/bus.h>
#include <machine/psl.h>
#include <machine/frame.h>
#include <machine/pcvt_ioctl.h>
#include <machine/pc/display.h>
#include <machine/clock.h>
#include <machine/md_var.h>
#include <machine/stdarg.h>
#include <dev/kbd/kbdreg.h>
#include <dev/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 <i386/isa/pcvt/pcvt_conf.h>
#include <i386/isa/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 <i386/isa/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
/*===========================================================================*
* definitions
*===========================================================================*/
#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 */
#define PCVT_KBD_FIFO_SZ 256 /* keyboard fifo size */
#define PCVT_PCBURST 256 /* # of burst out chars */
#define SCROLLBACK_PAGES 8 /* scrollback buffer pages */
#define SCROLLBACK_COOKIE 31337 /* scrollback buffer pages */
#define PCVT_NONRESP_KEYB_TRY 25 /* no of times to try to detect */
/* a nonresponding keyboard */
#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.
@ -162,13 +101,10 @@
#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)
#if !(PCVT_SLOW_INTERRUPT)
# define PCVT_DISABLE_INTR() disable_intr()
# define PCVT_ENABLE_INTR() enable_intr()
# undef PCVT_SLOW_INTERRUPT
@ -179,134 +115,30 @@
# 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
* keyboard
*---------------------------------------------------------------------------*/
#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 */
@ -679,21 +511,13 @@ in the config file"
/* 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
#define MONO_BUF (KERNBASE+0xB0000)
#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
#define CGA_BUF (KERNBASE+0xB8000)
#endif
#define CHR 2 /* bytes per word in screen mem */
@ -729,41 +553,18 @@ in the config file"
#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
/*===========================================================================*
* variables
*===========================================================================*/
EXTERN u_char *more_chars; /* response buffer via kbd */
EXTERN u_char color; /* color or mono display */
u_char *more_chars; /* response buffer via kbd */
u_char color; /* color or mono display */
EXTERN u_short kern_attr; /* kernel messages char attributes */
EXTERN u_short user_attr; /* character attributes */
u_short kern_attr; /* kernel messages char attributes */
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 tty pccons[PCVT_NSCREENS];
struct sixels {
u_char lower[MAXSIXEL]; /* lower half of char */
@ -887,9 +688,7 @@ typedef struct video_state {
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 :-( */
#ifdef XSERVER
struct vt_mode smode;
struct proc *proc;
pid_t pid;
@ -899,55 +698,25 @@ typedef struct video_state {
#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 */
#endif /* XSERVER */
} video_state;
EXTERN video_state vs[PCVT_NSCREENS]; /* parameters for screens */
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 */
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 */
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 */
u_short *Crtat; /* screen start address */
#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 */
#ifdef MAIN
u_char fgansitopc[] = { /* foreground ANSI color -> pc */
FG_BLACK, FG_RED, FG_GREEN, FG_BROWN, FG_BLUE,
@ -959,27 +728,12 @@ u_char bgansitopc[] = { /* background ANSI color -> pc */
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 */
struct tty *pcconsp = &pccons[0]; /* ptr to current device */
video_state *vsp = &vs[0]; /* ptr to current screen parms */
#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
#ifdef XSERVER
int vt_switch_pending = 0; /* if > 0, a vt switch is */
#endif /* PCVT_USL_VT_COMPAT */ /* pending; contains the # */
#endif /* XSERVER */ /* pending; contains the # */
/* of the old vt + 1 */
u_int addr_6845 = MONO_BASE; /* crtc base addr */
@ -1001,10 +755,8 @@ 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 */
@ -1022,15 +774,10 @@ u_char scrnsv_active = 0; /* active flag */
#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 */
/*---------------------------------------------------------------------------
@ -1106,23 +853,25 @@ u_char sgr_tab_imono[16] = {
/*15*/ (BG_LIGHTGREY | FG_BLACK | FG_BLINK | FG_INTENSE) /* bold+underl+blink+invers */
};
#else /* WAS_EXTERN */
u_char pcvt_kbd_fifo[PCVT_KBD_FIFO_SZ];
int pcvt_kbd_rptr = 0;
int pcvt_kbd_count= 0;
#else /* ! MAIN */
extern u_char pcvt_kbd_fifo[];
extern int pcvt_kbd_rptr;
extern int pcvt_kbd_count;
extern u_char vga_type;
extern struct tty *pcconsp;
extern video_state *vsp;
#if PCVT_EMU_MOUSE
extern struct mousestat mouse;
extern struct mousedefs mousedef;
#endif /* PCVT_EMU_MOUSE */
#if PCVT_USL_VT_COMPAT
#ifdef XSERVER
extern int vt_switch_pending;
#endif /* PCVT_USL_VT_COMPAT */
#endif /* XSERVER */
extern u_int addr_6845;
extern u_short *Crtat;
extern u_char do_initialization;
extern u_char pcvt_is_console;
extern u_char bgansitopc[];
@ -1142,23 +891,21 @@ 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 cursor_pos_valid;
extern u_char critical_scroll;
extern int switch_page;
extern u_char critical_scroll;
extern int switch_page;
#if PCVT_SCREENSAVER
extern u_char reset_screen_saver;
extern u_char scrnsv_active;
extern u_char reset_screen_saver;
extern u_char scrnsv_active;
#endif /* PCVT_SCREENSAVER */
extern u_char sgr_tab_color[];
@ -1171,92 +918,13 @@ 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 */
#endif /* MAIN */
/*
* 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);
/*===========================================================================*
* forward declarations
*===========================================================================*/
void async_update ( void *arg );
void clr_parms ( struct video_state *svsp );
@ -1266,13 +934,14 @@ 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 );
#ifdef XSERVER
void get_usl_keymap( keymap_t *map );
#endif
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_ */
int kbdioctl ( dev_t dev, int cmd, caddr_t data, int flag );
void kbd_code_init ( void );
void kbd_code_init1 ( void );
@ -1280,24 +949,42 @@ void kbd_code_init1 ( void );
void kbd_emulate_pc(int do_emulation);
#endif
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 loadchar ( int fontset, int character, int char_scanlines, u_char *char_table );
void mda2egaorvga ( void );
ointhand2_t pcrint;
#if PCVT_SCREENSAVER
void pcvt_scrnsv_reset ( void );
#ifdef XSERVER
void pcvt_set_scrnsv_tmo ( int );
#endif
#endif
void reallocate_scrollbuffer ( struct video_state *svsp, int pages );
#ifdef XSERVER
void reset_usl_modes (struct video_state *vsx);
#endif
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 );
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 sput ( u_char *s, int attrib, int len, int page );
#ifdef XSERVER
void switch_screen ( int n, int oldgrafx, int newgrafx );
#endif
void swritefkl ( int num, u_char *string, struct video_state *svsp );
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_24l ( 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 );
@ -1305,18 +992,36 @@ 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 );
#ifdef XSERVER
int usl_vt_ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *);
#endif
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 );
int vgaioctl ( dev_t dev, int cmd, caddr_t data, int flag );
#ifdef XSERVER
int vgapage ( int n );
#else
void vgapage ( int n );
#endif
void vgapaletteio ( unsigned idx, struct rgb *val, int writeit );
char *vga_string ( int number );
u_char vga_chipset ( void );
int vga_col ( struct video_state *svsp, int cols );
void vga_move_charset ( unsigned n, unsigned char *b, int save_it);
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 );
#ifdef XSERVER
int vt_activate ( int newscreen );
#endif
void vt_aln ( struct video_state *svsp );
void vt_clearudk ( struct video_state *svsp );
void vt_clreol ( struct video_state *svsp );
@ -1331,7 +1036,7 @@ void vt_curadr ( struct video_state *svsp );
void vt_cuu ( struct video_state *svsp );
void vt_da ( struct video_state *svsp );
void vt_dch ( struct video_state *svsp );
void vt_dcsentry ( U_char ch, struct video_state *svsp );
void vt_dcsentry ( int ch, struct video_state *svsp );
void vt_designate ( struct video_state *svsp);
void vt_dl ( struct video_state *svsp );
void vt_dld ( struct video_state *svsp );
@ -1364,18 +1069,18 @@ void vt_str ( struct video_state *svsp );
void vt_su ( struct video_state *svsp );
void vt_tst ( struct video_state *svsp );
void vt_udk ( struct video_state *svsp );
void toggl_24l ( struct video_state *svsp );
#ifdef PCVT_INCLUDE_VT_SELATTR
/*---------------------------------------------------------------------------*
* set selective attribute if appropriate
*---------------------------------------------------------------------------*/
#define INT_BITS (sizeof(unsigned int) * 8)
#define INT_INDEX(n) ((n) / INT_BITS)
#define BIT_INDEX(n) ((n) % INT_BITS)
/*---------------------------------------------------------------------------*
* set selective attribute if appropriate
*---------------------------------------------------------------------------*/
static __inline void vt_selattr(struct video_state *svsp)
static __inline void
vt_selattr(struct video_state *svsp)
{
int i;
@ -1389,32 +1094,4 @@ static __inline void vt_selattr(struct video_state *svsp)
#endif /* PCVT_INCLUDE_VT_SELATTR */
/*---------------------------------------------------------------------------*
* produce 7 us delay accessing the keyboard controller
*---------------------------------------------------------------------------*/
#if PCVT_PORTIO_DELAY
/* use multiple dummy accesses to port */
/* 0x84 to produce keyboard controller */
/* access delays */
#define PCVT_KBD_DELAY() \
{ (void)inb(0x84); } \
{ (void)inb(0x84); } \
{ (void)inb(0x84); } \
{ (void)inb(0x84); } \
{ (void)inb(0x84); } \
{ (void)inb(0x84); }
#else /* PCVT_PORTIO_DELAY */
/* use system supplied delay function for */
/* producing delays for accesssing the */
/* keyboard controller */
#if PCVT_NETBSD > 9
#define PCVT_KBD_DELAY() delay(7)
#elif PCVT_FREEBSD || (PCVT_NETBSD <= 9)
#define PCVT_KBD_DELAY() DELAY(7)
#endif
#endif /* PCVT_PORTIO_DELAY */
/*---------------------------------- E O F ----------------------------------*/

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Hellmuth Michaelis
* Copyright (c) 1999, 2000 Hellmuth Michaelis
*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
*
@ -45,7 +45,7 @@
* pcvt_kbd.h VT220 Driver Keyboard Interface Header
* ------------------------------------------------------
*
* Last Edit-Date: [Tue Dec 28 08:13:32 1999]
* Last Edit-Date: [Sun Mar 26 10:38:38 2000]
*
* $FreeBSD$
*
@ -58,9 +58,6 @@
typedef struct
{
u_char subtype; /* subtype, string or function */
#ifdef PCVT_ALT_ENH
u_short str_leng; /* if string, stringlength */
#endif
union what
{
u_char *string; /* ptr to string, null terminated */
@ -78,12 +75,6 @@ typedef struct
entry unshift; /* normal default codes/funcs */
entry shift; /* shifted default codes/funcs */
entry ctrl; /* control default codes/funcs */
#ifdef PCVT_ALT_ENH
entry alt; /* normal default codes/funcs */
entry alt_shift; /* shifted default codes/funcs */
entry alt_ctrl; /* control default codes/funcs */
entry alt_ctrl_shift; /* normal default codes/funcs */
#endif
} Keycap_def;
#define IDX0 0 /* default indexvalue into ovl table */
@ -193,166 +184,6 @@ static u_char extscantokey[] = {
static Keycap_def key2ascii[] =
{
#ifdef PCVT_ALT_ENH
#define C (u_char *)
#define U (u_short)
#define V (void *)
#define S STR
#define F FNC
#define I IDX0
#define DFAULT {S, 0, C ""}
/* DONT EVER OVERLOAD KEY 0, THIS IS A KEY THAT MUSTN'T EXIST */
/* type index unshift shift ctrl alt alt_shift alt_ctrl alt_ctrl_shift */
/* -------------------------------------------------------------------------------------------------------------------------------------------------- */
/* 0*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 1*/ KBD_ASCII, I, {S,1,C "`"}, {S,1,C "~"}, {S,1,C "`"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 2*/ KBD_ASCII, I, {S,1,C "1"}, {S,1,C "!"}, {S,1,C "1"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 3*/ KBD_ASCII, I, {S,1,C "2"}, {S,1,C "@"}, {S,1,C "\000"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 4*/ KBD_ASCII, I, {S,1,C "3"}, {S,1,C "#"}, {S,1,C "3"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 5*/ KBD_ASCII, I, {S,1,C "4"}, {S,1,C "$"}, {S,1,C "4"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 6*/ KBD_ASCII, I, {S,1,C "5"}, {S,1,C "%"}, {S,1,C "5"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 7*/ KBD_ASCII, I, {S,1,C "6"}, {S,1,C "^"}, {S,1,C "\036"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 8*/ KBD_ASCII, I, {S,1,C "7"}, {S,1,C "&"}, {S,1,C "7"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 9*/ KBD_ASCII, I, {S,1,C "8"}, {S,1,C "*"}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 10*/ KBD_ASCII, I, {S,1,C "9"}, {S,1,C "("}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 11*/ KBD_ASCII, I, {S,1,C "0"}, {S,1,C ")"}, {S,1,C "0"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 12*/ KBD_ASCII, I, {S,1,C "-"}, {S,1,C "_"}, {S,1,C "\037"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 13*/ KBD_ASCII, I, {S,1,C "="}, {S,1,C "+"}, {S,1,C "="}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 14*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 15*/ KBD_ASCII, I, {S,1,C "\177"}, {S,1,C "\010"}, {S,1,C "\177"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 16*/ KBD_ASCII, I, {S,1,C "\t"}, {S,1,C "\t"}, {S,1,C "\t"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 17*/ KBD_ASCII, I, {S,1,C "q"}, {S,1,C "Q"}, {S,1,C "\021"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 18*/ KBD_ASCII, I, {S,1,C "w"}, {S,1,C "W"}, {S,1,C "\027"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 19*/ KBD_ASCII, I, {S,1,C "e"}, {S,1,C "E"}, {S,1,C "\005"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 20*/ KBD_ASCII, I, {S,1,C "r"}, {S,1,C "R"}, {S,1,C "\022"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 21*/ KBD_ASCII, I, {S,1,C "t"}, {S,1,C "T"}, {S,1,C "\024"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 22*/ KBD_ASCII, I, {S,1,C "y"}, {S,1,C "Y"}, {S,1,C "\031"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 23*/ KBD_ASCII, I, {S,1,C "u"}, {S,1,C "U"}, {S,1,C "\025"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 24*/ KBD_ASCII, I, {S,1,C "i"}, {S,1,C "I"}, {S,1,C "\011"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 25*/ KBD_ASCII, I, {S,1,C "o"}, {S,1,C "O"}, {S,1,C "\017"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 26*/ KBD_ASCII, I, {S,1,C "p"}, {S,1,C "P"}, {S,1,C "\020"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 27*/ KBD_ASCII, I, {S,1,C "["}, {S,1,C "{"}, {S,1,C "\033"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 28*/ KBD_ASCII, I, {S,1,C "]"}, {S,1,C "}"}, {S,1,C "\035"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 29*/ KBD_ASCII, I, {S,1,C "\\"}, {S,1,C "|"}, {S,1,C "\034"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 30*/ KBD_CAPS, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 31*/ KBD_ASCII, I, {S,1,C "a"}, {S,1,C "A"}, {S,1,C "\001"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 32*/ KBD_ASCII, I, {S,1,C "s"}, {S,1,C "S"}, {S,1,C "\023"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 33*/ KBD_ASCII, I, {S,1,C "d"}, {S,1,C "D"}, {S,1,C "\004"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 34*/ KBD_ASCII, I, {S,1,C "f"}, {S,1,C "F"}, {S,1,C "\006"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 35*/ KBD_ASCII, I, {S,1,C "g"}, {S,1,C "G"}, {S,1,C "\007"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 36*/ KBD_ASCII, I, {S,1,C "h"}, {S,1,C "H"}, {S,1,C "\010"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 37*/ KBD_ASCII, I, {S,1,C "j"}, {S,1,C "J"}, {S,1,C "\n"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 38*/ KBD_ASCII, I, {S,1,C "k"}, {S,1,C "K"}, {S,1,C "\013"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 39*/ KBD_ASCII, I, {S,1,C "l"}, {S,1,C "L"}, {S,1,C "\014"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 40*/ KBD_ASCII, I, {S,1,C ";"}, {S,1,C ":"}, {S,1,C ";"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 41*/ KBD_ASCII, I, {S,1,C "'"}, {S,1,C "\""}, {S,1,C "'"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 42*/ KBD_ASCII, I, {S,1,C "\\"}, {S,1,C "|"}, {S,1,C "\034"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 43*/ KBD_RETURN,I, {S,1,C "\r"}, {S,1,C "\r"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 44*/ KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 45*/ KBD_ASCII, I, {S,1,C "<"}, {S,1,C ">"}, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 46*/ KBD_ASCII, I, {S,1,C "z"}, {S,1,C "Z"}, {S,1,C "\032"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 47*/ KBD_ASCII, I, {S,1,C "x"}, {S,1,C "X"}, {S,1,C "\030"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 48*/ KBD_ASCII, I, {S,1,C "c"}, {S,1,C "C"}, {S,1,C "\003"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 49*/ KBD_ASCII, I, {S,1,C "v"}, {S,1,C "V"}, {S,1,C "\026"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 50*/ KBD_ASCII, I, {S,1,C "b"}, {S,1,C "B"}, {S,1,C "\002"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 51*/ KBD_ASCII, I, {S,1,C "n"}, {S,1,C "N"}, {S,1,C "\016"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 52*/ KBD_ASCII, I, {S,1,C "m"}, {S,1,C "M"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 53*/ KBD_ASCII, I, {S,1,C ","}, {S,1,C "<"}, {S,1,C ","}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 54*/ KBD_ASCII, I, {S,1,C "."}, {S,1,C ">"}, {S,1,C "."}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 55*/ KBD_ASCII, I, {S,1,C "/"}, {S,1,C "?"}, {S,1,C "/"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 56*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 57*/ KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 58*/ KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 59*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 60*/ KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
#if !PCVT_NULLCHARS
/* 61*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
#else
/* 61*/ KBD_ASCII, I, DFAULT, DFAULT, {S,1,C "\000"}, DFAULT, DFAULT, DFAULT, DFAULT,
#endif /* PCVT_NULLCHARS */
/* 62*/ KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 63*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 64*/ KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 65*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 66*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 67*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 68*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 69*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 70*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 71*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 72*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 73*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 74*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 75*/ KBD_FUNC, I, {S,4,C "\033[2~"}, {S,4,C "\033[2~"}, {S,4,C "\033[2~"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 76*/ KBD_FUNC, I, {S,4,C "\033[3~"}, {S,4,C "\033[3~"}, {S,4,C "\033[3~"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 77*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 78*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 79*/ KBD_CURSOR,I, {S,4,C "\033[D"}, {S,4,C "\033OD"}, {S,4,C "\033[D"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 80*/ KBD_FUNC, I, {S,4,C "\033[1~"}, {S,4,C "\033[1~"}, {S,4,C "\033[1~"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 81*/ KBD_FUNC, I, {S,4,C "\033[4~"}, {S,4,C "\033[4~"}, {S,4,C "\033[4~"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 82*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 83*/ KBD_CURSOR,I, {S,4,C "\033[A"}, {S,4,C "\033OA"}, {S,4,C "\033[A"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 84*/ KBD_CURSOR,I, {S,4,C "\033[B"}, {S,4,C "\033OB"}, {S,4,C "\033[B"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 85*/ KBD_FUNC, I, {S,4,C "\033[5~"}, {S,4,C "\033[5~"}, {S,4,C "\033[5~"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 86*/ KBD_FUNC, I, {S,4,C "\033[6~"}, {S,4,C "\033[6~"}, {S,4,C "\033[6~"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 87*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 88*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 89*/ KBD_CURSOR,I, {S,3,C "\033[C"}, {S,3,C "\033OC"}, {S,3,C "\033[C"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 90*/ KBD_NUM, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 91*/ KBD_KP, I, {S,1,C "7"}, {S,2,C "\033Ow"}, {S,1,C "7"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 92*/ KBD_KP, I, {S,1,C "4"}, {S,2,C "\033Ot"}, {S,1,C "4"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 93*/ KBD_KP, I, {S,1,C "1"}, {S,2,C "\033Oq"}, {S,1,C "1"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 94*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/* 95*/ KBD_KP, I, {S,1,C "/"}, {S,1,C "/"}, {S,1,C "/"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 96*/ KBD_KP, I, {S,1,C "8"}, {S,2,C "\033Ox"}, {S,1,C "8"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 97*/ KBD_KP, I, {S,1,C "5"}, {S,2,C "\033Ou"}, {S,1,C "5"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 98*/ KBD_KP, I, {S,1,C "2"}, {S,2,C "\033Or"}, {S,1,C "2"}, DFAULT, DFAULT, DFAULT, DFAULT,
/* 99*/ KBD_KP, I, {S,1,C "0"}, {S,2,C "\033Op"}, {S,1,C "0"}, DFAULT, DFAULT, DFAULT, DFAULT,
/*100*/ KBD_KP, I, {S,1,C "*"}, {S,1,C "*"}, {S,1,C "*"}, DFAULT, DFAULT, DFAULT, DFAULT,
/*101*/ KBD_KP, I, {S,1,C "9"}, {S,2,C "\033Oy"}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT,
/*102*/ KBD_KP, I, {S,1,C "6"}, {S,2,C "\033Ov"}, {S,1,C "6"}, DFAULT, DFAULT, DFAULT, DFAULT,
/*103*/ KBD_KP, I, {S,1,C "3"}, {S,2,C "\033Os"}, {S,1,C "3"}, DFAULT, DFAULT, DFAULT, DFAULT,
/*104*/ KBD_KP, I, {S,1,C "."}, {S,2,C "\033On"}, {S,1,C "."}, DFAULT, DFAULT, DFAULT, DFAULT,
/*105*/ KBD_KP, I, {S,1,C "-"}, {S,2,C "\033Om"}, {S,1,C "-"}, DFAULT, DFAULT, DFAULT, DFAULT,
/*106*/ KBD_KP, I, {S,1,C "+"}, {S,1,C "+"}, {S,1,C "+"}, DFAULT, DFAULT, DFAULT, DFAULT,
/*107*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/*108*/ KBD_RETURN,I, {S,1,C "\r"}, {S,2,C "\033OM"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT,
/*109*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/*110*/ KBD_ASCII, I, {S,1,C "\033"}, {S,2,C "\033"}, {S,1,C "\033"}, DFAULT, DFAULT, DFAULT, DFAULT,
/*111*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/*112*/ KBD_FUNC, I, {F,0,V fkey1}, {F,0,V sfkey1}, {F,0,V cfkey1}, DFAULT, DFAULT, DFAULT, DFAULT,
/*113*/ KBD_FUNC, I, {F,0,V fkey2}, {F,0,V sfkey2}, {F,0,V cfkey2}, DFAULT, DFAULT, DFAULT, DFAULT,
/*114*/ KBD_FUNC, I, {F,0,V fkey3}, {F,0,V sfkey3}, {F,0,V cfkey3}, DFAULT, DFAULT, DFAULT, DFAULT,
/*115*/ KBD_FUNC, I, {F,0,V fkey4}, {F,0,V sfkey4}, {F,0,V cfkey4}, DFAULT, DFAULT, DFAULT, DFAULT,
/*116*/ KBD_FUNC, I, {F,0,V fkey5}, {F,0,V sfkey5}, {F,0,V cfkey5}, DFAULT, DFAULT, DFAULT, DFAULT,
/*117*/ KBD_FUNC, I, {F,0,V fkey6}, {F,0,V sfkey6}, {F,0,V cfkey6}, DFAULT, DFAULT, DFAULT, DFAULT,
/*118*/ KBD_FUNC, I, {F,0,V fkey7}, {F,0,V sfkey7}, {F,0,V cfkey7}, DFAULT, DFAULT, DFAULT, DFAULT,
/*119*/ KBD_FUNC, I, {F,0,V fkey8}, {F,0,V sfkey8}, {F,0,V cfkey8}, DFAULT, DFAULT, DFAULT, DFAULT,
/*120*/ KBD_FUNC, I, {F,0,V fkey9}, {F,0,V sfkey9}, {F,0,V cfkey9}, DFAULT, DFAULT, DFAULT, DFAULT,
/*121*/ KBD_FUNC, I, {F,0,V fkey10}, {F,0,V sfkey10}, {F,0,V cfkey10}, DFAULT, DFAULT, DFAULT, DFAULT,
/*122*/ KBD_FUNC, I, {F,0,V fkey11}, {F,0,V sfkey11}, {F,0,V cfkey11}, DFAULT, DFAULT, DFAULT, DFAULT,
/*123*/ KBD_FUNC, I, {F,0,V fkey12}, {F,0,V sfkey12}, {F,0,V cfkey12}, DFAULT, DFAULT, DFAULT, DFAULT,
/*124*/ KBD_KP, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/*125*/ KBD_SCROLL,I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/*126*/ KBD_BREAK, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
/*127*/ KBD_FUNC, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
#undef C
#undef U
#undef V
#undef S
#undef F
#undef I
#undef DFLT
};
#else /* PCVT_ALT_ENH */
/* define some shorthands to make the table (almost) fit into 80 columns */
#define C (u_char *)
#define V (void *)
@ -504,13 +335,11 @@ static Keycap_def key2ascii[] =
#undef I
};
#endif /* PCVT_ALT_ENH */
static short keypad2num[] = {
7, 4, 1, -1, -1, 8, 5, 2, 0, -1, 9, 6, 3, -1, -1, -1, -1
};
#if PCVT_USL_VT_COMPAT
#ifdef XSERVER
#define N_KEYNUMS 128
@ -563,5 +392,5 @@ static u_char iso2ibm437[] =
0x6f, 0x97, 0xa3, 0x96, 0x81, 0x98, 0, 0
};
#endif /* PCVT_USL_VT_COMPAT */
#endif /* XSERVER */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Hellmuth Michaelis
* Copyright (c) 1999, 2000 Hellmuth Michaelis
*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
*
@ -42,7 +42,7 @@
* pcvt_out.c VT220 Terminal Emulator
* ---------------------------------------
*
* Last Edit-Date: [Mon Dec 27 14:07:39 1999]
* Last Edit-Date: [Sun Mar 26 10:43:40 2000]
*
* $FreeBSD$
*
@ -63,11 +63,10 @@ extern u_short csd_supplemental[];
static void write_char (struct video_state *svsp, int attrib, int ch);
static void check_scroll ( struct video_state *svsp );
static void hp_entry ( U_char ch, struct video_state *svsp );
static void hp_entry ( int ch, struct video_state *svsp );
static void vt_coldinit ( void );
static void wrfkl ( int num, u_char *string, struct video_state *svsp );
static void writefkl ( int num, u_char *string, struct video_state *svsp );
static int check_scrollback ( struct video_state *svsp );
/*---------------------------------------------------------------------------*
@ -133,7 +132,7 @@ u_short attrib, ch; /* XXX inefficient interface */
* emulator main entry
*---------------------------------------------------------------------------*/
void
sput (u_char *s, U_char kernel, int len, int page)
sput (u_char *s, int kernel, int len, int page)
{
register struct video_state *svsp;
u_short attrib;
@ -1196,13 +1195,13 @@ vt_coldinit(void)
filllen);
}
#if PCVT_USL_VT_COMPAT
#ifdef XSERVER
svsp->smode.mode = VT_AUTO;
svsp->smode.relsig = svsp->smode.acqsig =
svsp->smode.frsig = 0;
svsp->proc = 0;
svsp->pid = svsp->vt_status = 0;
#endif /* PCVT_USL_VT_COMPAT */
#endif /* XSERVER */
}
@ -1372,6 +1371,9 @@ check_scroll(struct video_state *svsp)
}
}
/*---------------------------------------------------------------------------*
*
*---------------------------------------------------------------------------*/
static int
check_scrollback(struct video_state *svsp)
{
@ -1583,11 +1585,8 @@ set_emulation_mode(struct video_state *svsp, int mode)
svsp->scrr_end = svsp->scrr_len - 1;
}
#if PCVT_SIGWINCH
if (svsp->vs_tty && svsp->vs_tty->t_pgrp)
pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
#endif /* PCVT_SIGWINCH */
}
/*---------------------------------------------------------------------------*
@ -1871,10 +1870,8 @@ vt_col(struct video_state *svsp, int cols)
(cols == SCR_COL80)? 720: 1056;
svsp->vs_tty->t_winsize.ws_ypixel = 400;
#if PCVT_SIGWINCH
if(svsp->vs_tty->t_pgrp)
pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
#endif /* PCVT_SIGWINCH */
}
reallocate_scrollbuffer(svsp, svsp->scrollback_pages);
@ -1950,7 +1947,7 @@ clr_parms(struct video_state *svsp)
*---------------------------------------------------------------------------*/
static void
hp_entry(U_char ch, struct video_state *svsp)
hp_entry(int ch, struct video_state *svsp)
{
switch(svsp->hp_state)
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Hellmuth Michaelis
* Copyright (c) 1999, 2000 Hellmuth Michaelis
*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
*
@ -44,7 +44,7 @@
* pcvt_sup.c VT220 Driver Support Routines
* ---------------------------------------------
*
* Last Edit-Date: [Thu Dec 30 17:01:03 1999]
* Last Edit-Date: [Sun Mar 26 10:38:45 2000]
*
* $FreeBSD$
*
@ -61,13 +61,13 @@ static void vid_cursor ( struct cursorshape *data );
static void vgasetfontattr ( struct vgafontattr *data );
static void vgagetfontattr ( struct vgafontattr *data );
static void vgaloadchar ( struct vgaloadchar *data );
static void vid_getscreen ( struct screeninfo *data, Dev_t dev );
static void vid_setscreen ( struct screeninfo *data, Dev_t dev );
static void vid_getscreen ( struct screeninfo *data, dev_t dev );
static void vid_setscreen ( struct screeninfo *data, dev_t dev );
static void setchargen ( void );
static void setchargen3 ( void );
static void resetchargen ( void );
static void vgareadpel ( struct vgapel *data, Dev_t dev );
static void vgawritepel ( struct vgapel *data, Dev_t dev );
static void vgareadpel ( struct vgapel *data, dev_t dev );
static void vgawritepel ( struct vgapel *data, dev_t dev );
static void vgapcvtid ( struct pcvtid *data );
static void vgapcvtinfo ( struct pcvtinfo *data );
@ -105,7 +105,7 @@ static u_short getrand ( void );
* execute vga ioctls
*---------------------------------------------------------------------------*/
int
vgaioctl(Dev_t dev, int cmd, caddr_t data, int flag)
vgaioctl(dev_t dev, int cmd, caddr_t data, int flag)
{
if(minor(dev) >= PCVT_NSCREENS)
return -1;
@ -117,15 +117,10 @@ vgaioctl(Dev_t dev, int cmd, caddr_t data, int flag)
*/
#ifdef XSERVER
#if PCVT_USL_VT_COMPAT
#define is_dev_grafx vs[minor(dev)].vt_status & VT_GRAFX
#define is_current_grafx vsp->vt_status & VT_GRAFX
#else /* old X interface */
#define is_dev_grafx pcvt_xmode
#define is_current_grafx pcvt_xmode
#endif /* PCVT_USL_VT_COMPAT */
#else /* !XSERVER */
#define is_dev_grafx 0 /* not applicable */
#define is_dev_grafx 0
#define is_current_grafx 0
#endif /* XSERVER */
@ -166,13 +161,6 @@ vgaioctl(Dev_t dev, int cmd, caddr_t data, int flag)
break;
case VGASETSCREEN:
#if defined XSERVER && !PCVT_USL_VT_COMPAT
/* avoid screen switch if using old X mode */
if(is_dev_grafx)
return EAGAIN;
#endif /* XSERVER && !PCVT_USL_VT_COMPAT */
#if PCVT_SCREENSAVER
pcvt_scrnsv_reset();
#endif /* PCVT_SCREENSAVER */
@ -267,34 +255,16 @@ vgapcvtid(struct pcvtid *data)
static void
vgapcvtinfo(struct pcvtinfo *data)
{
#if PCVT_NETBSD
data->opsys = CONF_NETBSD;
data->opsysrel = PCVT_NETBSD;
#elif PCVT_FREEBSD
data->opsys = CONF_FREEBSD;
data->opsysrel = PCVT_FREEBSD;
#else
data->opsys = CONF_UNKNOWNOPSYS;
data->opsysrel = 0;
#endif
data->opsysrel = __FreeBSD__;
data->nscreens = PCVT_NSCREENS;
data->scanset = PCVT_SCANSET;
data->updatefast= PCVT_UPDATEFAST;
data->updateslow= PCVT_UPDATESLOW;
data->sysbeepf = PCVT_SYSBEEPF;
#if PCVT_NETBSD || PCVT_FREEBSD >= 200
data->pcburst = PCVT_PCBURST;
#else
data->pcburst = 1;
#endif
#if PCVT_KBD_FIFO
data->kbd_fifo_sz = PCVT_KBD_FIFO_SZ;
#else
data->kbd_fifo_sz = 0;
#endif
data->compile_opts = (0
@ -316,60 +286,27 @@ vgapcvtinfo(struct pcvtinfo *data)
#if PCVT_24LINESDEF
| CONF_24LINESDEF
#endif
#if PCVT_EMU_MOUSE
| CONF_EMU_MOUSE
#endif
#if PCVT_SHOWKEYS
| CONF_SHOWKEYS
#endif
#if PCVT_KEYBDID
| CONF_KEYBDID
#endif
#if PCVT_SIGWINCH
| CONF_SIGWINCH
#endif
#if PCVT_NULLCHARS
| CONF_NULLCHARS
#endif
#if PCVT_BACKUP_FONTS
| CONF_BACKUP_FONTS
#endif
#if PCVT_SW0CNOUTP /* was FORCE8BIT */
| CONF_SW0CNOUTP
#endif
#if PCVT_SETCOLOR
| CONF_SETCOLOR
#endif
#if PCVT_132GENERIC
| CONF_132GENERIC
#endif
#if PCVT_PALFLICKER
| CONF_PALFLICKER
#endif
#if PCVT_WAITRETRACE
| CONF_WAITRETRACE
#endif
#ifdef XSERVER
| CONF_XSERVER
#endif
#if PCVT_USL_VT_COMPAT
| CONF_USL_VT_COMPAT
#endif
#if PCVT_PORTIO_DELAY
| CONF_PORTIO_DELAY
#endif
#if PCVT_INHIBIT_NUMLOCK
| CONF_INHIBIT_NUMLOCK
#endif
#if PCVT_META_ESC
| CONF_META_ESC
#endif
#if PCVT_KBD_FIFO
| CONF_KBD_FIFO
#endif
#if PCVT_NOFASTSCROLL
| CONF_NOFASTSCROLL
#endif
#if PCVT_SLOW_INTERRUPT
| CONF_SLOW_INTERRUPT
#endif
@ -553,11 +490,11 @@ vgasetfontattr(struct vgafontattr *data)
set_charset(&(vs[i]),vga_character_set);
}
#if !PCVT_USL_VT_COMPAT
vgapage(current_video_screen);
#ifdef XSERVER
switch_screen(current_video_screen, 0, 0);
#else
switch_screen(current_video_screen, 0, 0);
#endif /* !PCVT_USL_VT_COMPAT */
vgapage(current_video_screen);
#endif /* XSERVER */
}
@ -618,7 +555,7 @@ vgaloadchar(struct vgaloadchar *data)
* video ioctl - get screen information
*---------------------------------------------------------------------------*/
static void
vid_getscreen(struct screeninfo *data, Dev_t dev)
vid_getscreen(struct screeninfo *data, dev_t dev)
{
int device = minor(dev);
data->adaptor_type = adaptor_type; /* video adapter installed */
@ -641,7 +578,7 @@ vid_getscreen(struct screeninfo *data, Dev_t dev)
* video ioctl - set screen information
*---------------------------------------------------------------------------*/
static void
vid_setscreen(struct screeninfo *data, Dev_t dev)
vid_setscreen(struct screeninfo *data, dev_t dev)
{
int screen;
@ -658,7 +595,7 @@ vid_setscreen(struct screeninfo *data, Dev_t dev)
vgapage(screen);
#if defined XSERVER && PCVT_USL_VT_COMPAT
#ifdef XSERVER
{
int x = spltty(), waitfor = screen + 1;
/* if the vt is yet to be released by a process, wait here */
@ -670,7 +607,7 @@ vid_setscreen(struct screeninfo *data, Dev_t dev)
/* make sure the switch really happened */
if(screen != current_video_screen)
return; /* XXX should say "EAGAIN" here */
#endif /* defined XSERVER && PCVT_USL_VT_COMPAT */
#endif /* XSERVER */
if((data->screen_size != -1) || (data->force_24lines != -1))
{
@ -768,10 +705,8 @@ set_screen_size(struct video_state *svsp, int size)
svsp->scrr_len = svsp->screen_rows;
svsp->scrr_end = svsp->scrr_len - 1;
#if PCVT_SIGWINCH
if (svsp->vs_tty && svsp->vs_tty->t_pgrp)
pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
#endif /* PCVT_SIGWINCH */
reallocate_scrollbuffer(svsp, svsp->scrollback_pages);
break;
@ -834,7 +769,7 @@ reallocate_scrollbuffer(struct video_state *svsp, int pages)
* VGA ioctl - read DAC palette entry
*---------------------------------------------------------------------------*/
static void
vgareadpel(struct vgapel *data, Dev_t dev)
vgareadpel(struct vgapel *data, dev_t dev)
{
register unsigned vpage = minor(dev);
register unsigned idx = data->idx;
@ -852,7 +787,7 @@ vgareadpel(struct vgapel *data, Dev_t dev)
* VGA ioctl - write DAC palette entry
*---------------------------------------------------------------------------*/
static void
vgawritepel(struct vgapel *data, Dev_t dev)
vgawritepel(struct vgapel *data, dev_t dev)
{
register unsigned vpage = minor(dev);
register unsigned idx = data->idx;
@ -876,60 +811,20 @@ vgawritepel(struct vgapel *data, Dev_t dev)
void
vgapaletteio(unsigned idx, struct rgb *val, int writeit)
{
#if PCVT_PALFLICKER
vga_screen_off();
#endif /* PCVT_PALFLICKER */
if(writeit)
{
outb(VGA_DAC + 2, idx);
#if PCVT_WAITRETRACE
wait_retrace();
#endif /* PCVT_WAITRETRACE */
outb(VGA_DAC + 3, val->r & VGA_PMSK);
#if PCVT_WAITRETRACE
wait_retrace();
#endif /* PCVT_WAITRETRACE */
outb(VGA_DAC + 3, val->g & VGA_PMSK);
#if PCVT_WAITRETRACE
wait_retrace();
#endif /* PCVT_WAITRETRACE */
outb(VGA_DAC + 3, val->b & VGA_PMSK);
}
else /* read it */
{
outb(VGA_DAC + 1, idx);
#if PCVT_WAITRETRACE
wait_retrace();
#endif /* PCVT_WAITRETRACE */
val->r = inb(VGA_DAC + 3) & VGA_PMSK;
#if PCVT_WAITRETRACE
wait_retrace();
#endif /* PCVT_WAITRETRACE */
val->g = inb(VGA_DAC + 3) & VGA_PMSK;
#if PCVT_WAITRETRACE
wait_retrace();
#endif /* PCVT_WAITRETRACE */
val->b = inb(VGA_DAC + 3) & VGA_PMSK;
}
#if PCVT_PALFLICKER
vga_screen_on();
#endif /* PCVT_PALFLICKER */
}
/*---------------------------------------------------------------------------*
@ -960,13 +855,7 @@ async_update(void *arg)
/* first check if update is possible */
if(chargen_access /* does no-one load characters? */
#ifdef XSERVER /* is vt0 not in graphics mode? */
#if !PCVT_USL_VT_COMPAT
|| pcvt_xmode /* XXX necessary ????? */
#endif /* PCVT_USL_VT_COMPAT */
#endif /* XSERVER */
)
if(chargen_access) /* does no-one load characters? */
{
goto async_update_exit; /* do not update anything */
}
@ -1033,13 +922,8 @@ async_update(void *arg)
/* display load averages in last line (taken from tty.c) */
i = 18;
#ifdef NEW_AVERUNNABLE
tmp = (averunnable.ldavg[0] * 100 + FSCALE / 2)
>> FSHIFT;
#else
tmp = (averunnable[0] * 100 + FSCALE / 2) >> FSHIFT;
#endif
buffer[i++] =
((((tmp/100)/10) == 0) ?
' ' :
@ -1049,12 +933,8 @@ async_update(void *arg)
buffer[i++] = ((tmp%100)/10) + '0';
buffer[i++] = ((tmp%100)%10) + '0';
i += 6;
#ifdef NEW_AVERUNNABLE
tmp = (averunnable.ldavg[1] * 100 + FSCALE / 2)
>> FSHIFT;
#else
tmp = (averunnable[1] * 100 + FSCALE / 2) >> FSHIFT;
#endif
buffer[i++] = ((((tmp/100)/10) == 0) ?
' ' :
((tmp/100)/10) + '0');
@ -1063,12 +943,8 @@ async_update(void *arg)
buffer[i++] = ((tmp%100)/10) + '0';
buffer[i++] = ((tmp%100)%10) + '0';
i += 7;
#ifdef NEW_AVERUNNABLE
tmp = (averunnable.ldavg[2] * 100 + FSCALE / 2)
>> FSHIFT;
#else
tmp = (averunnable[2] * 100 + FSCALE / 2) >> FSHIFT;
#endif
buffer[i++] = ((((tmp/100)/10) == 0) ?
' ' :
((tmp/100)/10) + '0');
@ -1411,28 +1287,6 @@ resetchargen(void)
chargen_access = 0; /* flag we are NOT accessing the chargen ram */
}
#if PCVT_WAITRETRACE
/*---------------------------------------------------------------------------*
* wait for being in a retrace time window
* NOTE: this is __VERY__ bad programming practice in this environment !!
*---------------------------------------------------------------------------*/
static void
wait_retrace(void)
{
if(color)
{
while(!(inb(GN_INPSTAT1C) & 0x01))
;
}
else
{
while(!(inb(GN_INPSTAT1M) & 0x01))
;
}
}
#endif /* PCVT_WAITRETRACE */
/*---------------------------------------------------------------------------*
* switch screen off (VGA only)
@ -1524,11 +1378,7 @@ void
loadchar(int fontset, int character, int char_scanlines, u_char *char_table)
{
unsigned char *d;
#if PCVT_BACKUP_FONTS
unsigned char *bak;
#endif /* PCVT_BACKUP_FONTS */
int j, k;
if((d = compute_charset_base(fontset)) == 0)
@ -1556,7 +1406,6 @@ loadchar(int fontset, int character, int char_scanlines, u_char *char_table)
resetchargen(); /* access video ram */
#if PCVT_BACKUP_FONTS
if(saved_charsets[fontset] == 0)
saved_charsets[fontset] =
(u_char *)malloc(32 * 256, M_DEVBUF, M_WAITOK);
@ -1572,53 +1421,13 @@ loadchar(int fontset, int character, int char_scanlines, u_char *char_table)
else
panic("pcvt loadchar: no backup buffer");
#endif /* DIAGNOSTIC */
#endif /* PCVT_BACKUP_FONTS */
}
/*---------------------------------------------------------------------------*
* save/restore character set n to addr b
* since there are always backed up copies, we do not save anything here
* parameter "b" is totally ignored
*---------------------------------------------------------------------------*/
#if !PCVT_BACKUP_FONTS
void
vga_move_charset(unsigned n, unsigned char *b, int save_it)
{
unsigned char *d = compute_charset_base(n);
#ifdef DIAGNOSTIC
if(d == 0)
panic("vga_move_charset: wrong adaptor");
#endif
if(vsp->wd132col && (n == 1||n == 3||n == 5||n == 7))
{
setchargen3();
d -= 0x2000;
}
else
{
setchargen();
}
/* PLEASE, leave the following alone using bcopyb, as several */
/* chipsets have problems if their memory is accessed with 32 */
/* or 16 bits wide, don't change this to using bcopy for speed! */
if(save_it)
bcopyb(d, b, 256 /* chars */ * 32 /* bytes per char */);
else
bcopyb(b, d, 256 /* chars */ * 32 /* bytes per char */);
resetchargen();
}
#else /* PCVT_BACKUP_FONTS */
/* since there are always backed up copies, we do not save anything here */
/* parameter "b" is totally ignored */
void
vga_move_charset(unsigned n, unsigned char *b, int save_it)
{
@ -1659,30 +1468,18 @@ vga_move_charset(unsigned n, unsigned char *b, int save_it)
resetchargen();
}
#endif /* PCVT_BACKUP_FONTS */
#if !PCVT_USL_VT_COMPAT
#ifndef XSERVER
/*---------------------------------------------------------------------------*
* switch to virtual screen n (0 ... PCVT_NSCREENS-1)
*---------------------------------------------------------------------------*/
void
vgapage(int n)
{
#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 */
/* video board memory -> kernel memory */
bcopy(vsp->Crtat, vsp->Memory, vsp->screen_rows * vsp->maxcol * CHR);
@ -1693,13 +1490,7 @@ vgapage(int n)
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 */
@ -1714,10 +1505,6 @@ vgapage(int n)
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)
@ -1754,12 +1541,11 @@ vgapage(int n)
update_hp(vsp); /* update fkey labels, if present */
}
#endif /* !PCVT_USL_VT_COMPAT */
#endif /* XSERVER */
/*---------------------------------------------------------------------------*
* test if it is a vga
*---------------------------------------------------------------------------*/
int
vga_test(void)
{
@ -1917,27 +1703,6 @@ vga10_vga8(u_char *invga, u_char *outvga)
outvga[7] = invga[9];
}
/*---------------------------------------------------------------------------*
* force a vga card to behave like an ega for debugging
*---------------------------------------------------------------------------*/
#if FORCE_EGA
void
force_ega(void)
{
unsigned char vgareg;
if(adaptor_type == VGA_ADAPTOR)
{
adaptor_type = EGA_ADAPTOR;
totalfonts = 4;
vgareg = inb(GN_MISCOUTR); /* Miscellaneous Output Register */
vgareg |= 128; /* Set 350 scanline mode */
vgareg &= ~64;
outb(GN_MISCOUTW,vgareg);
}
}
#endif /* FORCE_EGA */
/*---------------------------------------------------------------------------*
* disconnect attribute bit 3 from generating intensity
* (and use it for a second character set !)
@ -1965,9 +1730,6 @@ set_2ndcharset(void)
static u_short
getrand(void)
{
#if !PCVT_FREEBSD
extern struct timeval time; /* time-of-day register */
#endif
static unsigned long seed = 1;
register u_short res = (u_short)seed;
seed = seed * 1103515245L + time_second;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1992, 1999 Hellmuth Michaelis.
* Copyright (c) 1992, 2000 Hellmuth Michaelis.
*
* All rights reserved.
*
@ -29,7 +29,7 @@
* pcvt_tbl.h VT220 Driver Character Set Conversion Tables
* ------------------------------------------------------------
*
* Last Edit-Date: [Mon Dec 27 14:12:37 1999]
* Last Edit-Date: [Sun Mar 26 10:38:49 2000]
*
* $FreeBSD$
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Hellmuth Michaelis
* Copyright (c) 1999, 2000 Hellmuth Michaelis
*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
*
@ -42,7 +42,7 @@
* pcvt_vtf.c VT220 Terminal Emulator Functions
* -------------------------------------------------
*
* Last Edit-Date: [Mon Dec 27 14:13:33 1999]
* Last Edit-Date: [Sun Mar 26 10:38:52 2000]
*
* $FreeBSD$
*
@ -1428,7 +1428,7 @@ vt_mc(struct video_state *svsp)
*
*---------------------------------------------------------------------------*/
void
vt_dcsentry(U_char ch, struct video_state *svsp)
vt_dcsentry(int ch, struct video_state *svsp)
{
switch(svsp->dcs_state)
{
@ -1928,9 +1928,6 @@ vt_sed(struct video_state *svsp)
void
roll_up(struct video_state *svsp, int n)
{
#if (PCVT_NOFASTSCROLL==0)
if(svsp->scrr_beg == 0 && /* if scroll region is whole screen */
svsp->scrr_len == svsp->screen_rows &&
(svsp != vsp || /* and either running in memory */
@ -1938,13 +1935,11 @@ roll_up(struct video_state *svsp, int n)
adaptor_type != MDA_ADAPTOR))) /* and not on MDA/Hercules */
{
u_short *Memory =
#if PCVT_USL_VT_COMPAT
#ifdef XSERVER
(vsp != svsp || (vsp->vt_status & VT_GRAFX)) ?
#else
(vsp != svsp) ?
#endif
svsp->Memory : Crtat;
if(svsp->Crtat > (Memory + (svsp->screen_rows - n) *
@ -1959,13 +1954,11 @@ roll_up(struct video_state *svsp, int n)
{
svsp->Crtat += n * svsp->maxcol;
}
#if PCVT_USL_VT_COMPAT
#ifdef XSERVER
if(vsp == svsp && !(vsp->vt_status & VT_GRAFX))
#else
if(vsp == svsp)
#endif
{
outb(addr_6845, CRTC_STARTADRH);
outb(addr_6845+1, (svsp->Crtat - Crtat) >> 8);
@ -1974,13 +1967,11 @@ roll_up(struct video_state *svsp, int n)
}
}
else
#endif
{
bcopy( svsp->Crtat + ((svsp->scrr_beg + n) * svsp->maxcol),
svsp->Crtat + (svsp->scrr_beg * svsp->maxcol),
svsp->maxcol * (svsp->scrr_len - n) * CHR );
}
fillw( user_attr | ' ',
svsp->Crtat + ((svsp->scrr_end - n + 1) * svsp->maxcol),
n * svsp->maxcol);
@ -1995,9 +1986,6 @@ roll_up(struct video_state *svsp, int n)
static void
roll_down(struct video_state *svsp, int n)
{
#if (PCVT_NOFASTSCROLL==0)
if(svsp->scrr_beg == 0 && /* if scroll region is whole screen */
svsp->scrr_len == svsp->screen_rows &&
(svsp != vsp || /* and either running in memory */
@ -2005,8 +1993,7 @@ roll_down(struct video_state *svsp, int n)
adaptor_type != MDA_ADAPTOR))) /* and not on MDA/Hercules */
{
u_short *Memory =
#if PCVT_USL_VT_COMPAT
#ifdef XSERVER
(vsp != svsp || (vsp->vt_status & VT_GRAFX)) ?
#else
(vsp != svsp) ?
@ -2025,13 +2012,11 @@ roll_down(struct video_state *svsp, int n)
{
svsp->Crtat -= n * svsp->maxcol;
}
#if PCVT_USL_VT_COMPAT
#ifdef XSERVER
if(vsp == svsp && !(vsp->vt_status & VT_GRAFX))
#else
if(vsp == svsp)
#endif
{
outb(addr_6845, CRTC_STARTADRH);
outb(addr_6845+1, (svsp->Crtat - Crtat) >> 8);
@ -2040,13 +2025,11 @@ roll_down(struct video_state *svsp, int n)
}
}
else
#endif
{
bcopy( svsp->Crtat + (svsp->scrr_beg * svsp->maxcol),
svsp->Crtat + ((svsp->scrr_beg + n) * svsp->maxcol),
svsp->maxcol * (svsp->scrr_len - n) * CHR );
}
fillw( user_attr | ' ',
svsp->Crtat + (svsp->scrr_beg * svsp->maxcol),
n * svsp->maxcol);