~kris/9p

9hist

9477c1eb2f7477114b73ba162081a694503170c7 — David du Colombier 25 years ago de8f8e8
Plan 9 from Bell Labs 2001-04-26
2 files changed, 27 insertions(+), 1 deletions(-)

M pc/devvga.c
M pc/screen.h
M pc/devvga.c => pc/devvga.c +26 -1
@@ 17,10 17,14 @@
enum {
	Qdir,
	Qvgactl,
	Qvgaovl,
	Qvgaovlctl,
};

static Dirtab vgadir[] = {
	"vgactl",	{ Qvgactl, 0 },		0,	0660,
	"vgactl",		{ Qvgactl, 0 },		0,	0660,
	"vgaovl",		{ Qvgaovl, 0 },		0,	0660,
	"vgaovlctl",	{ Qvgaovlctl, 0 },	0, 	0660,
};

static void


@@ 131,6 135,11 @@ vgaread(Chan* c, void* a, long n, vlong off)

		return n;

	case Qvgaovl:
	case Qvgaovlctl:
		error(Ebadusefd);
		break;

	default:
		error(Egreg);
		break;


@@ 337,11 346,14 @@ vgactl(char* a)
	error(Ebadarg);
}

char Enooverlay[] = "No overlay support";

static long
vgawrite(Chan* c, void* a, long n, vlong off)
{
	char *p;
	ulong offset = off;
	VGAscr *scr;

	switch(c->qid.path & ~CHDIR){



@@ 363,6 375,19 @@ vgawrite(Chan* c, void* a, long n, vlong off)
		free(p);
		return n;

	case Qvgaovl:
		scr = &vgascreen[0];
		pprint("vgawrite: Qvgaovl %d (%s)\n", Qvgaovl, scr->dev->name);
		return 0;

	case Qvgaovlctl:
		scr = &vgascreen[0];
		if (scr->dev->ovlctl == nil) {
			error(Enooverlay);
			break;
		}
		return scr->dev->ovlctl(scr, a, n);

	default:
		error(Egreg);
		break;

M pc/screen.h => pc/screen.h +1 -0
@@ 68,6 68,7 @@ struct VGAdev {
	ulong	(*linear)(VGAscr*, int*, int*);
	void	(*drawinit)(VGAscr*);
	int	(*fill)(VGAscr*, Rectangle, ulong);
	int	(*ovlctl)(VGAscr*, void*, int);
};

struct VGAcur {