~kris/9p

9hist

5a5232ebb88f2a3813d3f747f39a10c6652ae927 — David du Colombier 35 years ago 1465eb1
Plan 9 from Bell Labs 1991-05-29
2 files changed, 16 insertions(+), 3 deletions(-)

M port/proc.c
M port/sysproc.c
M port/proc.c => port/proc.c +6 -1
@@ 606,7 606,7 @@ kproc(char *name, void (*func)(void *), void *arg)
	/*
	 * Save time: only copy u-> data and useful stack
	 */
	clearmmucache();
	clearmmucache();	/* so child doesn't inherit any of your mappings */
	memmove(up, u, sizeof(User));
	n = USERADDR+BY2PG - (ulong)&lastvar;
	n = (n+32) & ~(BY2WD-1);	/* be safe & word align */


@@ 645,5 645,10 @@ kproc(char *name, void (*func)(void *), void *arg)
	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();
}

M port/sysproc.c => port/sysproc.c +10 -2
@@ 41,7 41,7 @@ sysfork(ulong *arg)
	/*
	 * Save time: only copy u-> data and useful stack
	 */
	clearmmucache();
	clearmmucache();	/* so child doesn't inherit any of your mappings */
	memmove((void*)upa, u, sizeof(User));
	n = USERADDR+BY2PG - (ulong)&lastvar;
	n = (n+32) & ~(BY2WD-1);	/* be safe & word align */


@@ 115,7 115,6 @@ sysfork(ulong *arg)
	 * Sched
	 */
	if(setlabel(&p->sched)){
		clearmmucache();
		u->p = p;
		p->state = Running;
		p->mach = m;


@@ 134,6 133,11 @@ sysfork(ulong *arg)
	memset(p->time, 0, sizeof(p->time));
	p->time[TReal] = MACHP(0)->ticks;
	memmove(p->text, u->p->text, NAMELEN);
	/*
	 *  since the bss/data segments are now shareable,
	 *  any mmu info about this process is now stale
	 *  (i.e. has bad properties) and has to be discarded.
	 */
	flushmmu();
	clearmmucache();
	ready(p);


@@ 351,6 355,10 @@ sysexec(ulong *arg)
		o->pte[i].page->va += (USTKTOP-TSTKTOP);
	unlock(o);

	/*
	 *  at this point, the mmu contains info about the old address
	 *  space and needs to be flushed
	 */
	flushmmu();
	clearmmucache();
	execpc(exec.entry);