From 31f046b6ab9a9ef98e268379882c8b8b63d684b8 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 21 Feb 1998 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1998-02-21 --- pc/devi82365.c | 3 +-- pc/memory.c | 1 - pc/ns16552.h | 2 +- pc/pcmciamodem.c | 56 ++++++++++++++++++++++++++++++++++++++++ port/alloc.c | 8 ------ port/chan.c | 67 ------------------------------------------------ port/netif.c | 4 --- port/sysfile.c | 4 --- 8 files changed, 58 insertions(+), 87 deletions(-) create mode 100644 pc/pcmciamodem.c diff --git a/pc/devi82365.c b/pc/devi82365.c index e7529ef4e37fe1837689a1d03771bc2b821eefa8..36af438ae608d310d659045acbef6bac6bf8486a 100644 --- a/pc/devi82365.c +++ b/pc/devi82365.c @@ -130,7 +130,7 @@ struct Conftab ushort irqs; /* legal irqs */ ushort port; /* port address */ uchar irqtype; - uchar nioregs; /* number of io registers */ + ulong nioregs; /* number of io registers */ uchar bit16; /* true for 16 bit access */ uchar vpp1; uchar vpp2; @@ -357,7 +357,6 @@ pcmmap(int slotno, ulong offset, int len, int attr) m->len = 0; } m->isa = umbmalloc(0, len, Mgran)&~KZERO; -print("m->isa = 0x%uX, %d\n", m->isa, len); if(m->isa == 0){ print("pcmmap: out of isa space\n"); unlock(&pp->mlock); diff --git a/pc/memory.c b/pc/memory.c index 2b907ec6a9667d9c8656d738d65bdae270e52b3f..1b7d68622b9e1b727a557023ca1444fa0fbbd526 100644 --- a/pc/memory.c +++ b/pc/memory.c @@ -251,7 +251,6 @@ umbscan(void) } } - static void ramscan(ulong maxmem) { diff --git a/pc/ns16552.h b/pc/ns16552.h index 5b1c0901d8463aea995c2a5f64b2e81a47e47a2e..0d8dc2c65a2c4034dd87888ff6224fe0e40a5dd2 100644 --- a/pc/ns16552.h +++ b/pc/ns16552.h @@ -136,7 +136,7 @@ ns16552install(void) ns16552setup(port, sc->freq, name); port += 8; } - } else if(cistrcmp(sc->type, "com") == 0){ + } else if(cistrcmp(sc->type, "com") == 0 && sc->port != 0x3F8 && sc->port != 0x2F8){ /* * port gives base port address for the uart * irq is interrupt diff --git a/pc/pcmciamodem.c b/pc/pcmciamodem.c new file mode 100644 index 0000000000000000000000000000000000000000..e6c933b84019bb8380ce53dd8c44925a4387e299 --- /dev/null +++ b/pc/pcmciamodem.c @@ -0,0 +1,56 @@ +#include "u.h" +#include "../port/lib.h" +#include "mem.h" +#include "dat.h" +#include "fns.h" +#include "io.h" +#include "ureg.h" +#include "../port/error.h" + +/* + * PCMCIA modem. + * By default, this will set it up with the port and irq of + * COM2 unless a serialx=type=com line is found in plan9.ini. + * The assumption is that a laptop with a pcmcia will have only + * one com port. + */ + +enum { + Maxcard= 8, +}; + +static char* modems[] = { + "IBM 33.6 Data/Fax/Voice Modem", + "KeepInTouch", + 0, +}; + +void +pcmciamodemlink(void) +{ + ISAConf isa; + int i, slot; + + i = 0; + for(;;){ + memset(&isa, 0, sizeof(isa)); + + /* look for a configuration line */ + for(; i < Maxcard; i++){ + if(isaconfig("serial", i, &isa)) + if(cistrcmp(isa.type, "com") == 0) + break; + memset(&isa, 0, sizeof(isa)); + } + + /* default is COM2 */ + if(isa.irq == 0) + isa.irq = 3; + if(isa.port == 0) + isa.port = 0x2F8; + + slot = pcmspecial(modems[0], &isa); + if(slot < 0) + break; + } +} diff --git a/port/alloc.c b/port/alloc.c index e8d9cf67d0ac677a7a9d14cca95305da909e8e00..fb0bbad566f8ff8e4c4c310c863a0fe60afaf419 100644 --- a/port/alloc.c +++ b/port/alloc.c @@ -615,11 +615,3 @@ recur(Bhdr *t) return 0; return recur(t->right) && recur(t->left); } - -int -poolok(int x) -{ - if(x & 1) - return recur(mainmem->root); - return recur(imagmem->root); -} diff --git a/port/chan.c b/port/chan.c index a561be05d73ba30c8083f66100bcd70207e9d312..16e45e1df1182997cdd09e980c0d7c3e02d77c05 100644 --- a/port/chan.c +++ b/port/chan.c @@ -104,73 +104,6 @@ newchan(void) return c; } -void -okchan1(Chan *c, char *msg, int n) -{ - int i, bad; - - bad = 0; - if(c->type > 64){ - print("bad type %d\n", c->type); - bad = 1; - } - if((ulong)(c->next) & 3){ - print("bad next %.8lux\n", c->next); - bad = 1; - } - if((ulong)(c->link) & 3){ - print("bad link %.8lux\n", c->link); - bad = 1; - } - if((ulong)(c->path) & 3){ - print("bad path %.8lux\n", c->path); - bad = 1; - } - if((ulong)(c->mnt) & 3){ - print("bad mnt %.8lux\n", c->mnt); - bad = 1; - } - if((ulong)(c->xmnt) & 3){ - print("bad xmnt %.8lux\n", c->xmnt); - bad = 1; - } - if((ulong)(c->mcp) & 3){ - print("bad mcp %.8lux\n", c->mcp); - bad = 1; - } - if((ulong)(c->mchan) & 3){ - print("bad mchan %.8lux\n", c->mchan); - bad = 1; - } - if((ulong)(c->session) & 3){ - print("bad session %.8lux\n", c->session); - bad = 1; - } - if(!bad) - return; - - print("okchan: %s (%d=#%.8lux)\n", msg, n, n); - for(i=0; i<16; i++){ - print("%d=%.8lux\n", i, ((ulong*)c)[i]); - if((i&7) == 7) - print("\n"); - } - for(;;); -} - -void -okchan(char *msg, int n) -{ - int s; - Chan *c; - - return; - s = splhi(); - for(c = chanalloc.list; c; c = c->link) - okchan1(c, msg, n); - splx(s); -} - void chanfree(Chan *c) { diff --git a/port/netif.c b/port/netif.c index 0e49c9123d0c786401e9f1a875de0316c231afb6..75e65aff7f256a5e078a3fd9b26f496737bf312c 100644 --- a/port/netif.c +++ b/port/netif.c @@ -171,10 +171,6 @@ netifread(Netif *nif, Chan *c, void *a, long n, ulong offset) switch(NETTYPE(c->qid.path)){ case Ndataqid: f = nif->f[NETID(c->qid.path)]; -okchan("before qread", 0); -j = qread(f->in, a, n); -okchan("after qread", j); -return j; return qread(f->in, a, n); case Nctlqid: return readnum(offset, a, n, NETID(c->qid.path), NUMSIZE); diff --git a/port/sysfile.c b/port/sysfile.c index debe92ac10730db691478d3f611d7eedde4985f2..afdd8f1ea4aeddc39c0873a5b6aa5f35798501cc 100644 --- a/port/sysfile.c +++ b/port/sysfile.c @@ -230,9 +230,7 @@ sysopen(ulong *arg) nexterror(); } validaddr(arg[0], 1, 0); -okchan("before open namec", 0); c = namec((char*)arg[0], Aopen, arg[1], 0); -okchan("after open namec", 0); fd = newfd(c); poperror(); return fd; @@ -517,9 +515,7 @@ sysfstat(ulong *arg) cclose(c); nexterror(); } -okchan("before stat routine", c->type); devtab[c->type]->stat(c, (char*)arg[1]); -okchan("after stat routine", c->type); poperror(); cclose(c); return 0;