From ffc0cc9a3bacacd2a606ab37f521703eda271a76 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 14 Apr 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-04-14 --- pc/vga.c | 35 +++++++++++++++++++++++++++++++++++ port/devip.c | 14 +++++++------- port/ipdat.h | 2 +- port/stil.c | 2 +- port/tcpinput.c | 2 +- 5 files changed, 45 insertions(+), 10 deletions(-) diff --git a/pc/vga.c b/pc/vga.c index d3a8f204e08614f342c33be762b24401dc0a55d1..858111302b1c355f6cef56017c1b775b5e2f71e2 100644 --- a/pc/vga.c +++ b/pc/vga.c @@ -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); } diff --git a/port/devip.c b/port/devip.c index d6f10ddc6dbbef8c3fa25213221478bd58ffd8e9..9e21cbe2a3523dccf8c2fa878095d10d27f32e8e 100644 --- a/port/devip.c +++ b/port/devip.c @@ -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"); } } diff --git a/port/ipdat.h b/port/ipdat.h index 9d9c99a0d2ef831f238528ab9a66238f7de61f6d..3e138b1677275d6b79617eb45e78b3ef45fc4ddb 100644 --- a/port/ipdat.h +++ b/port/ipdat.h @@ -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 */ diff --git a/port/stil.c b/port/stil.c index e802a25ba01426b827ee049b59227130ffc021f5..9b91640e7aefb36b1c1bbf03b80bc02204081dc2 100644 --- a/port/stil.c +++ b/port/stil.c @@ -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; diff --git a/port/tcpinput.c b/port/tcpinput.c index cb512a6fbadee78a5137e3e6302ca52746fa7266..d0e9770522b5df19053af5cc21880dc0895f0db1 100644 --- a/port/tcpinput.c +++ b/port/tcpinput.c @@ -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++;