M port/segment.c => port/segment.c +3 -3
@@ 120,7 120,7 @@ dupseg(Segment **seg, int segno, int share)
s = seg[segno];
switch(s->type&SG_TYPE) {
- case SG_TEXT: /* New segment shares pte set */
+ case SG_TEXT: /* New segment shares pte set */
case SG_SHARED:
case SG_PHYSICAL:
case SG_SHDATA:
@@ 132,7 132,7 @@ dupseg(Segment **seg, int segno, int share)
n = newseg(s->type, s->base, s->size);
break;
- case SG_BSS: /* Just copy on write */
+ case SG_BSS: /* Just copy on write */
qlock(&s->lk);
if(share && s->ref == 1) {
s->type = (s->type&~SG_TYPE)|SG_SHARED;
@@ 143,7 143,7 @@ dupseg(Segment **seg, int segno, int share)
n = newseg(s->type, s->base, s->size);
break;
- case SG_DATA: /* Copy on write plus demand load info */
+ case SG_DATA: /* Copy on write plus demand load info */
if(segno == TSEG)
return data2txt(s);
M port/sysproc.c => port/sysproc.c +6 -8
@@ 629,9 629,9 @@ sysbrk_(ulong *arg)
long
sysrendezvous(ulong *arg)
{
- Proc *p, **l;
- int s, tag;
+ int tag;
ulong val;
+ Proc *p, **l;
tag = arg[0];
l = &REND(up->pgrp, tag);
@@ 642,8 642,8 @@ sysrendezvous(ulong *arg)
*l = p->rendhash;
val = p->rendval;
p->rendval = arg[1];
- /* Easy race avoidance */
- while(p->state != Rendezvous)
+
+ while(p->mach != 0)
;
ready(p);
unlock(up->pgrp);
@@ 657,12 657,10 @@ sysrendezvous(ulong *arg)
up->rendval = arg[1];
up->rendhash = *l;
*l = up;
-
- s = splhi();
- unlock(up->pgrp);
up->state = Rendezvous;
+ unlock(up->pgrp);
+
sched();
- splx(s);
return up->rendval;
}