summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/pcvt/pcvt_drv.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-04-01 20:16:15 +0000
committerjoerg <joerg@FreeBSD.org>1995-04-01 20:16:15 +0000
commit96f56f5d20df2ab860a0b7a61352a08df84eb514 (patch)
tree8a207c38282d206e54ec1a82194d972c743ba4e6 /sys/i386/isa/pcvt/pcvt_drv.c
parent23411ef52ee7dcff7a9a290530675b19287ac8ae (diff)
downloadFreeBSD-src-96f56f5d20df2ab860a0b7a61352a08df84eb514.zip
FreeBSD-src-96f56f5d20df2ab860a0b7a61352a08df84eb514.tar.gz
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
Diffstat (limited to 'sys/i386/isa/pcvt/pcvt_drv.c')
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index 83770a0..569f1ad 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -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;
}
OpenPOWER on IntegriCloud