~kris/9p

9hist

f07c80a863713d3adcb704c2b63a027af578532e — David du Colombier 25 years ago 7d8bed4
Plan 9 from Bell Labs 2001-08-02
3 files changed, 14 insertions(+), 3 deletions(-)

M pc/sdata.c
M port/devdup.c
M port/proc.c
M pc/sdata.c => pc/sdata.c +4 -0
@@ 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 */

M port/devdup.c => port/devdup.c +9 -1
@@ 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;
	}

M port/proc.c => port/proc.c +1 -2
@@ 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);