~kris/9p

9hist

5283bc4fca96dc1d66e9e184a58fe315d2e2c7c0 — David du Colombier 27 years ago 69e8f26
Plan 9 from Bell Labs 1999-05-22
7 files changed, 41 insertions(+), 6 deletions(-)

M alphapc/mem.h
M carrera/mem.h
M ip/udp.c
M mpc/mem.h
M pc/devlml.c
M pc/mem.h
M port/qio.c
M alphapc/mem.h => alphapc/mem.h +1 -0
@@ 15,6 15,7 @@
#define	PGSHIFT		13			/* log(BY2PG) */
#define 	ROUND(s, sz)	(((s)+(sz-1))&~(sz-1))
#define 	PGROUND(s)	ROUND(s, BY2PG)
#define BLOCKALIGN	8

#define	BY2PTE		8			/* bytes per pte entry */
#define	PTE2PG		(BY2PG/BY2PTE)	/* pte entries per page */

M carrera/mem.h => carrera/mem.h +1 -0
@@ 18,6 18,7 @@

#define	MAXMACH		1			/* max # cpus system can run */
#define	KSTACK		4096			/* Size of kernel stack */
#define BLOCKALIGN	8

/*
 * Time

M ip/udp.c => ip/udp.c +2 -1
@@ 215,7 215,8 @@ udpkick(Conv *c, int)
		hnputs(uh->udpdport, c->rport);
		if(ipcmp(c->laddr, IPnoaddr) == 0)
			findlocalip(f, c->laddr, c->raddr);
		v6tov4(uh->udpsrc, c->laddr);
		if(v6tov4(uh->udpsrc, c->laddr) < 0)
			memset(uh->udpsrc, 0, sizeof(uh->udpsrc));
		break;
	}
	hnputs(uh->udpsport, c->lport);

M mpc/mem.h => mpc/mem.h +1 -0
@@ 17,6 17,7 @@
#define PGROUND(s)	ROUND(s, BY2PG)
#define	CACHELINELOG	4
#define CACHELINESZ	(1<<CACHELINELOG)
#define BLOCKALIGN	CACHELINESZ

#define	MHz	1000000


M pc/devlml.c => pc/devlml.c +22 -0
@@ 647,6 647,10 @@ static void lmlintr(Ureg *, void *);
static void
lmlreset(void)
{
// LMLSEG
	Physseg segbuf;
	Physseg segreg;
//
	ulong regpa;
	int i;



@@ 700,6 704,24 @@ lmlreset(void)
	lmlmap.statcom = PADDR(codeData->statCom);
	lmlmap.codedata = (ulong)codeData;

// LMLSEG
	memset(&segbuf, 0, sizeof(segbuf));
	segbuf.attr = SG_PHYSICAL;
	segbuf.name = smalloc(NAMELEN);
	snprint(segbuf.name, NAMELEN, "lmlmjpg");
	segbuf.pa = PADDR(codeData);
	segbuf.size = sizeof(CodeData);
	addphysseg(&segbuf);

	memset(&segreg, 0, sizeof(segreg));
	segreg.attr = SG_PHYSICAL;
	segreg.name = smalloc(NAMELEN);
	snprint(segreg.name, NAMELEN, "lmlregs");
	segreg.pa = (ulong)regpa;
	segreg.size = pcidev->mem[0].size;
	addphysseg(&segreg);
//

	return; 
}


M pc/mem.h => pc/mem.h +1 -0
@@ 14,6 14,7 @@
#define	PGSHIFT		12			/* log(BY2PG) */
#define ROUND(s, sz)	(((s)+((sz)-1))&~((sz)-1))
#define PGROUND(s)	ROUND(s, BY2PG)
#define BLOCKALIGN	8

#define	MAXMACH		8			/* max # cpus system can run */
#define KSTACK		4096			/* Size of kernel stack */

M port/qio.c => port/qio.c +13 -5
@@ 120,19 120,27 @@ allocb(int size)
	ulong addr;
	int n;

	n = sizeof(Block) + size + (BY2V-1);
	n = sizeof(Block) + size;
	b = mallocz(n+Hdrspc, 0);
	if(b == 0)
		exhausted("Blocks");
	memset(b, 0, sizeof(Block));

	/* align start of data portion by rounding up */
	addr = (ulong)b;
	addr = ROUND(addr + sizeof(Block), BY2V);
	addr = ROUND(addr + sizeof(Block), BLOCKALIGN);
	b->base = (uchar*)addr;

	/* align end of data portion by rounding down */
	b->lim = ((uchar*)b) + msize(b);
	b->rp = b->base;
	n = b->lim - b->base - size;
	b->rp += n & ~(BY2V-1);
	addr = (ulong)(b->lim);
	addr = addr & ~(BLOCKALIGN-1);
	b->lim = (uchar*)addr;

	/* leave sluff at beginning for added headers */
	b->rp = b->lim - ROUND(size, BLOCKALIGN);
	if(b->rp < b->base)
		panic("allocb");
	b->wp = b->rp;

	return b;