~kris/9p

9hist

ace26b95915010cf8deb169f71f706eb937ab81b — David du Colombier 27 years ago c4b47bc
Plan 9 from Bell Labs 1999-08-11
10 files changed, 40 insertions(+), 40 deletions(-)

M alphapc/dat.h
M carrera/dat.h
M carrera/fns.h
M ip/tcp.c
M mpc/dat.h
M pc/dat.h
M port/chan.c
M port/proc.c
M port/sysfile.c
M port/taslock.c
M alphapc/dat.h => alphapc/dat.h +0 -1
@@ 33,7 33,6 @@ struct Lock
	Proc	*p;
	ulong	pid;
	ushort	isilock;
	ulong	glare;
};

struct Label

M carrera/dat.h => carrera/dat.h +0 -1
@@ 29,7 29,6 @@ struct Lock
	ulong	pc;
	Proc	*p;
	ushort	isilock;
	ulong	glare;
};

struct Label

M carrera/fns.h => carrera/fns.h +1 -0
@@ 36,6 36,7 @@ KMap*		kmap(Page*);
void		kmapinit(void);
void		kmapinval(void);
void		kunmap(KMap*);
void		links(void);
void		mmunewpage(Page*);
void		mouseintr(void);
int		newtlbpid(Proc*);

M ip/tcp.c => ip/tcp.c +1 -1
@@ 1971,7 1971,7 @@ void
addreseq(Tcpctl *tcb, Tcp *seg, Block *bp, ushort length)
{
	Reseq *rp, *rp1;
	int i, x;
	int i;

	rp = malloc(sizeof(Reseq));
	if(rp == nil){

M mpc/dat.h => mpc/dat.h +0 -1
@@ 30,7 30,6 @@ struct	Lock
	ulong	sr;
	Proc	*p;
	ushort	isilock;
	ulong	glare;
};

struct	Label

M pc/dat.h => pc/dat.h +0 -1
@@ 28,7 28,6 @@ struct Lock
	ulong	pc;
	Proc	*p;
	ushort	isilock;
	ulong	glare;
};

struct Label

M port/chan.c => port/chan.c +25 -18
@@ 19,6 19,7 @@ struct
}chanalloc;

#define SEP(c) ((c) == 0 || (c) == '/')
void cleancname(Cname*, int);

int
incref(Ref *r)


@@ 426,6 427,9 @@ domount(Chan *c)
			nc->mh = m;
			nc->xmh = m;
			incref(m);
			cnameclose(nc->name);
			nc->name = c->name;
			incref(c->name);
			cclose(c);
			c = nc;
			poperror();


@@ 459,7 463,16 @@ undomount(Chan *c)
		for(f = *h; f; f = f->hash) {
			for(t = f->mount; t; t = t->next) {
				if(eqchan(c, t->to, 1)) {
					/*
					 * We want to come out on the left hand side of the mount
					 * point using the element of the union that we entered on.
					 * To do this, find the element that has a from name of
					 * c->name->s.
					 */
					if(strcmp(t->head->from->name->s, c->name->s) != 0)
						continue;
					nc = cclone(t->head->from, 0);
					/* don't need to update nc->name because c->name is same! */
					cclose(c);
					c = nc;
					break;


@@ 473,21 486,6 @@ undomount(Chan *c)
}

int
walkname(Chan **cp, char *name, int domnt)
{
	Chan *c;

	if(walk(cp, name, domnt) < 0)
		return -1;
	c = *cp;
	if(c->name == nil)
		c->name = newcname(name);
	else
		c->name = addelem(c->name, name);
	return 0;
}

int
walk(Chan **cp, char *name, int domnt)
{
	Chan *c, *ac;


@@ 507,10 505,19 @@ walk(Chan **cp, char *name, int domnt)

	ac->flag &= ~CCREATE;	/* not inherited through a walk */
	if(devtab[ac->type]->walk(ac, name) != 0) {
		if(dotdot)
			*cp = undomount(*cp);
		/* walk succeeded: update name associated with *cp (ac) */
		c = *cp;
		if(c->name == nil)
			c->name = newcname(name);
		else
			c->name = addelem(c->name, name);
		
		if(dotdot){
			cleancname(c->name, c->name->s[0]=='#');	/* could be cheaper */
			*cp = undomount(c);
		}
		if(domnt)
			*cp = domount(*cp);
			*cp = domount(c);
		return 0;
	}


M port/proc.c => port/proc.c +5 -5
@@ 201,7 201,7 @@ loop:
	spllo();
	for(;;){
		idlehands();
		if((++(m->fairness) & 3) == 0){
		if((++(m->fairness) & 0x3) == 0){
			/*
			 *  once in a while, run process that's been waiting longest
			 *  regardless of movetime


@@ 235,7 235,7 @@ loop:
					continue;
				for(; p; p = p->rnext){
					if(p->mp == MACHP(m->machno)
					|| p->movetime < m->ticks)
					|| p->movetime < MACHP(0)->ticks)
						goto found;
				}
			}


@@ 249,7 249,7 @@ found:

	l = 0;
	for(p = rq->head; p; p = p->rnext){
		if(p->mp == MACHP(m->machno) || p->movetime < m->ticks)
		if(p->mp == MACHP(m->machno) || p->movetime < MACHP(0)->ticks)
			break;
		l = p;
	}


@@ 275,7 275,7 @@ found:

	p->state = Scheding;
	if(p->mp != MACHP(m->machno))
		p->movetime = m->ticks + HZ/10;
		p->movetime = MACHP(0)->ticks + HZ/10;
	p->mp = MACHP(m->machno);
	return p;
}


@@ 998,7 998,7 @@ scheddump(void)
		print("rq%ld:", rq-runq);
		for(p = rq->head; p; p = p->rnext)
			print(" %lud(%lud, %lud)", p->pid, m->ticks - p->readytime,
				m->ticks - p->movetime);
				MACHP(0)->ticks - p->movetime);
		print("\n");
		delay(150);
	}

M port/sysfile.c => port/sysfile.c +2 -2
@@ 147,9 147,9 @@ syspipe(ulong *arg)
		nexterror();
	}
	c[1] = cclone(c[0], 0);
	if(walkname(&c[0], "data", 1) < 0)
	if(walk(&c[0], "data", 1) < 0)
		error(Egreg);
	if(walkname(&c[1], "data1", 1) < 0)
	if(walk(&c[1], "data1", 1) < 0)
		error(Egreg);
	c[0] = d->open(c[0], ORDWR);
	c[1] = d->open(c[1], ORDWR);

M port/taslock.c => port/taslock.c +6 -10
@@ 35,7 35,7 @@ lock(Lock *l)

	pc = getcallerpc(&l);

lockstats.locks++;
	lockstats.locks++;
	if(tas(&l->key) == 0){
		l->pc = pc;
		l->p = up;


@@ 43,7 43,7 @@ lockstats.locks++;
		return;
	}

lockstats.glare++;
	lockstats.glare++;
	cansched = up != nil && up->state == Running;
	if(cansched){
		oldpri = up->priority;


@@ 53,7 53,7 @@ lockstats.glare++;
		oldpri = 0;

	for(;;){
lockstats.inglare++;
		lockstats.inglare++;
		i = 0;
		while(l->key){
			if(conf.nmach < 2 && cansched){


@@ 90,7 90,7 @@ ilock(Lock *l)
	int cansched;

	pc = getcallerpc(&l);
lockstats.locks++;
	lockstats.locks++;

	x = splhi();
	if(tas(&l->key) == 0){


@@ 101,11 101,7 @@ lockstats.locks++;
		return;
	}

lockstats.glare++;
if(l->glare++ > 10000){
print("glare %lux\n", l);
l->glare = 0;
}
	lockstats.glare++;
	cansched = up != nil && up->state == Running;
	if(cansched){
		oldpri = up->priority;


@@ 117,7 113,7 @@ l->glare = 0;
		panic("ilock: no way out: pc %uX\n", pc);

	for(;;){
lockstats.inglare++;
		lockstats.inglare++;
		splx(x);
		while(l->key)
			;