From 03f55079d98b99f72d90b042abb1460612f8bf2c Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 2 May 2002 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2002-05-02 --- pc/devether.c | 3 +++ pc/devi82365.c | 5 ++++- pc/devpccard.c | 4 ++++ pc/devusb.c | 3 +++ pc/etherelnk3.c | 2 ++ pc/uarti8250.c | 10 +++++----- pc/usbuhci.c | 9 ++++++--- pc/vganvidia.c | 12 +++++++----- port/devmouse.c | 3 ++- port/devproc.c | 5 +++++ port/portdat.h | 9 +++++---- port/proc.c | 2 ++ port/swap.c | 2 +- port/sysproc.c | 1 + 14 files changed, 50 insertions(+), 20 deletions(-) diff --git a/pc/devether.c b/pc/devether.c index 6675094eb0b714bf00f0dcaaf98f13d9df0dfe10..a2d68b52e928bde3d23d31df1b5f0634bf0eec9c 100644 --- a/pc/devether.c +++ b/pc/devether.c @@ -444,6 +444,9 @@ etherreset(void) etherxx[ctlrno] = ether; } + if(getconf("*noetherprobe")) + return; + cardno = ctlrno = 0; while(cards[cardno].type != nil && ctlrno < MaxEther){ if(etherxx[ctlrno] != nil){ diff --git a/pc/devi82365.c b/pc/devi82365.c index 32270a0c355d63f7b964c85017feb67b5fedcce5..3e76c9dd0fb3fcaee0d5e6b023bb6881b8d2891b 100644 --- a/pc/devi82365.c +++ b/pc/devi82365.c @@ -575,12 +575,15 @@ devi82365link(void) int i, j; I82365 *cp; PCMslot *pp; - char buf[32]; + char buf[32], *p; if(already) return; already = 1; + if((p=getconf("pcmcia0")) && strncmp(p, "disabled", 8)==0) + return; + if(_pcmspecial) return; diff --git a/pc/devpccard.c b/pc/devpccard.c index a63b6be61e3b492bbf1667adad4cbdf4abb6a4ff..f299b8f002c1813082d0f1d46075d38747a1b951 100644 --- a/pc/devpccard.c +++ b/pc/devpccard.c @@ -504,11 +504,15 @@ devpccardlink(void) Pcidev *pci; int i; uchar intl; + char *p; if (initialized) return; initialized = 1; + if((p=getconf("pccard0")) && strncmp(p, "disabled", 8)==0) + return; + if(_pcmspecial) return; diff --git a/pc/devusb.c b/pc/devusb.c index a9ed48061b122d6554adce7966854bfe70ce7881..8df8649a817949bdfe27a1bb34f49b886ce5d556 100644 --- a/pc/devusb.c +++ b/pc/devusb.c @@ -451,6 +451,9 @@ usbreset(void) usbhost[ctlrno] = uh; } + if(getconf("*nousbprobe")) + return; + cardno = ctlrno = 0; while(usbtypes[cardno].type != nil && ctlrno < MaxUsb){ if(usbhost[ctlrno] != nil){ diff --git a/pc/etherelnk3.c b/pc/etherelnk3.c index ac52a1af2bd7271dc8c7b0816216158d01c36f1a..59d037204f07927bf57207fc7184c62b5ac137df 100644 --- a/pc/etherelnk3.c +++ b/pc/etherelnk3.c @@ -26,6 +26,8 @@ * 5950 PCI 3C595-TX Fast Etherlink Shared 10BASE-T/100BASE-TX * 5951 PCI 3C595-T4 Fast Etherlink Shared 10BASE-T/100BASE-T4 * 5952 PCI 3C595-MII Fast Etherlink 10BASE-T/MII + + * 7646 PCI 3CSOHO100-TX Fast Etherlink Small Office Connect (9050 downsized clone) * * 9000 PCI 3C900-TPO Etherlink III XL PCI 10BASE-T * 9001 PCI 3C900-COMBO Etherlink III XL PCI 10BASE-T/10BASE-2/AUI diff --git a/pc/uarti8250.c b/pc/uarti8250.c index d93be91832367ba9d2629ce0b7a1e81cbf1200dc..09c5c71b91c5cac1c2878972b81d35b529ebd918 100644 --- a/pc/uarti8250.c +++ b/pc/uarti8250.c @@ -564,12 +564,12 @@ i8250enable(Uart* uart, int ie) /* - * During startup, the i8259 interrupt controler is reset. + * During startup, the i8259 interrupt controller is reset. * This may result in a lost interrupt from the i8250 uart. * The i8250 thinks the interrupt is still outstanding and does not - * generate any further interrupts. To work around this we call the - * interrupt handler to clear any pending inerrupt events. - * Note this must be done after setting Ier. + * generate any further interrupts. The workaround is to call the + * interrupt handler to clear any pending interrupt events. + * Note: this must be done after setting Ier. */ if(ie) i8250interrupt(nil, uart); @@ -670,4 +670,4 @@ i8250console(void) consuart = uart; uart->console = 1; -} +} diff --git a/pc/usbuhci.c b/pc/usbuhci.c index 972beefe347c9daf4651cddaa31f9bf20aecbad5..776603824ac069a37726a9baa001f23e7962375d 100644 --- a/pc/usbuhci.c +++ b/pc/usbuhci.c @@ -1480,10 +1480,13 @@ reset(Usbhost *uh) t->link = PCIWADDR(t); ctlr->bwsop->entries = PCIWADDR(t); - ctlr->ctlq->head = PCIWADDR(ctlr->bwsop) | IsQH; - ctlr->bwsop->head = PCIWADDR(ctlr->bulkq) | IsQH; + ctlr->ctlq->head = PCIWADDR(ctlr->bulkq) | IsQH; ctlr->bulkq->head = PCIWADDR(ctlr->recvq) | IsQH; - ctlr->recvq->head = PCIWADDR(ctlr->bwsop) | IsQH; /* loop back */ + ctlr->recvq->head = PCIWADDR(ctlr->bwsop) | IsQH; + if (1) /* don't use loop back */ + ctlr->bwsop->head = Terminate; + else /* set up loop back */ + ctlr->bwsop->head = PCIWADDR(ctlr->bwsop) | IsQH; ctlr->frames = xspanalloc(FRAMESIZE, FRAMESIZE, 0); ctlr->frameld = xallocz(FRAMESIZE, 1); diff --git a/pc/vganvidia.c b/pc/vganvidia.c index f99450e6cacee5a6d921755b3f386efff607d4b3..89e074715c8e50dacef70c512123c5f3c6c34638 100644 --- a/pc/vganvidia.c +++ b/pc/vganvidia.c @@ -43,6 +43,8 @@ static ushort nvidiadid[] = { 0x0152, /* GeForce2 Ultra */ 0x0153, /* Quadro 2 Pro */ 0x0200, /* GeForce3 */ + 0x0201, + 0x0202, 0, }; @@ -219,11 +221,11 @@ nvidiacurenable(VGAscr* scr) } enum { - RopFifo = 0x00000000, - ClipFifo = 0x00002000, - PattFifo = 0x00004000, - BltFifo = 0x00008000, - BitmapFifo = 0x0000A000, + RopFifo = 0x00000000, + ClipFifo = 0x00002000, + PattFifo = 0x00004000, + BltFifo = 0x00008000, + BitmapFifo = 0x0000A000, }; enum { diff --git a/port/devmouse.c b/port/devmouse.c index 5ba4c242e8b6b2423ae68f40c2ab600cb56c4ee4..0c87963be31dee3d3dbe00a4b2bcdc231ae43b04 100644 --- a/port/devmouse.c +++ b/port/devmouse.c @@ -153,7 +153,8 @@ mouseopen(Chan *c, int omode) unlock(&mouse); break; case Qmousein: - /* error("disabled"); */ + if(!iseve()) + error(Eperm); lock(&mouse); if(mouse.inopen){ unlock(&mouse); diff --git a/port/devproc.c b/port/devproc.c index d0fedbdaf1a453270a766fa9e915abe13af23a76..729a3b089e894b2b6931cf4a8fdc631c2590521a 100644 --- a/port/devproc.c +++ b/port/devproc.c @@ -36,6 +36,7 @@ enum CMhang, CMkill, CMnohang, + CMnoswap, CMpri, CMprivate, CMprofile, @@ -80,6 +81,7 @@ Cmdtab proccmd[] = { CMfixedpri, "fixedpri", 2, CMhang, "hang", 1, CMnohang, "nohang", 1, + CMnoswap, "noswap", 1, CMkill, "kill", 1, CMpri, "pri", 2, CMprivate, "private", 1, @@ -1116,6 +1118,9 @@ procctlreq(Proc *p, char *va, int n) case CMnohang: p->hang = 0; break; + case CMnoswap: + p->noswap = 1; + break; case CMpri: i = atoi(cb->f[1]); if(i < 0) diff --git a/port/portdat.h b/port/portdat.h index d3d61cd47f7599f4d0f8eeb68a703404939591c3..0fc6657f113f39bb5cf45b7eb3e1b45421e91f48 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -605,6 +605,7 @@ struct Proc Proc *palarm; /* Next alarm time */ ulong alarm; /* Time of call */ int newtlb; /* Pager has changed my pte's, I must flush */ + int noswap; /* process is not swappable */ ulong rendtag; /* Tag for rendezvous */ ulong rendval; /* Value for rendezvous */ @@ -622,10 +623,10 @@ struct Proc Sargs s; /* address of this is known by db */ int nerrlab; Label errlab[NERR]; - char *syserrstr; /* last error from a system call, errbuf0 or 1 */ - char *errstr; /* reason we're unwinding the error stack, errbuf1 or 0 */ - char errbuf0[ERRMAX]; - char errbuf1[ERRMAX]; + char *syserrstr; /* last error from a system call, errbuf0 or 1 */ + char *errstr; /* reason we're unwinding the error stack, errbuf1 or 0 */ + char errbuf0[ERRMAX]; + char errbuf1[ERRMAX]; char genbuf[128]; /* buffer used e.g. for last name element from namec */ Chan *slash; Chan *dot; diff --git a/port/proc.c b/port/proc.c index 9c10e0b68f0b57f2807a4a5c90559b91621400cb..a6df37b234c9f84cecf0a1e240a1ecc1ffd32ab0 100644 --- a/port/proc.c +++ b/port/proc.c @@ -355,6 +355,7 @@ newproc(void) p->wired = 0; p->ureg = 0; p->privatemem = 0; + p->noswap = 0; p->lockwait = nil; p->errstr = p->errbuf0; p->syserrstr = p->errbuf1; @@ -1056,6 +1057,7 @@ kproc(char *name, void (*func)(void *), void *arg) p->psstate = 0; p->procmode = 0640; p->kp = 1; + p->noswap = 1; p->fpsave = up->fpsave; p->scallnr = up->scallnr; diff --git a/port/swap.c b/port/swap.c index 70c180ef7e6fc926ca0d9646044529834e2796a7..4699b12ba419eaa459bd7348b89ca1017b4e84dc 100644 --- a/port/swap.c +++ b/port/swap.c @@ -124,7 +124,7 @@ loop: if(p >= ep) p = proctab(0); - if(p->state == Dead || p->kp) + if(p->state == Dead || p->noswap) continue; if(!canqlock(&p->seglock)) diff --git a/port/sysproc.c b/port/sysproc.c index 55dcde6789f6e855f46939db9ddfb3824b0ad51d..73d10bed3d0e14c587a2402debca7ec6f1f5a4cb 100644 --- a/port/sysproc.c +++ b/port/sysproc.c @@ -109,6 +109,7 @@ sysrfork(ulong *arg) memmove(p->note, up->note, sizeof(p->note)); p->privatemem = up->privatemem; + p->noswap = up->noswap; p->nnote = up->nnote; p->notified = 0; p->lastnote = up->lastnote;