~kris/9p

9hist

a12614456ed8cb841daee7ce7536a127ca341304 — David du Colombier 33 years ago 97fad7e
Plan 9 from Bell Labs 1992-11-04
M gnot/screen.c => gnot/screen.c +0 -6
@@ 184,9 184,3 @@ mousectl(char *x)
{
	USED(x);
}

void
screenupdate(Rectangle r)
{
	USED(r);
}

M gnot/screen.h => gnot/screen.h +5 -0
@@ 29,3 29,8 @@ extern Cursorinfo	cursor;
extern void		mouseupdate(int);

#define	hwscreenwrite(a, b)

#define mbbpt(x)
#define mbbrect(x)
#define screenupdate()
#define mousescreenupdate()

M pc/devhard.c => pc/devhard.c +1 -1
@@ 982,7 982,7 @@ hardintr(Ureg *ur)
		cp->cmd = 0;
		break;
	default:
		print("weird disk interrupt, cmd=%02x, status=%02x\n",
		print("weird disk interrupt, cmd=%.2ux, status=%.2ux\n",
			cp->cmd, cp->status);
		break;
	}

M pc/screen.h => pc/screen.h +5 -0
@@ 29,3 29,8 @@ extern Cursorinfo	cursor;
extern void		mouseupdate(int);

#define	hwscreenwrite(a, b)

#define mbbpt(x)
#define mbbrect(x)
#define screenupdate()
#define mousescreenupdate()

M pc/vga.c => pc/vga.c +0 -6
@@ 381,9 381,3 @@ bigcursor(void)

	memmove(&arrow, &fatarrow, sizeof(fatarrow));
}

void
screenupdate(Rectangle r)
{
	USED(r);
}

M port/devbit.c => port/devbit.c +23 -69
@@ 106,10 106,8 @@ extern	GBitmap	gscreen;

Mouseinfo	mouse;
Cursorinfo	cursor;
Rendez		lcdmouse;
int		mouseshifted;
int		mousetype;
int		islcd;

Cursor	arrow =
{


@@ 164,8 162,6 @@ void	cursoron(int);
void	cursoroff(int);
int	mousechanged(void*);

static Rectangle mbb = {10000, 10000, -10000, -10000};

enum{
	Qdir,
	Qbitblt,


@@ 186,6 182,19 @@ Dirtab bitdir[]={
#define	HDR	3

void
lockedupdate(void)
{
	qlock(&bit);
	if(waserror()){
		qunlock(&bit);
		return;
	}
	screenupdate();
	qunlock(&bit);
	poperror();
}

void
bitfreeup(void)
{
	int i;


@@ 252,27 261,6 @@ bitdebug(void)
	print("%d subfonts\n", l);
}

/*
 * need a process to do scsi transactions to update mouse on LCD
 */
void
lcdmousep(void *a)
{
	USED(a);
	for(;;){
		sleep(&lcdmouse, return0, 0);
		qlock(&bit);
		if(waserror()){
			qunlock(&bit);
			continue;
		}
		screenupdate(mbb);
		mbb = Rect(10000, 10000, -10000, -10000);
		qunlock(&bit);
		poperror();
	}
}

void
bitreset(void)
{


@@ 332,8 320,6 @@ bitinit(void)
		cursorback.width = ((16 << gscreen.ldepth) + 31) >> 5;
	}
	cursoron(1);
	if(islcd)
		kproc("lcdmouse", lcdmousep, 0);
}

Chan*


@@ 777,32 763,6 @@ bitread(Chan *c, void *va, long n, ulong offset)
	return n;
}

static void
mbbrect(Rectangle r)
{
	if (r.min.x < mbb.min.x)
		mbb.min.x = r.min.x;
	if (r.min.y < mbb.min.y)
		mbb.min.y = r.min.y;
	if (r.max.x > mbb.max.x)
		mbb.max.x = r.max.x;
	if (r.max.y > mbb.max.y)
		mbb.max.y = r.max.y;
}

static void
mbbpt(Point p)
{
	if (p.x < mbb.min.x)
		mbb.min.x = p.x;
	if (p.y < mbb.min.y)
		mbb.min.y = p.y;
	if (p.x >= mbb.max.x)
		mbb.max.x = p.x+1;
	if (p.y >= mbb.max.y)
		mbb.max.y = p.y+1;
}

Point
bitstrsize(GFont *f, uchar *p, int l)
{


@@ 945,7 905,7 @@ bitwrite(Chan *c, void *va, long n, ulong offset)
				isoff = 1;
			}
			gbitblt(dst, pt, src, rect, fc);
			if(islcd && dst->base < endscreen)
			if(dst->base < endscreen)
				mbbrect(Rpt(pt, add(pt, sub(rect.max, rect.min))));
			m -= 31;
			p += 31;


@@ 1180,7 1140,7 @@ bitwrite(Chan *c, void *va, long n, ulong offset)
				isoff = 1;
			}
			gsegment(dst, pt1, pt2, t, fc);
			if(islcd && dst->base < endscreen) {
			if(dst->base < endscreen) {
				mbbpt(pt1);
				mbbpt(pt2);
			}


@@ 1283,7 1243,7 @@ bitwrite(Chan *c, void *va, long n, ulong offset)
				isoff = 1;
			}
			gpoint(dst, pt1, t, fc);
			if(islcd && dst->base < endscreen)
			if(dst->base < endscreen)
				mbbpt(pt1);
			m -= 14;
			p += 14;


@@ 1375,7 1335,7 @@ bitwrite(Chan *c, void *va, long n, ulong offset)
				isoff = 1;
			}
			bitstring(dst, pt, ff, p, l, fc);
			if(islcd && dst->base < endscreen)
			if(dst->base < endscreen)
				mbbrect(Rpt(pt, add(pt, bitstrsize(ff, p, l))));
			m -= l;
			p += l;


@@ 1414,7 1374,7 @@ bitwrite(Chan *c, void *va, long n, ulong offset)
				isoff = 1;
			}
			gtexture(dst, rect, src, fc);
			if(islcd && dst->base < endscreen)
			if(dst->base < endscreen)
				mbbrect(rect);
			m -= 23;
			p += 23;


@@ 1494,7 1454,7 @@ bitwrite(Chan *c, void *va, long n, ulong offset)
				t = (t/ws)*ws;
				l = (t+dst->r.max.x+ws-1)/ws;
			}
			if(islcd && dst->base < endscreen)
			if(dst->base < endscreen)
				mbbrect(Rect(dst->r.min.x, miny, dst->r.max.x, maxy));
			p += 11;
			m -= 11;


@@ 1607,10 1567,7 @@ bitwrite(Chan *c, void *va, long n, ulong offset)
	poperror();
	if(isoff)
		cursoron(1);
	if(islcd) {
		screenupdate(mbb);
		mbb = Rect(10000, 10000, -10000, -10000);
	}
	screenupdate();
	qunlock(&bit);
	return n;
}


@@ 1962,8 1919,7 @@ cursoron(int dolock)
			&clr, Rect(0, 0, 16, 16), flipping? flipD[D&~S] : D&~S);
		gbitblt(&gscreen, cursor.r.min,
			&set, Rect(0, 0, 16, 16), flipping? flipD[S|D] : S|D);
		if(islcd)
			mbbrect(cursor.r);
		mbbrect(cursor.r);
	}
	if(dolock)
		unlock(&cursor);


@@ 1976,8 1932,7 @@ cursoroff(int dolock)
		lock(&cursor);
	if(--cursor.visible == 0) {
		gbitblt(&gscreen, cursor.r.min, &cursorback, Rect(0, 0, 16, 16), S);
		if(islcd)
			mbbrect(cursor.r);
		mbbrect(cursor.r);
	}
	if(dolock)
		unlock(&cursor);


@@ 2026,8 1981,7 @@ mouseupdate(int dolock)
	cursoroff(0);
	mouse.xy = Pt(x, y);
	cursoron(0);
	if(islcd)
		wakeup(&lcdmouse);
	mousescreenupdate();
	mouse.dx = 0;
	mouse.dy = 0;
	mouse.clock = 0;

M port/devproc.c => port/devproc.c +16 -1
@@ 669,7 669,7 @@ procctlmemio(Proc *p, ulong offset, int n, void *va, int read)
	return n;
}

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


@@ 695,3 695,18 @@ txt2data(Proc *p, Segment *s)

	return ps;
}

Segment*
data2txt(Segment *s)
{
	Segment *ps;

	ps = newseg(SG_TEXT, s->base, s->size);
	ps->image = s->image;
	incref(ps->image);
	ps->fstart = s->fstart;
	ps->flen = s->flen;
	ps->flushme = 1;

	return ps;
}

M port/devscc.c => port/devscc.c +1 -1
@@ 284,7 284,7 @@ sccsetup0(SCC *sp, int brsource)
	 *  turn on baud rate generator and set rate to 9600 baud.
	 *  use 1 stop bit.
	 */
	sp->sticky[14] = BRSource;
	sp->sticky[14] = brsource ? BRSource : 0;
	sccwrreg(sp, 14, 0);
	sccsetbaud(sp, 9600);
	sp->sticky[4] = Rx1stop | X16;

M port/portfns.h => port/portfns.h +6 -2
@@ 31,6 31,7 @@ int		consactive(void);
void		consdebug(void);
Block*		copyb(Block*, int);
void		copypage(Page*, Page*);
Segment*	data2txt(Segment*);
int		decref(Ref*);
int		decrypt(void*, void*, int);
void		delay(int);


@@ 107,6 108,8 @@ int		m3mouseputc(IOQ*, int);
void		machinit(void);
void*		malloc(ulong);
void		mapstack(Proc*);
void		mbbpt(Point);
void		mbbrect(Rectangle);
void		mfreeseg(Segment*, ulong, int);
void		mmurelease(Proc*);
void		mntdump(void);


@@ 116,6 119,7 @@ void		mousebuttons(int);
void		mousectl(char*);
void		mouseclock(void);
int		mouseputc(IOQ*, int);
void		mousescreenupdate(void);
int		msize(void*);
Chan*		namec(char*, int, int, ulong);
void		nameok(char*);


@@ 200,7 204,7 @@ void		sccspecial(int, IOQ*, IOQ*, int);
void		sched(void);
void		schedinit(void);
int		screenbits(void);
void		screenupdate(Rectangle);
void		screenupdate(void);
Scsibuf*	scsialloc(ulong);
int		scsibread(int, Scsibuf*, long, long, long);
Scsibuf*	scsibuf(void);


@@ 266,5 270,5 @@ void		xhole(ulong, ulong);
void		xinit(void);
void*		xspanalloc(ulong, int, ulong);
void		xsummary(void);
Segment*	dupseg(Segment*, int);
Segment*	dupseg(Segment**, int, int);
Segment*	seg(Proc*, ulong, int);

M port/segment.c => port/segment.c +7 -2
@@ 103,13 103,15 @@ relocateseg(Segment *s, ulong offset)
}

Segment*
dupseg(Segment *s, int share)
dupseg(Segment **seg, int segno, int share)
{
	int i;
	Pte *pte;
	Segment *n;
	Segment *n, *s;

	SET(n);
	s = seg[segno];

	switch(s->type&SG_TYPE) {
	case SG_TEXT:			/* New segment shares pte set */
	case SG_SHARED:


@@ 135,6 137,9 @@ dupseg(Segment *s, int share)
		break;

	case SG_DATA:			/* Copy on write plus demand load info */
		if(segno == TSEG)
			return data2txt(s);

		qlock(&s->lk);
		if(share && s->ref == 1) {
			s->type = (s->type&~SG_TYPE)|SG_SHDATA;

M port/sysproc.c => port/sysproc.c +2 -2
@@ 102,8 102,8 @@ sysrfork(ulong *arg)
	n = flag & RFMEM;
	for(i = 0; i < NSEG; i++)
		if(parent->seg[i])
			p->seg[i] = dupseg(parent->seg[i], n);

			p->seg[i] = dupseg(parent->seg, i, n);
	
	/* Refs */
	incref(u->dot);	


M ss/screen.c => ss/screen.c +0 -6
@@ 553,9 553,3 @@ mousectl(char *arg)
{
	USED(arg);
}

void
screenupdate(Rectangle r)
{
	USED(r);
}

M ss/screen.h => ss/screen.h +5 -0
@@ 29,3 29,8 @@ extern Cursorinfo	cursor;
extern void		mouseupdate(int);

#define	hwscreenwrite(a, b)

#define mbbpt(x)
#define mbbrect(x)
#define screenupdate()
#define mousescreenupdate()