-/* $NetBSD: ite.c,v 1.27 1995/04/19 19:15:51 mycroft Exp $ */
+/* $NetBSD: ite.c,v 1.27.2.1 1995/11/19 23:18:27 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
dev_t dev;
int flag;
{
- int unit = UNIT(dev);
+ int unit = ITEUNIT(dev);
struct tty *tp = ite_tty[unit];
struct ite_softc *ip = &ite_softc[unit];
iteinit(dev)
dev_t dev;
{
- int unit = UNIT(dev);
+ int unit = ITEUNIT(dev);
struct ite_softc *ip = &ite_softc[unit];
if (ip->flags & ITE_INITED)
dev_t dev;
int flag;
{
- register struct ite_softc *ip = &ite_softc[UNIT(dev)];
+ register struct ite_softc *ip = &ite_softc[ITEUNIT(dev)];
if (flag & 2) {
ip->flags |= ITE_INGRF;
if ((flag & 1) ||
(ip->flags & (ITE_INGRF|ITE_ISCONS|ITE_INITED)) == ITE_INITED)
(*ip->isw->ite_deinit)(ip);
- if ((flag & 2) == 0)
+
+ /*
+ * XXX When the system is rebooted with "reboot", init(8)
+ * kills the last process to have the console open.
+ * If we don't revent the the ITE_ACTIVE bit from being
+ * cleared, we will never see messages printed during
+ * the process of rebooting.
+ */
+ if ((flag & 2) == 0 && (ip->flags & ITE_ISCONS) == 0)
ip->flags &= ~ITE_ACTIVE;
}
int mode, devtype;
struct proc *p;
{
- int unit = UNIT(dev);
+ int unit = ITEUNIT(dev);
register struct tty *tp;
register struct ite_softc *ip = &ite_softc[unit];
register int error;
int flag, mode;
struct proc *p;
{
- register struct tty *tp = ite_tty[UNIT(dev)];
+ register struct tty *tp = ite_tty[ITEUNIT(dev)];
(*linesw[tp->t_line].l_close)(tp, flag);
ttyclose(tp);
iteoff(dev, 0);
#if 0
ttyfree(tp);
- ite_tty[UNIT(dev)] = (struct tty *)0;
+ ite_tty[ITEUNIT(dev)] = (struct tty *)0;
#endif
return(0);
}
struct uio *uio;
int flag;
{
- register struct tty *tp = ite_tty[UNIT(dev)];
+ register struct tty *tp = ite_tty[ITEUNIT(dev)];
return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
}
struct uio *uio;
int flag;
{
- register struct tty *tp = ite_tty[UNIT(dev)];
+ register struct tty *tp = ite_tty[ITEUNIT(dev)];
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
dev_t dev;
{
- return (ite_tty[UNIT(dev)]);
+ return (ite_tty[ITEUNIT(dev)]);
}
int
int flag;
struct proc *p;
{
- register struct tty *tp = ite_tty[UNIT(dev)];
+ register struct tty *tp = ite_tty[ITEUNIT(dev)];
int error;
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr, flag, p);
* Turn off cursor while we output multiple characters.
* Saves a lot of expensive window move operations.
*/
- ip = &ite_softc[UNIT(tp->t_dev)];
+ ip = &ite_softc[ITEUNIT(tp->t_dev)];
if (ip->flags & ITE_CURSORON) {
ite_erasecursor(ip, ip->isw);
ip->flags &= ~ITE_CURSORON;
register int c;
dev_t dev;
{
- int unit = UNIT(dev);
+ int unit = ITEUNIT(dev);
register struct ite_softc *ip = &ite_softc[unit];
register struct itesw *sp = ip->isw;
register int n;
itecninit(cp)
struct consdev *cp;
{
- int unit = UNIT(cp->cn_dev);
+ int unit = ITEUNIT(cp->cn_dev);
struct ite_softc *ip = &ite_softc[unit];
ip->attrbuf = console_attributes;
iteinit(cp->cn_dev);
- ip->flags |= (ITE_ACTIVE|ITE_ISCONS);
+ ip->flags |= (ITE_ACTIVE | ITE_ISCONS);
kbd_ite = ip;
}
int c;
{
static int paniced = 0;
- struct ite_softc *ip = &ite_softc[UNIT(dev)];
+ struct ite_softc *ip = &ite_softc[ITEUNIT(dev)];
if (panicstr && !paniced &&
(ip->flags & (ITE_ACTIVE|ITE_INGRF)) != ITE_ACTIVE) {