mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Use ttymalloc() instead of ttyregister().
This commit is contained in:
parent
214ef22684
commit
9130089b9d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130055
@ -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];
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user