Adapt for new conf.h:

- Add xxxtty() functions
	- Remove xxx_tty array
This commit is contained in:
leo 1995-04-22 22:06:43 +00:00
parent c9a522cd2b
commit e8312d3ac3
2 changed files with 48 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.3 1995/04/10 08:53:46 mycroft Exp $ */
/* $NetBSD: ite.c,v 1.4 1995/04/22 22:06:43 leo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -69,12 +69,6 @@
#include <atari/dev/viewvar.h>
#include <atari/dev/kbdmap.h>
/*
* XXX go ask sys/kern/tty.c:ttselect()
*/
#include "grf.h" /* Get definition of NGRF */
struct tty *ite_tty[NGRF];
#define ITEUNIT(dev) (minor(dev))
#define SUBR_INIT(ip) (ip)->grf->g_iteinit(ip)
@ -312,7 +306,7 @@ itecnputc(dev, c)
/*
* iteinit() is the standard entry point for initialization of
* an ite device, it is also called from ite_cninit().
* an ite device, it is also called from itecninit().
*
*/
void
@ -355,7 +349,7 @@ iteopen(dev, mode, devtype, p)
ip = getitesp(dev);
if (ip->tp == NULL)
tp = ite_tty[unit] = ip->tp = ttymalloc();
tp = ip->tp = ttymalloc();
else
tp = ip->tp;
if ((tp->t_state & (TS_ISOPEN | TS_XCLUDE)) == (TS_ISOPEN | TS_XCLUDE)
@ -446,6 +440,13 @@ itestop(tp, flag)
}
struct tty *
itetty(dev)
dev_t dev;
{
return(getitesp(dev)->tp);
}
int
iteioctl(dev, cmd, addr, flag, p)
dev_t dev;

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.3 1995/04/11 02:42:23 mycroft Exp $ */
/* $NetBSD: zs.c,v 1.4 1995/04/22 22:06:45 leo Exp $ */
/*
* Copyright (c) 1995 L. Weppelman (Atari modifications)
@ -113,8 +113,6 @@ u_char zs_init_regs[16] = {
/* 15 */ 0
};
struct tty *zs_tty[NZS * 2]; /* XXX should be dynamic */
/* Definition of the driver for autoconfig. */
static int zsmatch __P((struct device *, struct cfdata *, void *));
static void zsattach __P((struct device *, struct device *, void *));
@ -143,7 +141,8 @@ static void zs_loadchannelregs __P((volatile struct zschan *, u_char *));
int zsshortcuts; /* number of "shortcut" software interrupts */
static int zsmatch(pdp, cfp, auxp)
static int
zsmatch(pdp, cfp, auxp)
struct device *pdp;
struct cfdata *cfp;
void *auxp;
@ -235,7 +234,7 @@ struct proc *p;
cs = &zi->zi_cs[unit & 1];
tp = cs->cs_ttyp;
if(tp == NULL) {
cs->cs_ttyp = tp = zs_tty[unit] = ttymalloc();
cs->cs_ttyp = tp = ttymalloc();
tp->t_dev = dev;
tp->t_oproc = zsstart;
tp->t_param = zsparam;
@ -338,21 +337,52 @@ dev_t dev;
struct uio *uio;
int flags;
{
register struct tty *tp = zs_tty[ZS_UNIT(dev)];
register struct zs_chanstate *cs;
register struct zs_softc *zi;
register struct tty *tp;
int unit;
unit = ZS_UNIT(dev);
zi = zscd.cd_devs[unit >> 1];
cs = &zi->zi_cs[unit & 1];
tp = cs->cs_ttyp;
return(linesw[tp->t_line].l_read(tp, uio, flags));
}
int zswrite(dev, uio, flags)
int
zswrite(dev, uio, flags)
dev_t dev;
struct uio *uio;
int flags;
{
register struct tty *tp = zs_tty[ZS_UNIT(dev)];
register struct zs_chanstate *cs;
register struct zs_softc *zi;
register struct tty *tp;
int unit;
unit = ZS_UNIT(dev);
zi = zscd.cd_devs[unit >> 1];
cs = &zi->zi_cs[unit & 1];
tp = cs->cs_ttyp;
return(linesw[tp->t_line].l_write(tp, uio, flags));
}
struct tty *
zstty(dev)
dev_t dev;
{
register struct zs_chanstate *cs;
register struct zs_softc *zi;
int unit;
unit = ZS_UNIT(dev);
zi = zscd.cd_devs[unit >> 1];
cs = &zi->zi_cs[unit & 1];
return(cs->cs_ttyp);
}
/*
* ZS hardware interrupt. Scan all ZS channels. NB: we know here that
* channels are kept in (A,B) pairs.