From 0b8e08158453628da46a239769c1ebb827683d1a Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 6 Dec 2000 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2000-12-06 --- bitsy/devether.c | 7 ++++--- bitsy/devpcmcia.c | 1 - bitsy/devpenmouse.c | 2 +- bitsy/l.s | 2 +- bitsy/main.c | 6 ------ bitsy/trap.c | 2 +- port/portclock.c | 12 ++++++------ 7 files changed, 13 insertions(+), 19 deletions(-) diff --git a/bitsy/devether.c b/bitsy/devether.c index aef2478165aa41ad36ca63eabfccab26664454aa..bfd54db482e19eb220748d46cf8781c5f6df18db 100644 --- a/bitsy/devether.c +++ b/bitsy/devether.c @@ -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; diff --git a/bitsy/devpcmcia.c b/bitsy/devpcmcia.c index 9be4df36238a94ca54bcad7c024929f08c7ee8db..681e97715d2485638b073eb08bbdff1e94703544 100644 --- a/bitsy/devpcmcia.c +++ b/bitsy/devpcmcia.c @@ -316,7 +316,6 @@ pcmctlwrite(char *p, long n, ulong, PCMslot *sp) if(sp->cpresent & (1<attr; cp += sp->caddr + Rconfig; -print("writing configuration register (%lux) with index %d\n", cp, index); *cp = index; } diff --git a/bitsy/devpenmouse.c b/bitsy/devpenmouse.c index 24d60803ba74fcf605a25bb0b75a90f9e9ef499a..81cef2c13723d0c316c0629e2f1b3b8ea246f8c7 100644 --- a/bitsy/devpenmouse.c +++ b/bitsy/devpenmouse.c @@ -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 diff --git a/bitsy/l.s b/bitsy/l.s index 0afdb8bafe088fc8f377d16e3b8d48806a22a481..69718f0c37059e9e80f3651f54d8974df90b056f 100644 --- a/bitsy/l.s +++ b/bitsy/l.s @@ -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) diff --git a/bitsy/main.c b/bitsy/main.c index a86c81bbb59a0963a760ab0839948a6007271828..8a047f7d159cdd1ef4f14115cbe3f05fd2583bb2 100644 --- a/bitsy/main.c +++ b/bitsy/main.c @@ -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; } diff --git a/bitsy/trap.c b/bitsy/trap.c index c80ce294d2aeb64deee1c9cd380ce5d97e37b504..491f4a8d20f188a933ebe3c716c2fa90f6e81907 100644 --- a/bitsy/trap.c +++ b/bitsy/trap.c @@ -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; diff --git a/port/portclock.c b/port/portclock.c index 78dbd20036c454b1487327b3816e9bb115c413ac..3204fffbb8097a332e81481ece427244806b0033 100644 --- a/port/portclock.c +++ b/port/portclock.c @@ -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;