From 85382fd1111bc83f2c79e3e3b40de8010ee69b4a Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Fri, 26 Apr 2002 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2002-04-26 --- alphapc/l.s | 2 +- pc/trap.c | 4 ---- port/devenv.c | 2 +- port/fault.c | 7 +++++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/alphapc/l.s b/alphapc/l.s index abc5ecce2b7dd8b68b9d96ba49bbaf9a1021b57b..9093b93caf7671daf08709877dad1196e89e05f7 100644 --- a/alphapc/l.s +++ b/alphapc/l.s @@ -110,7 +110,7 @@ TEXT spldone(SB), $0 TEXT islo(SB), $0 CALL_PAL $PALrdps AND $IPL, R0 - XOR $IPL, R0 + XOR $HI_IPL, R0 RET TEXT mb(SB), $-8 diff --git a/pc/trap.c b/pc/trap.c index a3f103f8c1565b4ff369d94294e5d2ac7adb75b9..c8d2bccd21f79faf99315ada6f736066f74aab97 100644 --- a/pc/trap.c +++ b/pc/trap.c @@ -537,10 +537,6 @@ syscall(Ureg* ureg) if((ureg->cs & 0xFFFF) != UESEL) panic("syscall: cs 0x%4.4luX\n", ureg->cs); - /* check syscall has an empty kernel stack */ - if(up->kstack + KSTACK - (char*)ureg > 512) - panic("syscall: stack %ld\n", up->kstack + KSTACK - (char*)ureg); - m->syscall++; up->insyscall = 1; up->pc = ureg->pc; diff --git a/port/devenv.c b/port/devenv.c index bf6678038285fc612e7c7f6e7889d65cb888f871..a922193587c7e986e6956683f97cf024cc80fcd6 100644 --- a/port/devenv.c +++ b/port/devenv.c @@ -228,7 +228,7 @@ envread(Chan *c, void *a, long n, vlong off) rlock(eg); e = envlookup(eg, nil, c->qid.path); if(e == 0) { - rlock(eg); + runlock(eg); error(Enonexist); } diff --git a/port/fault.c b/port/fault.c index 787aeed4bb27442af9286fa2621e5014bf60e79b..61fbc134b61d79c865fc8e4dab2e0f0834c62059 100644 --- a/port/fault.c +++ b/port/fault.c @@ -341,15 +341,18 @@ vmemchr(void *s, int c, int n) char *t; ulong a; + loop: a = (ulong)s; m = BY2PG - (a & (BY2PG-1)); if(m < n){ - t = vmemchr(s, c, m); + t = memchr(s, c, m); if(t) return t; if((a & KZERO) != KZERO) validaddr(a+m, 1, 0); - return vmemchr((void*)(a+m), c, n-m); + s = (void*)(a+m); + n -= m; + goto loop; } /* * All in one page