~kris/9p

9hist

f2c288ae6bbb621ccd53ada6bdae389fc837317b — David du Colombier 24 years ago 32b8c41
Plan 9 from Bell Labs 2001-12-22
5 files changed, 43 insertions(+), 24 deletions(-)

M mtx/dat.h
M mtx/fns.h
M mtx/l.s
M mtx/mmu.c
M pc/pcmciamodem.c
M mtx/dat.h => mtx/dat.h +1 -16
@@ 93,7 93,7 @@ struct Conf
#define NCOLOR 1
struct PMMU
{
	int	pidonmach[MAXMACH];
	int	mmupid;
};

/*


@@ 170,21 170,6 @@ struct
}active;

/*
 *	Implementation-dependant functions (outside of PPC architecture proper).
 *	Called PCArch because that's what mkdevc calls it (for the PC).
 */
struct PCArch
{
	char*	id;
	int	(*ident)(void);		/* this should be in the model */

	void	(*intrinit)(void);
	int	(*intrenable)(Vctl*);
	int	(*intrvecno)(int);
	int	(*intrdisable)(int);
};

/*
 *  a parsed plan9.ini line
 */
#define NISAOPT		8

M mtx/fns.h => mtx/fns.h +1 -1
@@ 93,7 93,7 @@ void	procsave(Proc*);
void	procsetup(Proc*);
void	putdec(ulong);
void	putmsr(ulong);
void	putcasid(ulong);
void	putsdr1(ulong);
void	raveninit(void);
void	screeninit(void);
int	screenprint(char*, ...);			/* debugging */

M mtx/l.s => mtx/l.s +4 -0
@@ 277,6 277,10 @@ TEXT	putmsr(SB), $0
	MSRSYNC
	RETURN

TEXT	putsdr1(SB), $0
	MOVW	R3, SPR(SDR1)
	RETURN

TEXT	eieio(SB), $0
	EIEIO
	RETURN

M mtx/mmu.c => mtx/mmu.c +32 -5
@@ 5,9 5,26 @@
#include	"fns.h"
#include	"io.h"

void *ptab;
ulong ptabsize;

void
mmuinit(void)
{
	int lhash, mem;
	extern ulong memsize;	/* passed in from ROM monitor */

	/* heuristically size the hash table */
	lhash = 10;			/* log of hash table size */
	mem = (1<<23);
	while(mem < memsize) {
		lhash++;
		mem <<= 1;
	}

	ptabsize = (1<<(lhash+6));
	ptab = xspanalloc(ptabsize, 0, ptabsize);
	putsdr1(PADDR(ptab) | ((1<<(lhash-10))-1));
}

void


@@ 27,23 44,33 @@ flushmmu(void)
void
mmuswitch(Proc *p)
{
	int tp;
	int mp;

	if(p->newtlb) {
		memset(p->pidonmach, 0, sizeof p->pidonmach);
		p->mmupid = 0;
		p->newtlb = 0;
	}
	tp = p->pidonmach[m->machno];
//	putcasid(tp);
	mp = p->mmupid;
	if(mp == 0)
		mp = newmmupid();

//	for(i = 0; i < 8; i++)
//		putsr(i, 
}

void
mmurelease(Proc* p)
{
	memset(p->pidonmach, 0, sizeof p->pidonmach);
	p->mmupid = 0;
}

void
putmmu(ulong va, ulong pa, Page *pg)
{
}

int
newmmupid(void)
{
	return -1;
}

M pc/pcmciamodem.c => pc/pcmciamodem.c +5 -2
@@ 31,7 31,7 @@ void
pcmciamodemlink(void)
{
	ISAConf isa;
	int i, j, slot, com2used;
	int i, j, slot, com2used, usingcom2;

	i = 0;
	com2used = 0;


@@ 46,18 46,21 @@ pcmciamodemlink(void)
			memset(&isa, 0, sizeof(isa));
		}

		usingcom2 = 0;
		if (isa.irq == 0 && isa.port == 0) {
			if (com2used == 0) {
				/* default is COM2 */
				isa.irq = 3;
				isa.port = 0x2F8;
				com2used++;
				usingcom2 = 1;
			} else
				break;
		}

		slot = pcmspecial(modems[j], &isa);
		if(slot >= 0){
			if(usingcom2)
				com2used = 1;
			if(ioalloc(isa.port, 8, 0, modems[j]) < 0)
				print("%s port %lux already in use\n", modems[j], isa.port);
			print("%s in pcmcia slot %d port 0x%lux irq %lud\n",