~kris/9p

9hist

0b8e08158453628da46a239769c1ebb827683d1a — David du Colombier 25 years ago ac3b56b
Plan 9 from Bell Labs 2000-12-06
7 files changed, 13 insertions(+), 19 deletions(-)

M bitsy/devether.c
M bitsy/devpcmcia.c
M bitsy/devpenmouse.c
M bitsy/l.s
M bitsy/main.c
M bitsy/trap.c
M port/portclock.c
M bitsy/devether.c => bitsy/devether.c +4 -3
@@ 51,11 51,9 @@ etherconfig(int on, char *spec, DevConf *cf)
	memset(ether, 0, sizeof(Ether));
	*(DevConf*)ether = *cf;

print("looking for card type %s\n", ether->type);
	for(n = 0; cards[n].type; n++){
		if(strcmp(cards[n].type, ether->type) != 0)
			continue;
print("found card type %s\n", ether->type);
		if(cards[n].reset(ether))
			break;
		sprint(name, "ether%d", ctlrno);


@@ 75,6 73,9 @@ print("found card type %s\n", ether->type);
		ether->alen = Eaddrlen;
		memmove(ether->addr, ether->ea, Eaddrlen);
		memset(ether->bcast, 0xFF, Eaddrlen);
		ether->mbps = 10;
		ether->minmtu = ETHERMINTU;
		ether->maxmtu = ETHERMAXTU;

		if(ether->interrupt != nil)
			intrenable(cf->itype, cf->interrupt, ether->interrupt, ether, name);


@@ 91,7 92,7 @@ print("found card type %s\n", ether->type);
			ether->ea[0], ether->ea[1], ether->ea[2],
			ether->ea[3], ether->ea[4], ether->ea[5]);
		seprint(p, e, "\n");
		print(buf);
		pprint(buf);

		etherxx[ctlrno] = ether;
		return 0;

M bitsy/devpcmcia.c => bitsy/devpcmcia.c +0 -1
@@ 316,7 316,6 @@ pcmctlwrite(char *p, long n, ulong, PCMslot *sp)
		if(sp->cpresent & (1<<Rconfig)){
			cp = sp->attr;
			cp += sp->caddr + Rconfig;
print("writing configuration register (%lux) with index %d\n", cp, index);
			*cp = index;
		}


M bitsy/devpenmouse.c => bitsy/devpenmouse.c +1 -1
@@ 223,7 223,7 @@ penmouseread(Chan *c, void *va, long n, vlong)
		mouse.qfull = 0;

		/*
		 * No lock of the indicies is necessary here, because ri is only
		 * No lock of the indices is necessary here, because ri is only
		 * updated by us, and there is only one mouse reader
		 * at a time.  I suppose that more than one process
		 * could try to read the fd at one time, but such behavior

M bitsy/l.s => bitsy/l.s +1 -1
@@ 25,7 25,7 @@ _main:
	/* drain write buffer */
	MCR	CpMMU, 0, R0, C(CpCacheFlush), C(0xa), 4

	MOVW	$(MACHADDR+BY2PG), R13		/* stack */
	MOVW	$(MACHADDR+2*BY2PG), R13		/* stack */
	SUB	$4, R13				/* link */
	BL	main(SB)
	BL	exit(SB)

M bitsy/main.c => bitsy/main.c +0 -6
@@ 445,35 445,29 @@ void
outb(ulong a, uchar v)
{
	*(uchar*)a = v;
	µdelay(2);
}
void
outs(ulong a, ushort v)
{
	*(ushort*)a = v;
	µdelay(2);
}
void
outl(ulong a, ulong v)
{
	*(ulong*)a = v;
	µdelay(2);
}
uchar
inb(ulong a)
{
	µdelay(2);
	return *(uchar*)a;
}
ushort
ins(ulong a)
{
	µdelay(2);
	return *(ushort*)a;
}
ulong
inl(ulong a)
{
	µdelay(2);
	return *(ulong*)a;
}

M bitsy/trap.c => bitsy/trap.c +1 -1
@@ 406,7 406,7 @@ syscall(Ureg* ureg)
	int	i, scallnr;

	if((ureg->psr & PsrMask) != PsrMusr)
		panic("syscall: cs 0x%4.4uX\n", ureg->psr);
		panic("syscall: pc 0x%lux r14 0x%lux cs 0x%ux\n", ureg->pc, ureg->r14, ureg->psr);

	m->syscall++;
	up->insyscall = 1;

M port/portclock.c => port/portclock.c +6 -6
@@ 61,12 61,12 @@ portclock(Ureg *ur)

	checkalarms();
	if(m->machno == 0){
		ilock(&clock0lock);
		for(lp = clock0link; lp; lp = lp->link){
			lp->clock();
			splhi();
		}
		iunlock(&clock0lock);
		if(canlock(&clock0lock))
			for(lp = clock0link; lp; lp = lp->link){
				lp->clock();
				splhi();
			}
		unlock(&clock0lock);
	}

	m->inclockintr = 0;