Browse Source

Plan 9 from Bell Labs 2005-07-14

David du Colombier 18 years ago
parent
commit
6728d42205

+ 4 - 1
LICENSE

@@ -1,6 +1,6 @@
 The Plan 9 software is provided under the terms of the
 Lucent Public License, Version 1.02, reproduced below,
-with the following exceptions:
+with the following notable exceptions:
 
 1. No right is granted to create derivative works of or
    to redistribute (other than with the Plan 9 Operating System)
@@ -17,6 +17,9 @@ with the following exceptions:
    covered by the Aladdin Free Public License, reproduced in the file
    /LICENSE.afpl.
 
+Other, less notable exceptions are marked in the file tree with
+COPYING, COPYRIGHT, or LICENSE files.
+
 ===================================================================
 
 Lucent Public License Version 1.02

+ 5 - 5
dist/replica/_plan9.db

@@ -609,7 +609,7 @@
 68020/lib - 20000000775 sys sys 947992106 0
 68020/lib/ape - 20000000775 sys sys 947992106 0
 68020/mkfile - 664 sys sys 948141303 52
-LICENSE - 444 sys sys 1056856036 12895
+LICENSE - 444 sys sys 1121255398 13006
 LICENSE.afpl - 664 sys sys 1056855682 14333
 LICENSE.gpl - 664 sys sys 1056572448 15081
 NOTICE - 444 sys sys 1018803063 63
@@ -5764,7 +5764,7 @@ sys/games - 20000000775 sys sys 952648872 0
 sys/games/lib - 20000000775 sys sys 952648879 0
 sys/games/lib/4scores - 10000000664 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000664 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1120502468 254088
+sys/games/lib/fortunes - 664 sys sys 1121303903 254178
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -7981,7 +7981,7 @@ sys/src/9/pc/pcdisk - 664 sys sys 1073851851 1427
 sys/src/9/pc/pcf - 664 sys sys 1104430623 1485
 sys/src/9/pc/pcfl - 664 sys sys 1042004821 1563
 sys/src/9/pc/pcflop - 664 sys sys 1112361040 1454
-sys/src/9/pc/pci.c - 664 sys sys 1118159824 26297
+sys/src/9/pc/pci.c - 664 sys sys 1121260128 26418
 sys/src/9/pc/pcmciamodem.c - 664 sys sys 1099761153 1586
 sys/src/9/pc/pcmkfile - 664 sys sys 1109303822 101
 sys/src/9/pc/piix4smbus.c - 664 sys sys 1091129037 5230
@@ -7996,7 +7996,7 @@ sys/src/9/pc/screen.h - 664 sys sys 1060267144 3797
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1112461125 52220
 sys/src/9/pc/sd53c8xx.i - 664 sys sys 1045063730 27355
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1032059019 12455
-sys/src/9/pc/sdata.c - 664 sys sys 1114981770 51181
+sys/src/9/pc/sdata.c - 664 sys sys 1121260176 51278
 sys/src/9/pc/sdmylex.c - 664 sys sys 1071245460 27812
 sys/src/9/pc/sdscsi.c - 664 sys sys 1077033661 7487
 sys/src/9/pc/trap.c - 664 sys sys 1105109602 20537
@@ -8106,7 +8106,7 @@ sys/src/9/port/qlock.c - 664 sys sys 1067722765 3196
 sys/src/9/port/rdb.c - 664 sys sys 1018721202 1698
 sys/src/9/port/rebootcmd.c - 664 sys sys 1015278340 1561
 sys/src/9/port/sd.h - 664 sys sys 1098546338 2348
-sys/src/9/port/segment.c - 664 sys sys 1032990942 13776
+sys/src/9/port/segment.c - 664 sys sys 1121259584 13761
 sys/src/9/port/swap.c - 664 sys sys 1055688551 6980
 sys/src/9/port/sysfile.c - 664 sys sys 1100363052 22146
 sys/src/9/port/sysproc.c - 664 sys sys 1067722765 15396

+ 5 - 5
dist/replica/plan9.db

@@ -609,7 +609,7 @@
 68020/lib - 20000000775 sys sys 947992106 0
 68020/lib/ape - 20000000775 sys sys 947992106 0
 68020/mkfile - 664 sys sys 948141303 52
-LICENSE - 444 sys sys 1056856036 12895
+LICENSE - 444 sys sys 1121255398 13006
 LICENSE.afpl - 664 sys sys 1056855682 14333
 LICENSE.gpl - 664 sys sys 1056572448 15081
 NOTICE - 444 sys sys 1018803063 63
@@ -5764,7 +5764,7 @@ sys/games - 20000000775 sys sys 952648872 0
 sys/games/lib - 20000000775 sys sys 952648879 0
 sys/games/lib/4scores - 10000000664 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000664 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1120502468 254088
+sys/games/lib/fortunes - 664 sys sys 1121303903 254178
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -7981,7 +7981,7 @@ sys/src/9/pc/pcdisk - 664 sys sys 1073851851 1427
 sys/src/9/pc/pcf - 664 sys sys 1104430623 1485
 sys/src/9/pc/pcfl - 664 sys sys 1042004821 1563
 sys/src/9/pc/pcflop - 664 sys sys 1112361040 1454
-sys/src/9/pc/pci.c - 664 sys sys 1118159824 26297
+sys/src/9/pc/pci.c - 664 sys sys 1121260128 26418
 sys/src/9/pc/pcmciamodem.c - 664 sys sys 1099761153 1586
 sys/src/9/pc/pcmkfile - 664 sys sys 1109303822 101
 sys/src/9/pc/piix4smbus.c - 664 sys sys 1091129037 5230
@@ -7996,7 +7996,7 @@ sys/src/9/pc/screen.h - 664 sys sys 1060267144 3797
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1112461125 52220
 sys/src/9/pc/sd53c8xx.i - 664 sys sys 1045063730 27355
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1032059019 12455
-sys/src/9/pc/sdata.c - 664 sys sys 1114981770 51181
+sys/src/9/pc/sdata.c - 664 sys sys 1121260176 51278
 sys/src/9/pc/sdmylex.c - 664 sys sys 1071245460 27812
 sys/src/9/pc/sdscsi.c - 664 sys sys 1077033661 7487
 sys/src/9/pc/trap.c - 664 sys sys 1105109602 20537
@@ -8106,7 +8106,7 @@ sys/src/9/port/qlock.c - 664 sys sys 1067722765 3196
 sys/src/9/port/rdb.c - 664 sys sys 1018721202 1698
 sys/src/9/port/rebootcmd.c - 664 sys sys 1015278340 1561
 sys/src/9/port/sd.h - 664 sys sys 1098546338 2348
-sys/src/9/port/segment.c - 664 sys sys 1032990942 13776
+sys/src/9/port/segment.c - 664 sys sys 1121259584 13761
 sys/src/9/port/swap.c - 664 sys sys 1055688551 6980
 sys/src/9/port/sysfile.c - 664 sys sys 1100363052 22146
 sys/src/9/port/sysproc.c - 664 sys sys 1067722765 15396

+ 5 - 0
dist/replica/plan9.log

@@ -19634,3 +19634,8 @@
 1121139108 1 c 386/9pcdisk - 775 sys sys 1121138616 2040876
 1121139108 2 c 386/9pcf - 775 sys sys 1121138621 2383700
 1121198523 0 c sys/man/8/httpd - 664 sys sys 1121198377 6675
+1121256137 0 c LICENSE - 444 sys sys 1121255398 13006
+1121259737 0 c sys/src/9/port/segment.c - 664 sys sys 1121259584 13761
+1121261538 0 c sys/src/9/pc/pci.c - 664 sys sys 1121260128 26418
+1121261538 1 c sys/src/9/pc/sdata.c - 664 sys sys 1121260176 51278
+1121304747 0 c sys/games/lib/fortunes - 664 sys sys 1121303903 254178

+ 1 - 0
sys/games/lib/fortunes

@@ -4068,3 +4068,4 @@ i know what jmk did.  he added reentrancy for threads.  - boyd, about uintptr
 i hate all sorts of zealots  - boyd
 /* Watch the brackets - even Ken and Dennis get some language design wrong */
 Not related to the portable reciprocating power saw trademark of the Milwaukee Electric Tool Corporation.
+GNU C++ does not support old-style function definitions, so this extension is irrelevant.

+ 2 - 0
sys/src/9/pc/pci.c

@@ -635,6 +635,7 @@ static Bridge southbridges[] = {
 	{ 0x8086, 0x2440, pIIxget, pIIxset },	// Intel 82801BA
 	{ 0x8086, 0x244c, pIIxget, pIIxset },	// Intel 82801BAM
 	{ 0x8086, 0x248c, pIIxget, pIIxset },	// Intel 82801CAM
+	{ 0x8086, 0x24cc, pIIxget, pIIxset },	// Intel 82801DBM
 	{ 0x8086, 0x24d0, pIIxget, pIIxset },	// Intel 82801EB
 	{ 0x8086, 0x2640, pIIxget, pIIxset },	// Intel 82801FB
 	{ 0x1106, 0x0586, viaget, viaset },	// Viatech 82C586
@@ -649,6 +650,7 @@ static Bridge southbridges[] = {
 
 	{ 0x1022, 0x746B, nil, nil },		// AMD 8111
 	{ 0x10DE, 0x00D1, nil, nil },		// NVIDIA nForce 3
+	{ 0x1166, 0x0200, nil, nil },		// ServerWorks ServerSet III LE
 };
 
 typedef struct Slot Slot;

+ 19 - 10
sys/src/9/pc/sdata.c

@@ -149,7 +149,7 @@ enum {					/* Bmisx */
 	Dma1cap		= 0x40,		/* Drive 0 DMA Capable */
 };
 enum {					/* Physical Region Descriptor */
-	PrdEOT		= 0x80000000,	/* Bus Master IDE Active */
+	PrdEOT		= 0x80000000,	/* End of Transfer */
 };
 
 enum {					/* offsets into the identify info. */
@@ -260,7 +260,8 @@ typedef struct Prd {
 } Prd;
 
 enum {
-	Nprd		= SDmaxio/(64*1024)+2,
+	PRDmaxio	= 32*1024,	/* must be power of 2 <= 64*1024 */
+	Nprd		= SDmaxio/PRDmaxio+2,
 };
 
 typedef struct Ctlr {
@@ -278,7 +279,6 @@ typedef struct Ctlr {
 	Drive*	drive[2];
 
 	Prd*	prdt;			/* physical region descriptor table */
-	void*	prdtbase;
 
 	QLock;				/* current command */
 	Drive*	curdrive;
@@ -1075,9 +1075,9 @@ atadmasetup(Drive* drive, int len)
 
 	for(;;){
 		prd->pa = pa;
-		count = 64*1024 - (pa & 0xFFFF);
+		count = PRDmaxio - (pa & (PRDmaxio-1));
 		if(count >= len){
-			prd->count = PrdEOT|(len & 0xFFFF);
+			prd->count = PrdEOT|(len & (PRDmaxio-1));
 			break;
 		}
 		prd->count = count;
@@ -1913,10 +1913,21 @@ atapnp(void)
 			 * address for the registers (0x50?).
 			 */
 			break;
+		case (0x0211<<16)|0x1166:	/* ServerWorks IB6566 */
+			{
+				Pcidev *sb;
+
+				sb = pcimatch(nil, 0x1166, 0x0200);
+				if(sb == nil)
+					break;
+				r = pcicfgr32(sb, 0x64);
+				r &= ~0x2000;
+				pcicfgw32(sb, 0x64, r);
+			}
+			break;
 		case (0x5513<<16)|0x1039:	/* SiS 962 */
 		case (0x0646<<16)|0x1095:	/* CMD 646 */
 		case (0x0571<<16)|0x1106:	/* VIA 82C686 */
-		case (0x0211<<16)|0x1166:	/* ServerWorks IB6566 */
 		case (0x1230<<16)|0x8086:	/* 82371FB (PIIX) */
 		case (0x7010<<16)|0x8086:	/* 82371SB (PIIX3) */
 		case (0x7111<<16)|0x8086:	/* 82371[AE]B (PIIX4[E]) */
@@ -2063,9 +2074,7 @@ ataenable(SDev* sdev)
 #define ALIGN	(4 * 1024)
 		if(ctlr->pcidev != nil)
 			pcisetbme(ctlr->pcidev);
-		// ctlr->prdt = xspanalloc(Nprd*sizeof(Prd), 4, 4*1024);
-		ctlr->prdtbase = xalloc(Nprd * sizeof(Prd) + ALIGN);
-		ctlr->prdt = (Prd *)(((ulong)ctlr->prdtbase + ALIGN) & ~(ALIGN - 1));
+		ctlr->prdt = mallocalign(Nprd*sizeof(Prd), 4, 0, 4*1024);
 	}
 	snprint(name, sizeof(name), "%s (%s)", sdev->name, sdev->ifc->name);
 	intrenable(ctlr->irq, atainterrupt, ctlr, ctlr->tbdf, name);
@@ -2091,7 +2100,7 @@ atadisable(SDev *sdev)
 	if (ctlr->bmiba) {
 		if (ctlr->pcidev)
 			pciclrbme(ctlr->pcidev);
-		xfree(ctlr->prdtbase);
+		free(ctlr->prdt);
 	}
 	return 0;
 }

+ 1 - 2
sys/src/9/port/segment.c

@@ -261,7 +261,6 @@ attachimage(int type, Chan *c, ulong base, ulong len)
 			   eqqid(c->mqid, i->mqid) &&
 			   c->mchan == i->mchan &&
 			   c->type == i->type) {
-				i->ref++;
 				goto found;
 			}
 			unlock(i);
@@ -288,7 +287,6 @@ attachimage(int type, Chan *c, ulong base, ulong len)
 	i->qid = c->qid;
 	i->mqid = c->mqid;
 	i->mchan = c->mchan;
-	i->ref = 1;
 	l = &ihash(c->qid.path);
 	i->hash = *l;
 	*l = i;
@@ -303,6 +301,7 @@ found:
 		}
 		i->s = newseg(type, base, len);
 		i->s->image = i;
+		i->ref++;
 		poperror();
 	}
 	else