M pc/devfloppy.c => pc/devfloppy.c +2 -1
@@ 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
M pc/devhard.c => pc/devhard.c +1 -1
@@ 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;
}
M port/proc.c => port/proc.c +11 -1
@@ 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
M port/sysproc.c => port/sysproc.c +7 -0
@@ 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;