~kris/9p

9hist

31f046b6ab9a9ef98e268379882c8b8b63d684b8 — David du Colombier 28 years ago f90b224
Plan 9 from Bell Labs 1998-02-21
8 files changed, 58 insertions(+), 87 deletions(-)

M pc/devi82365.c
M pc/memory.c
M pc/ns16552.h
A pc/pcmciamodem.c
M port/alloc.c
M port/chan.c
M port/netif.c
M port/sysfile.c
M pc/devi82365.c => pc/devi82365.c +1 -2
@@ 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);

M pc/memory.c => pc/memory.c +0 -1
@@ 251,7 251,6 @@ umbscan(void)
	}
}


static void
ramscan(ulong maxmem)
{

M pc/ns16552.h => pc/ns16552.h +1 -1
@@ 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

A pc/pcmciamodem.c => pc/pcmciamodem.c +56 -0
@@ 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;
	}
}	

M port/alloc.c => port/alloc.c +0 -8
@@ 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);
}

M port/chan.c => port/chan.c +0 -67
@@ 105,73 105,6 @@ newchan(void)
}

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)
{
	c->flag = CFREE;

M port/netif.c => port/netif.c +0 -4
@@ 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);

M port/sysfile.c => port/sysfile.c +0 -4
@@ 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;