summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-04 07:12:45 +0000
committerphk <phk@FreeBSD.org>2004-06-04 07:12:45 +0000
commitd24376a6685b1ab9cd9c28289b0a067a0d1a64e8 (patch)
tree84d3d65c3b26903a2a321f4b3a1c20be4c3877c2 /sys/i386/isa
parent7e6e0efd6428b4622d1f88cb97bed374e3b7d496 (diff)
downloadFreeBSD-src-d24376a6685b1ab9cd9c28289b0a067a0d1a64e8.zip
FreeBSD-src-d24376a6685b1ab9cd9c28289b0a067a0d1a64e8.tar.gz
Use ttymalloc() instead of ttyregister().
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c19
-rw-r--r--sys/i386/isa/pcvt/pcvt_ext.c2
-rw-r--r--sys/i386/isa/pcvt/pcvt_hdr.h4
-rw-r--r--sys/i386/isa/pcvt/pcvt_sup.c2
4 files changed, 12 insertions, 15 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index dcadcdb..d7d56d0 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -257,8 +257,8 @@ pcvt_attach(device_t dev)
for(i = 0; i < totalscreens; i++)
{
- ttyregister(&pcvt_tty[i]);
- vs[i].vs_tty = &pcvt_tty[i];
+ pcvt_tty[i] = ttymalloc(pcvt_tty[i]);
+ vs[i].vs_tty = pcvt_tty[i];
make_dev(&vt_cdevsw, i, UID_ROOT, GID_WHEEL, 0600, "ttyv%r", i);
}
@@ -284,7 +284,7 @@ pcvt_open(dev_t dev, int flag, int mode, struct thread *td)
if(i >= PCVT_NSCREENS)
return ENXIO;
- tp = &pcvt_tty[i];
+ tp = pcvt_tty[i];
dev->si_tty = tp;
@@ -350,7 +350,7 @@ pcvt_close(dev_t dev, int flag, int mode, struct thread *td)
if(i >= PCVT_NSCREENS)
return ENXIO;
- tp = &pcvt_tty[i];
+ tp = pcvt_tty[i];
(*linesw[tp->t_line].l_close)(tp, flag);
@@ -378,7 +378,7 @@ pcvt_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
if(i >= PCVT_NSCREENS)
return ENXIO;
- tp = &pcvt_tty[i];
+ tp = pcvt_tty[i];
/* note that some ioctl's are global, e.g. KBSTPMAT: There is
* only one keyboard and different repeat rates for instance between
@@ -419,6 +419,7 @@ static void
pcvt_timeout(void *arg)
{
u_char *cp;
+ struct tty *tp;
#if PCVT_SLOW_INTERRUPT
int s;
@@ -430,6 +431,7 @@ pcvt_timeout(void *arg)
pcvt_scrnsv_reset();
#endif /* PCVT_SCREENSAVER */
+ tp = pcvt_tty[current_video_screen];
while (pcvt_kbd_count)
{
if (((cp = sgetc(1)) != 0) &&
@@ -440,13 +442,13 @@ pcvt_timeout(void *arg)
if(*cp == '\0')
{
/* pass a NULL character */
- (*linesw[pcvt_ttyp->t_line].l_rint)('\0', pcvt_ttyp);
+ (*linesw[tp->t_line].l_rint)('\0', tp);
}
/* XXX */ else
#endif /* PCVT_NULLCHARS */
while (*cp)
- (*linesw[pcvt_ttyp->t_line].l_rint)(*cp++ & 0xff, pcvt_ttyp);
+ (*linesw[tp->t_line].l_rint)(*cp++ & 0xff, tp);
}
PCVT_DISABLE_INTR ();
@@ -647,7 +649,8 @@ pcvt_cn_probe(struct consdev *cp)
sprintf(cp->cn_name, "ttyv%r", 0);
cp->cn_pri = CN_INTERNAL;
- cp->cn_tp = &pcvt_tty[0];
+ pcvt_tty[0] = ttymalloc(pcvt_tty[0]);
+ cp->cn_tp = pcvt_tty[0];
}
/*---------------------------------------------------------------------------*
diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c
index 7081949..639c50c 100644
--- a/sys/i386/isa/pcvt/pcvt_ext.c
+++ b/sys/i386/isa/pcvt/pcvt_ext.c
@@ -2098,8 +2098,6 @@ switch_screen(int n, int oldgrafx, int newgrafx)
/* update global screen pointers/variables */
current_video_screen = n; /* current screen no */
- pcvt_ttyp = &pcvt_tty[n]; /* current tty */
-
vsp = &vs[n]; /* current video state ptr */
if(oldgrafx && !newgrafx)
diff --git a/sys/i386/isa/pcvt/pcvt_hdr.h b/sys/i386/isa/pcvt/pcvt_hdr.h
index 1a6f566..44b65a4 100644
--- a/sys/i386/isa/pcvt/pcvt_hdr.h
+++ b/sys/i386/isa/pcvt/pcvt_hdr.h
@@ -571,7 +571,7 @@ EXTERN u_char color; /* color or mono display */
EXTERN u_short kern_attr; /* kernel messages char attributes */
EXTERN u_short user_attr; /* character attributes */
-EXTERN struct tty pcvt_tty[PCVT_NSCREENS];
+EXTERN struct tty *pcvt_tty[PCVT_NSCREENS];
struct sixels {
u_char lower[MAXSIXEL]; /* lower half of char */
@@ -735,7 +735,6 @@ u_char bgansitopc[] = { /* background ANSI color -> pc */
BG_MAGENTA, BG_CYAN, BG_LIGHTGREY
};
-struct tty *pcvt_ttyp = &pcvt_tty[0]; /* ptr to current device */
video_state *vsp = &vs[0]; /* ptr to current screen parms */
#ifdef XSERVER
@@ -872,7 +871,6 @@ extern int pcvt_kbd_rptr;
extern int pcvt_kbd_count;
extern u_char vga_type;
-extern struct tty *pcvt_ttyp;
extern video_state *vsp;
#ifdef XSERVER
diff --git a/sys/i386/isa/pcvt/pcvt_sup.c b/sys/i386/isa/pcvt/pcvt_sup.c
index 4df2971..49fe289 100644
--- a/sys/i386/isa/pcvt/pcvt_sup.c
+++ b/sys/i386/isa/pcvt/pcvt_sup.c
@@ -1491,8 +1491,6 @@ vgapage(int n)
current_video_screen = n; /* current screen no */
- pcvt_ttyp = &pcvt_tty[n]; /* current tty */
-
vsp = &vs[n]; /* current video state ptr */
/* kernel memory -> video board memory */
OpenPOWER on IntegriCloud