~kris/9p

9hist

185aaddeb7c5f717988d3f97f3b4f29b9c30b0cb — David du Colombier 34 years ago f56d2fc
Plan 9 from Bell Labs 1992-01-03
9 files changed, 9 insertions(+), 61 deletions(-)

M gnot/dat.h
M gnot/mmu.c
M pc/main.c
M pc/trap.c
M port/fault.c
M port/ipdat.h
M port/proc.c
M port/stil.c
M port/sysproc.c
M gnot/dat.h => gnot/dat.h +0 -19
@@ 5,7 5,6 @@ typedef struct KMap	KMap;
typedef struct Label	Label;
typedef struct Lock	Lock;
typedef struct MMU	MMU;
typedef struct MMUCache	MMUCache;
typedef struct Mach	Mach;
typedef struct PMMU	PMMU;
typedef struct Portpage	Portpage;


@@ 146,19 145,6 @@ struct Mach
	int	stack[1];
};

struct MMU
{
	ulong	va;
	ulong	pa;
};

#define NMMU 16
struct MMUCache
{
	ulong	next;
	MMU	mmu[NMMU];
};

/*
 *  gnot bus ports
 */


@@ 211,11 197,6 @@ struct User
	void	*dbgreg;
	ushort	svsr;
	ushort	svvo;
	/*
	 *  mmu cache for preloading MMU.
	 *  should be replaced by software TLB? -- presotto
	 */
	MMUCache mc;
};

struct

M gnot/mmu.c => gnot/mmu.c +0 -34
@@ 32,7 32,6 @@ mapstack(Proc *p)

	if(p->newtlb) {
		flushmmu();
		clearmmucache();
		p->newtlb = 0;
	}



@@ 42,20 41,6 @@ mapstack(Proc *p)
	 */
	if(!p->kp && p!=m->lproc){
		flushmmu();

		/*
		 *  preload the MMU with the last (up to) NMMU user entries
		 *  previously faulted into it for this process.
		 */
		mn = &u->mc.mmu[u->mc.next&(NMMU-1)];
		me = &u->mc.mmu[NMMU];
		if(u->mc.next >= NMMU){
			for(mm = mn; mm < me; mm++)
				UMAP[mm->va] = mm->pa;
		}
		for(mm = u->mc.mmu; mm < mn; mm++)
			UMAP[mm->va] = mm->pa;

		m->lproc = p;
	}
}


@@ 82,17 67,6 @@ putmmu(ulong tlbvirt, ulong tlbphys, Page *p)
		panic("putmmu");
	tlbphys |= VTAG(tlbvirt)<<24;
	tlbvirt = (tlbvirt&0x003FE000L)>>2;
	if(u){
		MMU *mp;
		int s;

		s = splhi();
		mp = &(u->mc.mmu[u->mc.next&(NMMU-1)]);
		mp->pa = tlbphys;
		mp->va = tlbvirt;
		u->mc.next++;
		splx(s);
	}
	UMAP[tlbvirt] = tlbphys;
}



@@ 105,14 79,6 @@ flushmmu(void)
}

void
clearmmucache(void)
{
	if(u == 0)
		panic("clearmmucache");
	u->mc.next = 0;
}

void
kmapinit(void)
{
	KMap *k;

M pc/main.c => pc/main.c +1 -1
@@ 201,7 201,7 @@ confinit(void)
	conf.maxialloc = 2*1024*1024;

	mul = 1;
	conf.nproc = 30 + 20*mul;
	conf.nproc = 30 + i*5;
	conf.npgrp = conf.nproc/2;
	conf.nseg = conf.nproc*3;
	conf.npagetab = (conf.nseg*14)/10;

M pc/trap.c => pc/trap.c +4 -2
@@ 294,6 294,9 @@ execregs(ulong entry, ulong ssize, ulong nargs)
 */
#include "../port/systab.h"

/*
 *  syscall is called spllo()
 */
long
syscall(Ureg *ur)
{


@@ 310,7 313,6 @@ syscall(Ureg *ur)
	/*
	 *  do something about floating point!!!
	 */

	ax = ur->ax;
	sp = ur->usp;
	u->nerrlab = 0;


@@ 340,7 342,7 @@ syscall(Ureg *ur)
	if(ax == NOTED)
		noted(ur, *(ulong*)(sp+BY2WD));

	splhi();
	splhi(); /* avoid interrupts during the iret */
	if(ax!=FORK && (u->p->procctl || u->nnote))
		notify(ur);
	return ret;

M port/fault.c => port/fault.c +1 -1
@@ 76,7 76,7 @@ fixfault(Segment *s, ulong addr, int read, int doputmmu)
	case SG_BSS:
	case SG_STACK:	
			/* Zero fill on demand */
		if(*pg == 0) {			
		if(*pg == 0) {
			if(new == 0 && (new = newpage(1, &s, addr)) && s == 0)
				return -1;
			*pg = new;

M port/ipdat.h => port/ipdat.h +1 -0
@@ 106,6 106,7 @@ struct Ilcb				/* Control block */
	Block	*outoforder;
	int	oblks;			/* Number of blocks in queue */

	Lock	nxl;
	ulong	next;			/* Id of next to send */
	ulong	recvd;			/* Last packet received */
	ulong	start;			/* Local start id */

M port/proc.c => port/proc.c +0 -1
@@ 682,7 682,6 @@ kproc(char *name, void (*func)(void *), void *arg)
	/*
	 * Save time: only copy u-> data and useful stack
	 */
	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 */

M port/stil.c => port/stil.c +2 -0
@@ 158,7 158,9 @@ iloput(Queue *q, Block *bp)
	hnputs(ih->illen, dlen+IL_HDRSIZE);
	hnputs(ih->ilsrc, ipc->psrc);
	hnputs(ih->ildst, ipc->pdst);
	lock(&ic->nxl);
	hnputl(ih->ilid, ic->next++);
	unlock(&ic->nxl);
	hnputl(ih->ilack, ic->recvd);
	ih->iltype = Ildata;
	ih->ilspec = 0;

M port/sysproc.c => port/sysproc.c +0 -3
@@ 55,7 55,6 @@ rfork(ulong flag)
	upa = VA(k);

	/* Save time: only copy u-> data and useful stack */
	clearmmucache();
	memmove((void*)upa, u, sizeof(User));
	n = USERADDR+BY2PG - (ulong)&lastvar;
	n = (n+32) & ~(BY2WD-1);	/* be safe & word align */


@@ 135,7 134,6 @@ rfork(ulong flag)
	 *  (i.e. has bad properties) and has to be discarded.
	 */
	flushmmu();
	clearmmucache();
	ready(p);
	return pid;
}


@@ 344,7 342,6 @@ sysexec(ulong *arg)
	 *  space and needs to be flushed
	 */
	flushmmu();
	clearmmucache();
	qlock(&p->debug);
	u->nnote = 0;
	u->notify = 0;