PERFORCE change 77033 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sun May 15 22:49:44 PDT 2005
http://perforce.freebsd.org/chv.cgi?CH=77033
Change 77033 by marcel at marcel_nfs on 2005/05/16 05:49:17
Hook up the terminal emulator bits. It compiles, but that's
about it. Time to flesh this out now that the low-level
console (output) works.
Affected files ...
.. //depot/projects/tty/sys/conf/files#29 edit
.. //depot/projects/tty/sys/dev/vtc/vtc_te.h#2 edit
.. //depot/projects/tty/sys/dev/vtc/vtc_te_if.m#2 edit
.. //depot/projects/tty/sys/dev/vtc/vtc_te_vt102.c#2 edit
Differences ...
==== //depot/projects/tty/sys/conf/files#29 (text+ko) ====
@@ -919,6 +919,9 @@
dev/vtc/vtc_core.c optional vtc
dev/vtc/vtc_font.c optional vtc
dev/vtc/vtc_logo.c optional vtc
+dev/vtc/vtc_te.c optional vtc
+dev/vtc/vtc_te_if.m optional vtc
+dev/vtc/vtc_te_vt102.c optional vtc
dev/vtc/hw/gmch/gmch.c optional gmch vtc
dev/vtc/hw/gmch/gmch_bus_pci.c optional gmch vtc pci
dev/vtc/hw/vga/vga.c optional vga vtc
==== //depot/projects/tty/sys/dev/vtc/vtc_te.h#2 (text+ko) ====
@@ -41,4 +41,9 @@
struct vtc_te_class *sc_class;
};
+/*
+ * TE support functions.
+ */
+int vtc_te_bell(struct vtc_te_softc *);
+
#endif /* !_DEV_VTC_TE_H_ */
==== //depot/projects/tty/sys/dev/vtc/vtc_te_if.m#2 (text+ko) ====
@@ -25,9 +25,10 @@
#
# $FreeBSD$
-#include <sys/param.h>
#include <sys/lock.h>
#include <sys/mutex.h>
+#include <sys/types.h>
+
#include <dev/vtc/vtc_te.h>
# The VTC Terminal Emulator (TE) interface.
@@ -37,5 +38,5 @@
# write() - write to the terminal
METHOD int write {
struct vtc_te_softc *this;
- wchar_t unicode;
+ __wchar_t unicode;
};
==== //depot/projects/tty/sys/dev/vtc/vtc_te_vt102.c#2 (text+ko) ====
@@ -29,6 +29,9 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/kobj.h>
+
+#include <dev/vtc/vtc_te.h>
#include "vtc_te_if.h"
@@ -44,13 +47,19 @@
char cbuf[16];
};
-static int vt102_write(struct vtc_te_softc *, wchar_t);
+static int vt102_write(struct vtc_te_softc *, __wchar_t);
-static kobj_method_t vtc_te_vt102_methods[] = {
+static kobj_method_t vt102_methods[] = {
KOBJMETHOD(vtc_te_write, vt102_write),
{ 0, 0 }
};
+struct vtc_te_class vt102_class = {
+ "vt102 class",
+ vt102_methods,
+ sizeof(struct vt102_softc),
+};
+
static int
vt102_answerback(struct vt102_softc *vt102)
{
@@ -58,18 +67,12 @@
}
static int
-vt102_bell(struct vt102_softc *vt102)
+vt102_print(struct vt102_softc *vt102, __wchar_t wc)
{
return (0);
}
static int
-vt102_print(struct vt102_softc *vt102, wchar_t wc)
-{
- return (0);
-}
-
-static int
vt102_ctlchr(struct vt102_softc *vt102, char cc)
{
int error = 0;
@@ -79,7 +82,7 @@
error = vt102_answerback(vt102);
break;
case 0x07: /* BEL */
- error = vt102_bell(vt102);
+ error = vtc_te_bell(&vt102->base);
break;
case 0x08: /* BS */
break;
@@ -124,7 +127,7 @@
}
static int
-vt102_write(struct vtc_te_softc *sc, wchar_t wc)
+vt102_write(struct vtc_te_softc *sc, __wchar_t wc)
{
struct vt102_softc *vt102 = (struct vt102_softc *)sc;
int error;
@@ -153,7 +156,7 @@
return (0);
/* Save the character. Is there a maximum for the control string? */
- vt102->cstr[vt102->count++] = (char)wc;
+ vt102->cbuf[vt102->count++] = (char)wc;
/* That's it for intermediate characters. */
if (wc <= 0x2F)
@@ -177,6 +180,6 @@
error = vt102_escape(vt102);
else
error = vt102_control(vt102);
- vt102->state == C_NORMAL;
+ vt102->state = S_NORMAL;
return (error);
}
More information about the p4-projects
mailing list