Browse Source

Plan 9 from Bell Labs 2008-06-11

David du Colombier 16 years ago
parent
commit
36dd9e277f

+ 5 - 5
dist/replica/_plan9.db

@@ -8188,8 +8188,8 @@ sys/src/9/pc/screen.c - 664 sys sys 1184522395 13973
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1211521147 55313
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sdata.c - 664 sys sys 1211924368 53297
-sys/src/9/pc/sdiahci.c - 664 sys sys 1212099695 38999
+sys/src/9/pc/sdata.c - 664 sys sys 1213134383 53299
+sys/src/9/pc/sdiahci.c - 664 sys sys 1213134393 39005
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1204232564 34031
 sys/src/9/pc/sdmylex.c - 664 sys sys 1189229947 28395
 sys/src/9/pc/sdscsi.c - 664 sys sys 1186618532 7957
@@ -8200,7 +8200,7 @@ sys/src/9/pc/uarti8250.c - 664 sys sys 1177676872 13957
 sys/src/9/pc/uartisa.c - 664 sys sys 1127126907 1777
 sys/src/9/pc/uartpci.c - 664 sys sys 1190235592 4685
 sys/src/9/pc/usb.h - 664 sys sys 1202865355 4630
-sys/src/9/pc/usbohci.c - 664 sys sys 1205381809 49041
+sys/src/9/pc/usbohci.c - 664 sys sys 1213134352 48372
 sys/src/9/pc/usbuhci.c - 664 sys sys 1202252076 31839
 sys/src/9/pc/vga.c - 664 sys sys 1131290595 5148
 sys/src/9/pc/vga3dfx.c - 664 sys sys 1133218367 3833
@@ -9251,9 +9251,9 @@ sys/src/boot/pc/sd.h - 664 sys sys 1200690169 2249
 sys/src/boot/pc/sd53c8xx.c - 664 sys sys 1186031515 52082
 sys/src/boot/pc/sd53c8xx.i - 664 sys sys 1015007955 27245
 sys/src/boot/pc/sdaoe.c - 664 sys sys 1204324647 11381
-sys/src/boot/pc/sdata.c - 664 sys sys 1212010306 39146
+sys/src/boot/pc/sdata.c - 664 sys sys 1213134120 39148
 sys/src/boot/pc/sdbios.c - 664 sys sys 1212010334 3280
-sys/src/boot/pc/sdiahci.c - 664 sys sys 1212090562 28613
+sys/src/boot/pc/sdiahci.c - 664 sys sys 1213134135 28620
 sys/src/boot/pc/sdmylex.c - 664 sys sys 1171783051 28694
 sys/src/boot/pc/sdscsi.c - 664 sys sys 1144961224 7006
 sys/src/boot/pc/trap.c - 664 sys sys 1193167011 7497

+ 5 - 5
dist/replica/plan9.db

@@ -8188,8 +8188,8 @@ sys/src/9/pc/screen.c - 664 sys sys 1184522395 13973
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1211521147 55313
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sdata.c - 664 sys sys 1211924368 53297
-sys/src/9/pc/sdiahci.c - 664 sys sys 1212099695 38999
+sys/src/9/pc/sdata.c - 664 sys sys 1213134383 53299
+sys/src/9/pc/sdiahci.c - 664 sys sys 1213134393 39005
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1204232564 34031
 sys/src/9/pc/sdmylex.c - 664 sys sys 1189229947 28395
 sys/src/9/pc/sdscsi.c - 664 sys sys 1186618532 7957
@@ -8200,7 +8200,7 @@ sys/src/9/pc/uarti8250.c - 664 sys sys 1177676872 13957
 sys/src/9/pc/uartisa.c - 664 sys sys 1127126907 1777
 sys/src/9/pc/uartpci.c - 664 sys sys 1190235592 4685
 sys/src/9/pc/usb.h - 664 sys sys 1202865355 4630
-sys/src/9/pc/usbohci.c - 664 sys sys 1205381809 49041
+sys/src/9/pc/usbohci.c - 664 sys sys 1213134352 48372
 sys/src/9/pc/usbuhci.c - 664 sys sys 1202252076 31839
 sys/src/9/pc/vga.c - 664 sys sys 1131290595 5148
 sys/src/9/pc/vga3dfx.c - 664 sys sys 1133218367 3833
@@ -9251,9 +9251,9 @@ sys/src/boot/pc/sd.h - 664 sys sys 1200690169 2249
 sys/src/boot/pc/sd53c8xx.c - 664 sys sys 1186031515 52082
 sys/src/boot/pc/sd53c8xx.i - 664 sys sys 1015007955 27245
 sys/src/boot/pc/sdaoe.c - 664 sys sys 1204324647 11381
-sys/src/boot/pc/sdata.c - 664 sys sys 1212010306 39146
+sys/src/boot/pc/sdata.c - 664 sys sys 1213134120 39148
 sys/src/boot/pc/sdbios.c - 664 sys sys 1212010334 3280
-sys/src/boot/pc/sdiahci.c - 664 sys sys 1212090562 28613
+sys/src/boot/pc/sdiahci.c - 664 sys sys 1213134135 28620
 sys/src/boot/pc/sdmylex.c - 664 sys sys 1171783051 28694
 sys/src/boot/pc/sdscsi.c - 664 sys sys 1144961224 7006
 sys/src/boot/pc/trap.c - 664 sys sys 1193167011 7497

+ 5 - 0
dist/replica/plan9.log

@@ -19836,3 +19836,8 @@
 1212984005 0 c 386/bin/venti/buildindex - 775 sys sys 1212982782 259535
 1213016405 0 c sys/src/9/pc/ether82563.c - 664 sys sys 1213016020 37776
 1213016405 1 c sys/src/boot/pc/ether82563.c - 664 sys sys 1213016004 28290
+1213133405 0 c sys/src/boot/pc/sdata.c - 664 sys sys 1213134120 39148
+1213135206 0 c sys/src/9/pc/sdata.c - 664 sys sys 1213134383 53299
+1213135206 1 c sys/src/9/pc/sdiahci.c - 664 sys sys 1213134393 39005
+1213135206 2 c sys/src/9/pc/usbohci.c - 664 sys sys 1213134352 48372
+1213135206 3 c sys/src/boot/pc/sdiahci.c - 664 sys sys 1213134135 28620

+ 1 - 1
sys/src/9/pc/sdata.c

@@ -2020,7 +2020,7 @@ atapnp(void)
 		case (0x266F<<16)|0x8086:	/* 82801FB (ICH6) */
 		case (0x27DF<<16)|0x8086:	/* 82801G SATA (ICH7) */
 		case (0x27C0<<16)|0x8086:	/* 82801GB SATA AHCI (ICH7) */
-		case (0x27C4<<16)|0x8086:	/* 82801GBM SATA (ICH7) */
+//		case (0x27C4<<16)|0x8086:	/* 82801GBM SATA (ICH7) */
 		case (0x27C5<<16)|0x8086:	/* 82801GBM SATA AHCI (ICH7) */
 			break;
 		}

+ 1 - 1
sys/src/9/pc/sdiahci.c

@@ -1852,7 +1852,7 @@ didtype(Pcidev *p)
 		/* 0x27c4 is the intel 82801 in compatibility (not sata) mode */
 		if ((p->did & 0xfeff) == 0x2829 ||		/* ich8 */
 		    (p->did & 0xfffe) == 0x2922 ||		/* ich9 */
-		    (p->did & 0xfffe) == 0x27c4 || p->did == 0x27c0) /* 82801g[bh]m? */
+		    (p->did & 0xfffe) == 0x27c4 /* || p->did == 0x27c0 */) /* 82801g[bh]m? */
 			return Tich;
 		break;
 	case 0x1002:

+ 3 - 48
sys/src/9/pc/usbohci.c

@@ -341,50 +341,6 @@ static void	unschedendpt(Ctlr *ub, Endpt *ep, int);
 static long	write(Usbhost *, Endpt*, void*, long, vlong, int);
 static long	qtd(Ctlr*, Endpt*, int, Block*, uchar*, uchar*, int, ulong);
 
-static short
-refcnt(Block *b, int i)
-{
-	short v;
-	static Lock l;
-
-	ilock(&l);
-	v = (b->flag += i);
-	iunlock(&l);
-	if(v < 0)
-		iprint("refcnt 0x%lux %d\n", b, v);
-	return v;
-}
-
-static void
-freewb(Block *b)
-{
-	if(b == nil || refcnt(b, -1) > 0)
-		return;
-
-	if(b->base > b->rp || b->rp > b->wp || b->wp > b->lim)
-		iprint("freebw: %lux %lux %lux %lux\n",
-			b->base, b->rp, b->wp, b->lim);
-	/* poison the block in case someone is still holding onto it */
-	b->next = (Block*)0xdeadcafe;
-	b->rp = (uchar*)0xdeadcafe;
-	b->wp = (uchar*)0xdeadcafe;
-	b->lim = (uchar*)0xdeadcafe;
-	b->base = (uchar*)0xdeadcafe;
-
-	free(b);
-}
-
-Block *
-allocwb(long size)
-{
-	Block *b;
-
-	b = allocb(size);
-	b->flag = 1;
-	b->free = freewb;
-	return b;
-}
-
 void
 printdata(void *pdata, int itemsize, int nitems)
 {
@@ -1496,7 +1452,7 @@ qtd(Ctlr *ub, Endpt *ep, int dirin , Block *bp, uchar *base, uchar *limit,
 	if(td->flags & TD_FLAGS_LAST)
 		ep->dir[dirin].xstarted++;
 	if(dirin == Dirout && bp)
-		refcnt(bp, 1);
+		_xinc(&bp->ref);
 	dummytd = TDalloc(ub, ep, 1);
 	TDsetnexttd(td, dummytd);
 	ep->dir[dirin].queued++;
@@ -1897,7 +1853,6 @@ interrupt(Ureg *, void *arg)
 		/* Clean up blocks used for transfers */
 		if(dirin == Dirout)
 			freeb(bp);
-
 		nexttd = TDgetnexttd(donetd);
 		TDfree(ub, donetd);
 		donetd = nexttd;
@@ -2073,7 +2028,7 @@ write(Usbhost *uh, Endpt *ep, void *a, long n, vlong off, int tok)
 	if((m = n) == 0 || p == nil)
 		qtd(ub, ep, Dirout, 0, 0, 0, tok, TD_FLAGS_LAST);
 	else{
-		b = allocwb(m+ep->partial);
+		b = allocb(m+ep->partial);
 		if(ep->partial){
 			memmove(b->wp, ep->bpartial->rp, ep->partial);
 			b->wp += ep->partial;
@@ -2109,7 +2064,7 @@ write(Usbhost *uh, Endpt *ep, void *a, long n, vlong off, int tok)
 				break;
 			}
 		}
-		freeb(b);
+		freeb(b); /* qtd calls incref; this undoes the one too many */
 	}
 	if(ep->epmode != Isomode){
 		sleep(&ep->dir[Dirout].rend, weptdone, ep);

+ 1 - 1
sys/src/boot/pc/sdata.c

@@ -1544,7 +1544,7 @@ atapnp(void)
 		case (0x266F<<16)|0x8086:	/* 82801FB (ICH6) */
 		case (0x27DF<<16)|0x8086:	/* 82801G SATA (ICH7) */
 		case (0x27C0<<16)|0x8086:	/* 82801GB SATA AHCI (ICH7) */
-		case (0x27C4<<16)|0x8086:	/* 82801GBM SATA (ICH7) */
+//		case (0x27C4<<16)|0x8086:	/* 82801GBM SATA (ICH7) */
 		case (0x27C5<<16)|0x8086:	/* 82801GBM SATA AHCI (ICH7) */
 			break;
 		}

+ 1 - 1
sys/src/boot/pc/sdiahci.c

@@ -1539,7 +1539,7 @@ didtype(Pcidev *p)
 		 */
 		if ((p->did & 0xfeff) == 0x2829 ||		/* ich8 */
 		    (p->did & 0xfffe) == 0x2922 ||		/* ich9 */
-		    (p->did & 0xfffe) == 0x27c4 || p->did == 0x27c0) /* ich7 */
+		    (p->did & 0xfffe) == 0x27c4 /* || p->did == 0x27c0 */ ) /* ich7 */
 			return Tich;
 		break;
 	case 0x1002: