From f07c80a863713d3adcb704c2b63a027af578532e Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 2 Aug 2001 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2001-08-02 --- pc/sdata.c | 4 ++++ port/devdup.c | 10 +++++++++- port/proc.c | 3 +-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pc/sdata.c b/pc/sdata.c index f4be934a81731b4d32bbe20a19eccc1c69c9e317..f8ca71c64327baeb2a92f6bcbe1ccef6c52d7c01 100644 --- a/pc/sdata.c +++ b/pc/sdata.c @@ -1590,12 +1590,14 @@ atapnp(void) Pcidev *p; int channel, ispc87415, pi, r; SDev *legacy[2], *sdev, *head, *tail; +//int i; legacy[0] = legacy[1] = head = tail = nil; if(sdev = ataprobe(0x1F0, 0x3F4, IrqATA0)){ head = tail = sdev; legacy[0] = sdev; } +//print("probe 1, sdev %p\n", sdev); if(sdev = ataprobe(0x170, 0x374, IrqATA1)){ if(head != nil) tail->next = sdev; @@ -1604,6 +1606,7 @@ atapnp(void) tail = sdev; legacy[1] = sdev; } +//print("probe 2, sdev %p\n", sdev); p = nil; while(p = pcimatch(p, 0, 0)){ @@ -1663,6 +1666,7 @@ atapnp(void) * Is this correct? */ pi |= 0x0f; +//for(i = 0; i <= 4; i++) print("bar%d: addr %lux size %d\n", i, p->mem[i].bar, p->mem[i].size); break; case (0x0571<<16)|0x1106: /* VIA 82C686 */ case (0x0211<<16)|0x1166: /* ServerWorks IB6566 */ diff --git a/port/devdup.c b/port/devdup.c index 0deb36d3f9645ef4b4de0bfc71745b8a107fc44d..f991ab511bc2529e3edfa890aa68abf36df032ae 100644 --- a/port/devdup.c +++ b/port/devdup.c @@ -76,6 +76,9 @@ dupopen(Chan *c, int omode) if((twicefd & 1)){ /* ctl file */ f = c; + f->mode = openmode(omode); + f->flag |= COPEN; + f->offset = 0; }else{ /* fd file */ fdtochan(fd, openmode(omode), 0, 0); /* error check only */ @@ -120,7 +123,12 @@ dupread(Chan *c, void *va, long n, vlong offset) static long dupwrite(Chan *c, void*, long, vlong) { - if(c->qid.path & 1){ + int fd, twicefd; + + twicefd = c->qid.path - 1; + fd = twicefd/2; + if(twicefd & 1){ +print("writing ctl file\n"); print("do ctl write\n"); return -1; } diff --git a/port/proc.c b/port/proc.c index fe5793458cc855fb9b3c6162b4e42e6161edc984..901a4d0495e83225295defc0d98d81df7f0ddb13 100644 --- a/port/proc.c +++ b/port/proc.c @@ -324,6 +324,7 @@ newproc(void) p->nchild = 0; p->nwait = 0; p->waitq = 0; + p->parent = 0; p->pgrp = 0; p->egrp = 0; p->fgrp = 0; @@ -1053,8 +1054,6 @@ kproc(char *name, void (*func)(void *), void *arg) p->pgrp = kpgrp; incref(kpgrp); - p->nchild = 0; - p->parent = 0; memset(p->time, 0, sizeof(p->time)); p->time[TReal] = MACHP(0)->ticks; ready(p);