~kris/9p

9hist

e6c43b3ea22365ca0a82e0c81fd0481d021f66ca — David du Colombier 31 years ago 49234d5
Plan 9 from Bell Labs 1995-08-15
3 files changed, 23 insertions(+), 22 deletions(-)

M pc/devvga.c
M port/devcons.c
M port/swap.c
M pc/devvga.c => pc/devvga.c +8 -8
@@ 734,7 734,7 @@ screenload(Rectangle r, uchar *data, int tl, int l, int dolock)

	if(dolock && hwgc == 0)
		cursorlock(r);
	ilock(&palettelock);
	lock(&palettelock);

	q = byteaddr(&gscreen, r.min);
	mx = 7>>gscreen.ldepth;


@@ 814,7 814,7 @@ screenload(Rectangle r, uchar *data, int tl, int l, int dolock)
		data += l;
	}

	iunlock(&palettelock);
	unlock(&palettelock);
	if(dolock && hwgc == 0)
		cursorunlock();
}


@@ 891,7 891,7 @@ screenunload(Rectangle r, uchar *data, int tl, int l, int dolock)

	if(dolock && hwgc == 0)
		cursorlock(r);
	ilock(&palettelock);
	lock(&palettelock);

	q = byteaddr(&gscreen, r.min);
	mx = 7>>gscreen.ldepth;


@@ 971,7 971,7 @@ screenunload(Rectangle r, uchar *data, int tl, int l, int dolock)
		data += l;
	}

	iunlock(&palettelock);
	unlock(&palettelock);
	if(dolock && hwgc == 0)
		cursorunlock();
}


@@ 1165,11 1165,11 @@ getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
	}
	p &= x;
	p ^= x;
	ilock(&palettelock);
	lock(&palettelock);
	*pr = colormap[p][Pred];
	*pg = colormap[p][Pgreen];
	*pb = colormap[p][Pblue];
	iunlock(&palettelock);
	unlock(&palettelock);
}

int


@@ 1187,7 1187,7 @@ setcolor(ulong p, ulong r, ulong g, ulong b)
	}
	p &= x;
	p ^= x;
	ilock(&palettelock);
	lock(&palettelock);
	colormap[p][Pred] = r;
	colormap[p][Pgreen] = g;
	colormap[p][Pblue] = b;


@@ 1195,7 1195,7 @@ setcolor(ulong p, ulong r, ulong g, ulong b)
	vgao(Pdata, r>>(32-6));
	vgao(Pdata, g>>(32-6));
	vgao(Pdata, b>>(32-6));
	iunlock(&palettelock);
	unlock(&palettelock);
	return ~0;
}


M port/devcons.c => port/devcons.c +2 -1
@@ 21,7 21,7 @@ static struct
	int	x;		/* index into line */
	char	line[1024];	/* current input line */

	char	c;
	Rune	c;
	int	count;
	int	repeat;
	int	ctlpoff;


@@ 276,6 276,7 @@ kbdputc(Queue*, int ch)
	if(n == 0)
		return 0;
	echo(r, buf, n);
	kbd.c = r;
	qproduce(kbdq, buf, n);
	return 0;
}

M port/swap.c => port/swap.c +13 -13
@@ 5,12 5,12 @@
#include	"fns.h"
#include	"../port/error.h"

int	canflush(Proc *p, Segment*);
void	executeio(void);
int	needpages(void*);
void	pageout(Proc *p, Segment*);
void	pagepte(int, Page**);
void	pager(void*);
static int	canflush(Proc*, Segment*);
static void	executeio(void);
static int	needpages(void*);
static void	pageout(Proc*, Segment*);
static void	pagepte(int, Page**);
static void	pager(void*);

enum
{


@@ 93,7 93,7 @@ kickpager(void)
	}
}

void
static void
pager(void *junk)
{
	int i;


@@ 159,7 159,7 @@ loop:
	goto loop;
}

void			
static void			
pageout(Proc *p, Segment *s)
{
	int type, i;


@@ 214,7 214,7 @@ out:
	putseg(s);
}

int
static int
canflush(Proc *p, Segment *s)
{
	int i;


@@ 230,7 230,7 @@ canflush(Proc *p, Segment *s)
	unlock(s);

	/* Now we must do hardwork to ensure all processes which have tlb
	 * entries for this segment will be flushed if we suceed in pageing it out
	 * entries for this segment will be flushed if we succeed in paging it out
	 */
	p = proctab(0);
	ep = &p[conf.nproc];


@@ 246,7 246,7 @@ canflush(Proc *p, Segment *s)
	return 1;						
}

void
static void
pagepte(int type, Page **pg)
{
	ulong daddr;


@@ 284,7 284,7 @@ pagepte(int type, Page **pg)
	}
}

void
static void
executeio(void)
{
	Page *out;


@@ 319,7 319,7 @@ executeio(void)
	ioptr = 0;
}

int
static int
needpages(void*)
{
	return palloc.freecount < swapalloc.headroom;