From f8ab9f770b7f8604dc92052b04752827be39a660 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 19 Sep 1991 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1991-09-19 --- pc/devfloppy.c | 3 ++- pc/devhard.c | 2 +- port/proc.c | 12 +++++++++++- port/sysproc.c | 7 +++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/pc/devfloppy.c b/pc/devfloppy.c index 753b8de70fef7ff1fab599b288f0fa8a6f5f5a88..91c5bd48e324a75bbcbd48ef956d4e17e4d3e3fb 100644 --- a/pc/devfloppy.c +++ b/pc/devfloppy.c @@ -409,7 +409,8 @@ floppykproc(void *a) Drive *dp; int disp = 0; - waserror(); + while(waserror()) + ; for(;;){ for(dp = floppy.d; dp < &floppy.d[conf.nfloppy]; dp++){ if(dp->motoron && TK2SEC(m->ticks - dp->lasttouched) > 5 diff --git a/pc/devhard.c b/pc/devhard.c index a3ec545eda9a9ff891e8726f0a4c3b3583a48d38..884ed9e4b6efdb3cf89c27cce62c02378fd2fc50 100644 --- a/pc/devhard.c +++ b/pc/devhard.c @@ -174,7 +174,7 @@ hardgen(Chan *c, Dirtab *tab, long ntab, long s, Dir *dirp) name[NAMELEN] = 0; qid.path = MKQID(drive, s); l = (pp->end - pp->start) * dp->bytes; - devdir(c, qid, name, l, 0600, dirp); + devdir(c, qid, name, l, 0666, dirp); return 1; } diff --git a/port/proc.c b/port/proc.c index c9c7b465d23dd437178a88fa8b2f9639f5cf9c2d..00d6fed346ce1de2729d6aaa15860128d69fa28c 100644 --- a/port/proc.c +++ b/port/proc.c @@ -732,6 +732,15 @@ kproc(char *name, void (*func)(void *), void *arg) * Sched */ if(setlabel(&p->sched)){ + /* + * use u->p instead of p, because we + * don't trust the compiler, after a + * gotolabel, to find the correct contents + * of a local variable. Passed parameters + * (func & arg) are a bit safer since we + * don't play with them anywhere else. + */ + p = u->p; p->state = Running; p->mach = m; m->proc = p; @@ -756,13 +765,14 @@ kproc(char *name, void (*func)(void *), void *arg) p->parent = 0; memset(p->time, 0, sizeof(p->time)); p->time[TReal] = MACHP(0)->ticks; - ready(p); /* * since the bss/data segments are now shareable, * any mmu info about this process is now stale * and has to be discarded. */ flushmmu(); + clearmmucache(); + ready(p); } void diff --git a/port/sysproc.c b/port/sysproc.c index 165a90cdf0f5c811038cc6f1cd25f403ae83a191..61137370b3b8f9a3347a0d77b84bdf87de65d6f6 100644 --- a/port/sysproc.c +++ b/port/sysproc.c @@ -103,6 +103,13 @@ rfork(ulong flag) * Sched */ if(setlabel(&p->sched)){ + /* + * use u->p instead of p, because we + * don't trust the compiler, after a + * gotolabel, to find the correct contents + * of a local variable. + */ + p = u->p; p->state = Running; p->mach = m; m->proc = p;