~kris/9p

9hist

60cf3ab0d8cb7f519d16489d272fdf6e496b643f — David du Colombier 34 years ago eec3f72
Plan 9 from Bell Labs 1991-10-05
5 files changed, 39 insertions(+), 26 deletions(-)

M pc/devfloppy.c
M pc/mmu.c
M pc/trap.c
M port/proc.c
M port/segment.c
M pc/devfloppy.c => pc/devfloppy.c +1 -1
@@ 633,7 633,7 @@ floppysense(void)
	if(floppycmd() < 0)
		return -1;
	if(floppyresult() < 2){
print("can't read sense response\n");
/*print("can't read sense response\n");/**/
		fl.confused = 1;
		return -1;
	}

M pc/mmu.c => pc/mmu.c +11 -2
@@ 297,6 297,7 @@ putmmu(ulong va, ulong pa, Page *pg)
	ulong *pt;
	Proc *p;
	char err[64];
	int x;

	if(u==0)
		panic("putmmu");


@@ 313,8 314,16 @@ putmmu(ulong va, ulong pa, Page *pg)
	 *  into it.
	 */
	if(p->mmutop == 0){
		p->mmutop = mmugetpage(0);
		memmove((void*)p->mmutop->va, (void*)ktoppg.va, BY2PG);
		/*
		 *  N.B. The assignment to pg is neccessary.
		 *  We can't assign to p->mmutop until after
		 *  copying ktoppg into the new page since we might
		 *  get scheded in this code and p->mmutop will be
		 *  pointing to a bad map.
		 */
		pg = mmugetpage(0);
		memmove((void*)pg->va, (void*)ktoppg.va, BY2PG);
		p->mmutop = pg;
	}
	top = (ulong*)p->mmutop->va;


M pc/trap.c => pc/trap.c +6 -2
@@ 173,11 173,15 @@ trap(Ureg *ur)
{
	int v;
	int c;
	static int spuriousfloppy;

	v = ur->trap;
	if(v>=256 || ivec[v] == 0){
		panic("bad trap type %d %lux %lux %lux\n", v, ur->pc, int0mask, int1mask);
		return;
		if(v == 10 && spuriousfloppy == 0){
			v = Floppyvec;
			spuriousfloppy = 1;
		}else
			panic("bad trap type %d %lux %lux %lux\n", v, ur->pc, int0mask, int1mask);
	}

	/*

M port/proc.c => port/proc.c +21 -20
@@ 534,26 534,27 @@ pexit(char *exitstr, int freemem)
	else
		wq->w.msg[0] = '\0';

	/* Find my parent */
	p = c->parent;

	lock(&p->exl);
	/* My parent still alive */
	if(p->pid == c->parentpid && p->state != Broken && p->nwait < 128) {	
		p->nchild--;
		p->time[TCUser] += c->time[TUser] + c->time[TCUser];
		p->time[TCSys] += c->time[TSys] + c->time[TCSys];

		wq->next = p->waitq;
		p->waitq = wq;
		p->nwait++;
		unlock(&p->exl);

		wakeup(&p->waitr);
	}
	else {
		unlock(&p->exl);
		freewaitq(wq);
	if(c->kp == 0) {
		/* Find my parent */
		p = c->parent;
		lock(&p->exl);
		/* My parent still alive */
		if(p->pid == c->parentpid && p->state != Broken && p->nwait < 128) {	
			p->nchild--;
			p->time[TCUser] += c->time[TUser] + c->time[TCUser];
			p->time[TCSys] += c->time[TSys] + c->time[TCSys];
	
			wq->next = p->waitq;
			p->waitq = wq;
			p->nwait++;
			unlock(&p->exl);
	
			wakeup(&p->waitr);
		}
		else {
			unlock(&p->exl);
			freewaitq(wq);
		}
	}

	if(!freemem)

M port/segment.c => port/segment.c +0 -1
@@ 346,7 346,6 @@ ibrk(ulong addr, int seg)
	newtop = PGROUND(addr);
	newsize = (newtop-s->base)/BY2PG;
	if(newtop < s->top) {
		print("down brk\n");
		mfreeseg(s, newtop, (s->top-newtop)/BY2PG);
		qunlock(&s->lk);
		return 0;