~kris/9p

9hist

ffc0cc9a3bacacd2a606ab37f521703eda271a76 — David du Colombier 34 years ago cbdd3ea
Plan 9 from Bell Labs 1992-04-14
5 files changed, 45 insertions(+), 10 deletions(-)

M pc/vga.c
M port/devip.c
M port/ipdat.h
M port/stil.c
M port/tcpinput.c
M pc/vga.c => pc/vga.c +35 -0
@@ 66,6 66,7 @@ struct VGAmode
	uchar	attribute[0x15];
};

#ifdef ORIGINALSAFARI
/*
 *  640x480 display, 16 bit color
 */


@@ 88,10 89,35 @@ VGAmode mode12 =
	0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
	0x01, 0x00, 0x0f, 0x00, 0x00,
};
#else
/*
 *  640x480 display, 16 bit color - attempt at SVGA version...ches
 */
VGAmode mode12 = 
{
	/* general */
	0xe7, 0x00, 0x70, 0x04,
	/* sequence */
	0x03, 0x01, 0x0f, 0x00, 0x06,
	/* crt */
	0x65, 0x4f, 0x50, 0x88, 0x55, 0x9a, 0x09, 0x3e,
	0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0xe8, 0x8b, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3,
	0xff,
	/* graphics */
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f,
	0xff,
	/* attribute */
	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
	0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
	0x01, 0x00, 0x0f, 0x00, 0x00,
};
#endif

void
genout(int reg, int val)
{
delay(1000);
	if(reg == 0)
		outb(EMISCW, val);
	else if (reg == 1)


@@ 100,6 126,10 @@ genout(int reg, int val)
void
srout(int reg, int val)
{
	/*
	 * needed or the screen goes blank on an ultra VGA card
	 */
	delay(1000);
	outb(SRX, reg);
	outb(SR, val);
}


@@ 112,6 142,10 @@ grout(int reg, int val)
void
arout(int reg, int val)
{
	/*
	 * if this print is missing, we are left with a blank white screen.
	 */
	print("arout %d %2x\n", reg, val);
	inb(0x3DA);
	outb(ARW, reg | 0x20);
	outb(ARW, val);


@@ 119,6 153,7 @@ arout(int reg, int val)
void
crout(int reg, int val)
{
	delay(1000);	/* needed for 16bit VGA path on Ultra SVGA */
	outb(CRX, reg);
	outb(CR, val);
}

M port/devip.c => port/devip.c +7 -7
@@ 654,18 654,17 @@ iplisten(Chan *c)
	if(s->ilctl.state != Illistening)
		error(Enolisten);

	qlock(&s->listenq);
	if(waserror()) {
		qunlock(&s->listenq);
		nexterror();
	}

	for(;;) {
		qlock(&s->listenq);	/* single thread for the sleep */
		if(waserror()) {
			qunlock(&s->listenq);
			nexterror();
		}
		sleep(&s->listenr, iphavecon, s);
		poperror();
		new = base;
 		for(etab = &base[conf.ip]; new < etab; new++) {
			if(new->newcon) {
			if(new->newcon == s) {
				qlock(s);
				s->curlog--;
				qunlock(s);


@@ 674,6 673,7 @@ iplisten(Chan *c)
				return new - base;
			}
		}
		qunlock(&s->listenq);
		print("iplisten: no newcon\n");
	}
}

M port/ipdat.h => port/ipdat.h +1 -1
@@ 294,7 294,7 @@ struct Ipconv
	char	*err;			/* Async protocol error */
	int	backlog;		/* Maximum number of waiting connections */
	int	curlog;			/* Number of waiting connections */
	int 	newcon;			/* Flags that this is the start of a connection */
	Ipconv 	*newcon;		/* Flags that this is the start of a connection */

	union {
		Tcpctl	tcpctl;			/* Tcp control block */

M port/stil.c => port/stil.c +1 -1
@@ 294,7 294,7 @@ ilrcvmsg(Ipconv *ipc, Block *bp)
			if(new == 0)
				goto reset;

			new->newcon = 1;
			new->newcon = s;
			new->ipinterface = s->ipinterface;
			new->psrc = sp;
			new->pdst = dp;

M port/tcpinput.c => port/tcpinput.c +1 -1
@@ 103,7 103,7 @@ tcpincoming(Ipconv *ipc, Ipconv *s, Tcp *segp, Ipaddr source)
	new->tcpctl.timer.state = TIMER_STOP;
	new->tcpctl.acktimer.arg = new;
	new->tcpctl.acktimer.state = TIMER_STOP;
	new->newcon = 1;
	new->newcon = s;
	new->ipinterface = s->ipinterface;

	s->ipinterface->ref++;