From 0dc57f6dbebec708f79df268200733a379d858f1 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 6 Jun 2001 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2001-06-06 --- "bitsy/dev\302\265c.c" | 6 +++--- bitsy/uartsa1110.c | 2 ++ port/devuart.c | 14 +++++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git "a/bitsy/dev\302\265c.c" "b/bitsy/dev\302\265c.c" index a4ca2773e3817e773a52b6db409a39060955b3ea..3b197612a0e3768b31cbf4a3867d5e90ec73bed6 100644 --- "a/bitsy/dev\302\265c.c" +++ "b/bitsy/dev\302\265c.c" @@ -93,14 +93,14 @@ int uchar cksum; uchar *p; static int samseq; - static int touching; /* guard against something we call going spllo() */ - static int buttoning; /* guard against something we call going spllo() */ + static int touching; /* guard against something we call going spllo() */ + static int buttoning; /* guard against something we call going spllo() */ if(ctlr.n > sizeof(ctlr.buf)) panic("µcputc"); ctlr.buf[ctlr.n++] = (uchar)ch; - + for(;;){ /* message hasn't started yet? */ if(ctlr.buf[0] != SOF){ diff --git a/bitsy/uartsa1110.c b/bitsy/uartsa1110.c index 54cc5be96a971a0180b49e0e284dc3da3be78598..e57e6eb848a6b9b9ee6f6cc66adb22b388bf803c 100644 --- a/bitsy/uartsa1110.c +++ b/bitsy/uartsa1110.c @@ -73,6 +73,7 @@ static Uart sa1110uart[2] = { .parity = 'n', .baud = 115200, .phys = &sa1110physuart, + .putc = µcputc, .special = 0, .next = nil, }, }; @@ -484,6 +485,7 @@ sa1110_uartsetup(int console) p->regs = mapspecial(UART1REGS, 64); uartctl(p, "b115200 l8 pn s1"); µcuart = p; + p->special = 1; (*p->phys->enable)(p, 0); intrenable(IRQ, IRQuart1b, sa1110_uartintr, p, p->name); } diff --git a/port/devuart.c b/port/devuart.c index ead2231fd118ff07e85d698096098a176e52b516..59c8a8a45d35d1050c9e42bc419e8648b06b00d2 100644 --- a/port/devuart.c +++ b/port/devuart.c @@ -183,11 +183,15 @@ uartreset(void) uart[i] = p; p->dev = i; - if(p->console && uartenable(p) != nil){ - kbdq = p->iq; - serialoq = p->oq; - p->putc = kbdcr2nl; - p->opens++; + if(p->console || p->special){ + if(uartenable(p) != nil){ + if(p->console){ + kbdq = p->iq; + serialoq = p->oq; + p->putc = kbdcr2nl; + } + p->opens++; + } } p = p->next; }