~kris/9p

9hist

491995f83b50c0dec38b58f39a931384fc1ca35d — David du Colombier 34 years ago a22bb86
Plan 9 from Bell Labs 1992-08-01
4 files changed, 59 insertions(+), 2 deletions(-)

M ss/dat.h
M ss/l.s
M ss/main.c
M ss/trap.c
M ss/dat.h => ss/dat.h +1 -0
@@ 64,6 64,7 @@ struct Conf
{
	int	nmach;		/* processors */
	int	nproc;		/* processes */
	int	ss2;		/* is a sparcstation 2 */
	ulong	npage0;		/* total physical pages of memory, bank 0 */
	ulong	npage1;		/* total physical pages of memory, bank 1 */
	ulong	base0;		/* base of bank 0 */

M ss/l.s => ss/l.s +48 -0
@@ 367,6 367,18 @@ TEXT	putw4(SB), $0
	MOVW	R8, (R7, 4)
	RETURN

TEXT	putw6(SB), $0

	MOVW	4(FP), R8
	MOVW	R8, (R7, 6)
	RETURN

TEXT	putw8(SB), $0

	MOVW	4(FP), R8
	MOVW	R8, (R7, 8)
	RETURN

TEXT	getw4(SB), $0

	MOVW	(R7, 4), R7


@@ 384,6 396,42 @@ TEXT	putwD(SB), $0
	MOVW	R8, (R7, 0xD)
	RETURN

TEXT	putw716(SB), $0

	MOVW	4(FP), R8
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	ADD	$BY2PG, R7
	MOVW	R8, (R7, 0x7)
	RETURN

TEXT	putwD16(SB), $0

	MOVW	4(FP), R8

M ss/main.c => ss/main.c +1 -0
@@ 205,6 205,7 @@ confinit(void)
	if(conf.nmach > MAXMACH)
		panic("confinit");

	conf.ss2 = 0;
	conf.npage0 = (4*1024*1024)/BY2PG;	/* BUG */
	conf.npage1 = (4*1024*1024)/BY2PG;	/* BUG */
	conf.base0 = 0;

M ss/trap.c => ss/trap.c +9 -2
@@ 132,6 132,9 @@ trap(Ureg *ur)

	user = !(ur->psr&PSRPSUPER);
	tbr = (ur->tbr&0xFFF)>>4;
	/* SS2 bug: flush cache line holding trap entry in table */
	if(conf.ss2)
		putw2(CACHETAGS+((TRAPS+16*tbr)&(VACSIZE-1)), 0);
	if(tbr > 16){			/* interrupt */
		if(u && u->p->state==Running){
			if(u->p->fpstate == FPactive){


@@ 237,7 240,8 @@ trapinit(void)
	a += 0x40000000;			/* CALL traplink(SB) */
	t = TRAPS;
	for(i=0; i<256; i++){
		*(ulong*)t = a;			/* CALL traplink(SB) */
		/* ss2: must flush cache line for table */
		*(ulong*)(t+0) = a;		/* CALL traplink(SB) */
		*(ulong*)(t+4) = 0xa7480000;	/* MOVW PSR, R19 */
		a -= 16/4;
		t += 16;


@@ 250,7 254,6 @@ trapinit(void)
	a += 0x40000000;
	*(ulong*)t = a;			/* CALL syscall(SB) */
	*(ulong*)(t+4) = 0xa7480000;	/* MOVW PSR, R19 */

	puttbr(TRAPS);
}



@@ 534,6 537,10 @@ syscall(Ureg *aur)
	u->p->insyscall = 1;
	u->p->pc = ur->pc;

	/* SS2 bug: flush cache line holding trap entry in table */
	if(conf.ss2)
		putw2(CACHETAGS+((TRAPS+16*128)&(VACSIZE-1)), 0);

	/*
	 * since the system call interface does not
	 * guarantee anything about registers,