Correct a few minor things in pcvt:

o  the includes are now properly done by <sys/foo.h> instead of "foo.h"
o  a bunch of undeclared functions has been resolved
o  pcvt finally supports devconfig
This commit is contained in:
Joerg Wunsch 1995-04-01 20:16:15 +00:00
parent 65202423ff
commit 7fd9907e0b
3 changed files with 119 additions and 2 deletions

View File

@ -96,6 +96,14 @@ static void vgapelinit(void); /* read initial VGA DAC palette */
static int pcvt_xmode_set(int on, struct proc *p); /* initialize for X mode */
#endif /* XSERVER && !PCVT_USL_VT_COMPAT */
#if PCVT_FREEBSD > 205
static struct kern_devconf kdc_vt[];
static inline void
vt_registerdev(struct isa_device *id, const char *name);
static char vt_description[];
#define VT_DESCR_LEN 40
#endif /* PCVT_FREEBSD > 205 */
int
#if PCVT_NETBSD > 100 /* NetBSD-current Feb 20 1995 */
pcprobe(struct device *parent, void *match, void *aux)
@ -293,6 +301,13 @@ pcattach(struct isa_device *dev)
async_update(UPDATE_START); /* start asynchronous updates */
#if PCVT_FREEBSD > 205
/* mark the device busy now if we are the console */
kdc_vt[dev->id_unit].kdc_state =
pcvt_is_console? DC_IDLE: DC_BUSY;
vt_registerdev(dev, (char *)vga_string(vga_type));
#endif /* PCVT_FREEBSD > 205 */
#if PCVT_NETBSD > 9
vthand.ih_fun = pcrint;
@ -450,6 +465,12 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p)
splx(s);
}
#if PCVT_FREEBSD > 205
if(retval == 0)
/* XXX currently, only one vt device is supported */
kdc_vt[0].kdc_state = DC_BUSY;
#endif
return(retval);
}
@ -495,6 +516,12 @@ pcclose(Dev_t dev, int flag, int mode, struct proc *p)
#endif /* PCVT_USL_VT_COMPAT */
#if PCVT_FREEBSD > 205
if(!pcvt_is_console)
/* XXX currently, only one vt device is supported */
kdc_vt[0].kdc_state = DC_IDLE;
#endif
return(0);
}
@ -706,6 +733,33 @@ pcdevtotty(Dev_t dev)
{
return get_pccons(dev);
}
static char vt_descr[VT_DESCR_LEN] = "Graphics console: ";
static struct kern_devconf kdc_vt[NVT] = {
0, 0, 0, /* filled in by dev_attach */
"vt", 0, { MDDT_ISA, 0, "tty" },
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
&kdc_isa0, /* parent */
0, /* parentdata */
DC_UNCONFIGURED, /* until we know it better */
vt_descr
};
static inline void
vt_registerdev(struct isa_device *id, const char *name)
{
if(id->id_unit)
kdc_vt[id->id_unit] = kdc_vt[0];
kdc_vt[id->id_unit].kdc_unit = id->id_unit;
kdc_vt[id->id_unit].kdc_isa = id;
/* XXX only vt0 currently allowed */
strncpy(vt_descr + sizeof("Graphics console: ") - 1,
name,
VT_DESCR_LEN - sizeof("Graphics console: "));
dev_attach(&kdc_vt[id->id_unit]);
}
#endif /* PCVT_FREEBSD > 205 */
/*---------------------------------------------------------------------------*
@ -1033,6 +1087,9 @@ pccnprobe(struct consdev *cp)
if ((u_int)cdevsw[maj].d_open == (u_int)pcopen)
break;
}
if (maj == nchrdev)
/* we are not in cdevsw[], give up */
panic("pcvt is not in cdevsw[]");
/* initialize required fields */
@ -1055,6 +1112,7 @@ pccnprobe(struct consdev *cp)
int
pccninit(struct consdev *cp)
{
pcvt_is_console = 1;
return 0;
}

View File

@ -71,6 +71,13 @@
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];

View File

@ -65,6 +65,21 @@
#define PCVT_REL "3.20-b23" /* driver attach announcement */
/* see also: pcvt_ioctl.h */
#if PCVT_FREEBSD >= 200
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/ioctl.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/tty.h>
#include <sys/uio.h>
#include <sys/callout.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/syslog.h>
#include <sys/malloc.h>
#include <sys/time.h>
#else /* ! PCVT_FREEBSD >= 200 */
#include "param.h"
#include "conf.h"
#include "ioctl.h"
@ -78,6 +93,7 @@
#include "syslog.h"
#include "malloc.h"
#include "time.h"
#endif /* PCVT_FREEBSD >= 200 */
#include "pcvt_conf.h"
@ -88,40 +104,73 @@
#if PCVT_NETBSD > 9
#include "i386/isa/isavar.h"
#include "i386/cpufunc.h"
#else
#elif PCVT_FREEBSD >= 200
#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 <i386/i386/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
#endif /* PCVT_FREEBSD >= 200 */
#endif /* PCVT_NETBSD <= 9 */
#if PCVT_FREEBSD >= 200
#include <machine/stdarg.h>
#else
#include "machine/stdarg.h"
#endif
#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>
#include <machine/clock.h>
#include <machine/md_var.h>
#include <vm/vm_kern.h>
#else
#include "machine/pc/display.h"
#include "vm/vm_kern.h"
#endif
#if PCVT_FREEBSD > 205
#include <sys/devconf.h>
#endif
/* setup irq disable function to use */
@ -942,6 +991,7 @@ int vt_switch_pending = 0; /* if > 0, a vt switch is */
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 */
@ -1078,6 +1128,7 @@ extern u_int addr_6845;
extern u_short *Crtat;
extern struct isa_driver vtdriver;
extern u_char do_initialization;
extern u_char pcvt_is_console;
extern u_char bgansitopc[];
extern u_char fgansitopc[];
extern u_char shift_down;
@ -1314,6 +1365,7 @@ 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