~kris/9p

9hist

473cfb231b723542e5e8eef6ba47e4342a6e902c — David du Colombier 32 years ago 336868f
Plan 9 from Bell Labs 1993-12-14
8 files changed, 25 insertions(+), 15 deletions(-)

M carrera/dat.h
M carrera/fns.h
M carrera/main.c
M pc/dat.h
M pc/fns.h
M port/portdat.h
M port/proc.c
M power/dat.h
M carrera/dat.h => carrera/dat.h +2 -1
@@ 117,7 117,8 @@ struct Mach
	uchar	ktlbnext;
	int	speed;			/* cpu speed */
	ulong	delayloop;		/* for the delay() routine */
	Schedq	runq;
	Schedq	hiq;
	Schedq	loq;

	int	pfault;
	int	cs;

M carrera/fns.h => carrera/fns.h +2 -1
@@ 3,6 3,7 @@
void	DEBUG(void);

void	addportintr(int(*)(void));
#define	affinity(x) (MACHP(0))
void	allflush(void*, ulong);
void	arginit(void);
int	busprobe(ulong);


@@ 67,7 68,7 @@ void	prflush(void);
ulong	prid(void);
void	printinit(void);
#define	procrestore(p)
#define	procsave(p)
void	procsave(Proc*)
#define	procsetup(p)	((p)->fpstate = FPinit)
void	purgetlb(int);
int	putnvram(ulong, void*, int);

M carrera/main.c => carrera/main.c +8 -0
@@ 415,3 415,11 @@ rdbginit(void)
{
	memmove((void*)0xA001C000, rdbgcode, rdbglen);
}

void
procsave(Proc *p)
{
	/* keep track of tlbfaults */
	up->counter[TLBCNTR] += m->tlbfault - m->otlbfault;
	m->otlbfault = m->tlbfault;
}

M pc/dat.h => pc/dat.h +2 -2
@@ 123,10 123,10 @@ struct Mach
	Label	sched;			/* scheduler wakeup */
	Lock	alarmlock;		/* access to alarm list */
	void	*alarm;			/* alarms bound to this clock */
	Schedq	runq;
	Schedq	hiq;
	Schedq	loq;

	int	tlbfault;
	int	otlbfault;
	int	tlbpurge;
	int	pfault;
	int	cs;

M pc/fns.h => pc/fns.h +1 -0
@@ 1,6 1,7 @@
#include "../port/portfns.h"

void	addconf(char*, char*);
#define	affinity(x) (MACHP(0))
void	bbinit(void);
void	bigcursor(void);
void	bootargs(ulong);

M port/portdat.h => port/portdat.h +1 -1
@@ 556,7 556,7 @@ struct Proc
	int	(*notify)(void*, char*);

	Mach	*mp;		/* machine this process last ran on */
	ulong	mpfault;	/* page faults on that mach at sched time */
	ulong	affinity;	/* affinity counter for that mach */

	void	*ureg;		/* User registers for notes */
	void	*dbgreg;	/* User registers for devproc */

M port/proc.c => port/proc.c +7 -9
@@ 83,8 83,6 @@ sched(void)
		/* statistics */
		m->cs++;
		up->counter[CSCNTR]++;
		up->counter[TLBCNTR] += m->tlbfault - m->otlbfault;
		m->otlbfault = m->tlbfault;

		procsave(up);
		if(setlabel(&up->sched)) {


@@ 105,7 103,7 @@ sched(void)
int
anyready(void)
{
	return runhiq.head != 0 || runloq.head != 0;
	return m->hiq.head != 0 || m->loq.head != 0;
}

void


@@ 117,9 115,9 @@ ready(Proc *p)
	s = splhi();

	if(p->state == Running)
		rq = &runloq;
		rq = &m->loq;
	else
		rq = &runhiq;
		rq = &affinity(p)->hiq;

	lock(&runhiq);
	p->rnext = 0;


@@ 143,14 141,14 @@ runproc(void)

loop:
	spllo();
	while(runhiq.head == 0 && runloq.head == 0)
	while(m->hiq.head == 0 && m->loq.head == 0)
		;
	splhi();

	if(runhiq.head)
		rq = &runhiq;
	if(m->hiq.head)
		rq = &m->hiq;
	else
		rq = &runloq;
		rq = &m->loq;

	lock(&runhiq);
	p = rq->head;

M power/dat.h => power/dat.h +2 -1
@@ 131,7 131,8 @@ struct Mach
	int	intr;
	int	ledval;			/* value last written to LED */
	int	otlbfault;
	Schedq	runq;
	Schedq	hiq;
	Schedq	loq;

	int	stack[1];
};