Browse Source

Plan 9 from Bell Labs 2004-09-29

David du Colombier 17 years ago
parent
commit
22199bba81

+ 15 - 17
dist/replica/_plan9.db

@@ -240,9 +240,9 @@
 386/bin/fs/v6fs - 775 sys sys 1085077059 92322
 386/bin/ftpfs - 775 sys sys 1093489558 146386
 386/bin/games - 20000000775 sys sys 1096298711 0
-386/bin/games/juggle - 775 sys sys 1096307527 123161
-386/bin/games/mahjongg - 775 sys sys 1096298712 161454
-386/bin/games/sokoban - 775 sys sys 1096298711 157093
+386/bin/games/juggle - 775 sys sys 1096341940 123161
+386/bin/games/mahjongg - 775 sys sys 1096341940 161454
+386/bin/games/sokoban - 775 sys sys 1096341940 157093
 386/bin/getmap - 775 sys sys 1085077059 63150
 386/bin/gif - 775 sys sys 1085077060 155975
 386/bin/grap - 775 sys sys 1094040086 280301
@@ -5339,7 +5339,7 @@ sys/src/9/pc/archmp.c - 664 sys sys 1084475127 2311
 sys/src/9/pc/audio.h - 664 sys sys 1015014513 343
 sys/src/9/pc/cga.c - 664 sys sys 1015014513 1843
 sys/src/9/pc/dat.h - 664 sys sys 1091904418 6281
-sys/src/9/pc/devarch.c - 664 sys sys 1091733724 18481
+sys/src/9/pc/devarch.c - 664 sys sys 1096379063 18517
 sys/src/9/pc/devether.c - 664 sys sys 1078928204 10183
 sys/src/9/pc/devfloppy.c - 664 sys sys 1055689885 20024
 sys/src/9/pc/devi82365.c - 664 sys sys 1086406910 19989
@@ -5381,7 +5381,7 @@ sys/src/9/pc/etherwavelan.c - 664 sys sys 1026847642 3722
 sys/src/9/pc/floppy.h - 664 sys sys 1055700609 3835
 sys/src/9/pc/fns.h - 664 sys sys 1089046996 4372
 sys/src/9/pc/hcwAMC.h - 664 sys sys 1026860163 166004
-sys/src/9/pc/i8253.c - 664 sys sys 1084475127 6272
+sys/src/9/pc/i8253.c - 664 sys sys 1096379063 6279
 sys/src/9/pc/i8259.c - 664 sys sys 1015014519 4423
 sys/src/9/pc/init9.c - 664 sys sys 1040002518 94
 sys/src/9/pc/initcode.s - 664 sys sys 1015014519 282
@@ -5406,7 +5406,7 @@ sys/src/9/pc/pcdisk - 664 sys sys 1073851851 1427
 sys/src/9/pc/pcf - 664 sys sys 1079575654 1462
 sys/src/9/pc/pcfl - 664 sys sys 1042004821 1563
 sys/src/9/pc/pcflop - 664 sys sys 1067722894 1383
-sys/src/9/pc/pci.c - 664 sys sys 1087657460 25736
+sys/src/9/pc/pci.c - 664 sys sys 1096379063 25817
 sys/src/9/pc/pcmciamodem.c - 664 sys sys 1048635123 1545
 sys/src/9/pc/piix4smbus.c - 664 sys sys 1091129037 5230
 sys/src/9/pc/plan9l.s - 664 sys sys 1015014521 910
@@ -5425,7 +5425,7 @@ 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 1092080705 20458
 sys/src/9/pc/uarti8250.c - 664 sys sys 1067722686 13859
-sys/src/9/pc/uartpci.c - 664 sys sys 1015014524 2709
+sys/src/9/pc/uartpci.c - 664 sys sys 1096379063 2891
 sys/src/9/pc/usb.h - 664 sys sys 1063857246 3566
 sys/src/9/pc/usbuhci.c - 664 sys sys 1091287613 30721
 sys/src/9/pc/vga.c - 664 sys sys 1039753497 4963
@@ -6480,7 +6480,7 @@ sys/src/boot/pc/boot.c - 664 sys sys 1021579983 3353
 sys/src/boot/pc/bootld.c - 664 sys sys 1015007948 1801
 sys/src/boot/pc/bootp.c - 664 sys sys 1094674486 12069
 sys/src/boot/pc/cga.c - 664 sys sys 1015007948 1362
-sys/src/boot/pc/clock.c - 664 sys sys 1088089722 5783
+sys/src/boot/pc/clock.c - 664 sys sys 1096379794 5819
 sys/src/boot/pc/conf.c - 664 sys sys 1094674484 10217
 sys/src/boot/pc/console.c - 664 sys sys 1094674483 3388
 sys/src/boot/pc/dat.h - 664 sys sys 1094674488 3518
@@ -6508,8 +6508,8 @@ sys/src/boot/pc/ether8390.h - 664 sys sys 1015007951 1392
 sys/src/boot/pc/etherec2t.c - 664 sys sys 1015007951 3598
 sys/src/boot/pc/etherelnk3.c - 664 sys sys 1034454878 44068
 sys/src/boot/pc/etherelnk3x.c - 664 sys sys 1015007951 24989
-sys/src/boot/pc/etherif.h - 664 sys sys 1015007951 1285
-sys/src/boot/pc/etherigbe.c - 664 sys sys 1094674487 39270
+sys/src/boot/pc/etherif.h - 664 sys sys 1096379797 1285
+sys/src/boot/pc/etherigbe.c - 664 sys sys 1096379796 39825
 sys/src/boot/pc/ethermii.c - 664 sys sys 1071175087 4493
 sys/src/boot/pc/ethermii.h - 664 sys sys 1071175087 3259
 sys/src/boot/pc/etherrhine.c - 664 sys sys 1071175087 12403
@@ -6538,13 +6538,13 @@ sys/src/boot/pc/pbsdisk.s - 664 sys sys 1017854325 6371
 sys/src/boot/pc/pbsdisklba - 775 sys sys 1015007954 509
 sys/src/boot/pc/pbsdisklba.s - 664 sys sys 1015007954 6022
 sys/src/boot/pc/pbslba.s - 664 sys sys 1017854326 8147
-sys/src/boot/pc/pci.c - 664 sys sys 1065815736 17580
+sys/src/boot/pc/pci.c - 664 sys sys 1096379795 17688
 sys/src/boot/pc/print.c - 664 sys sys 1094674483 219
 sys/src/boot/pc/queue.c - 664 sys sys 1015007954 566
 sys/src/boot/pc/sd.h - 664 sys sys 1094674489 2271
 sys/src/boot/pc/sd53c8xx.c - 664 sys sys 1077033951 52135
 sys/src/boot/pc/sd53c8xx.i - 664 sys sys 1015007955 27245
-sys/src/boot/pc/sdata.c - 664 sys sys 1094674485 35425
+sys/src/boot/pc/sdata.c - 664 sys sys 1096379795 35481
 sys/src/boot/pc/sdmylex.c - 664 sys sys 1015007955 28743
 sys/src/boot/pc/sdscsi.c - 664 sys sys 1077033682 7022
 sys/src/boot/pc/trap.c - 664 sys sys 1018462833 7098
@@ -6788,7 +6788,7 @@ sys/src/cmd/acme/ecmd.c - 664 sys sys 1077376256 24294
 sys/src/cmd/acme/edit.c - 664 sys sys 1015701171 12055
 sys/src/cmd/acme/edit.h - 664 sys sys 969500816 2466
 sys/src/cmd/acme/elog.c - 664 sys sys 1078839859 7236
-sys/src/cmd/acme/exec.c - 664 sys sys 1086809679 28158
+sys/src/cmd/acme/exec.c - 664 sys sys 1096388101 28104
 sys/src/cmd/acme/file.c - 664 sys sys 1044626079 5717
 sys/src/cmd/acme/fns.h - 664 sys sys 1079102913 2883
 sys/src/cmd/acme/fsys.c - 664 sys sys 1079102915 12799
@@ -6800,7 +6800,7 @@ sys/src/cmd/acme/scrl.c - 664 sys sys 1014926095 3072
 sys/src/cmd/acme/text.c - 664 sys sys 1084542489 27383
 sys/src/cmd/acme/time.c - 664 sys sys 1014926095 1783
 sys/src/cmd/acme/util.c - 664 sys sys 1079102916 7412
-sys/src/cmd/acme/wind.c - 664 sys sys 1082924470 11115
+sys/src/cmd/acme/wind.c - 664 sys sys 1096388102 11187
 sys/src/cmd/acme/xfid.c - 664 sys sys 1079044030 19175
 sys/src/cmd/ar.c - 664 sys sys 1046643027 23717
 sys/src/cmd/archfs.c - 664 sys sys 1014925694 3871
@@ -12382,6 +12382,4 @@ usr/glenda/lib/profile - 664 glenda glenda 1021580005 847
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
-386/bin/games/juggle - 775 sys sys 1096341940 123161
-386/bin/games/mahjongg - 775 sys sys 1096341940 161454
-386/bin/games/sokoban - 775 sys sys 1096341940 157093
+386/bin/acme - 775 sys sys 1096427265 424088

+ 12 - 12
dist/replica/plan9.db

@@ -20,7 +20,7 @@
 386/bin/9660srv - 775 sys sys 1085076971 101995
 386/bin/aan - 775 sys sys 1085076971 128820
 386/bin/acid - 775 sys sys 1091936087 353717
-386/bin/acme - 775 sys sys 1086836655 424880
+386/bin/acme - 775 sys sys 1096427265 424088
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1087442501 132681
 386/bin/ape/cc - 775 sys sys 1085076973 68304
@@ -5339,7 +5339,7 @@ sys/src/9/pc/archmp.c - 664 sys sys 1084475127 2311
 sys/src/9/pc/audio.h - 664 sys sys 1015014513 343
 sys/src/9/pc/cga.c - 664 sys sys 1015014513 1843
 sys/src/9/pc/dat.h - 664 sys sys 1091904418 6281
-sys/src/9/pc/devarch.c - 664 sys sys 1091733724 18481
+sys/src/9/pc/devarch.c - 664 sys sys 1096379063 18517
 sys/src/9/pc/devether.c - 664 sys sys 1078928204 10183
 sys/src/9/pc/devfloppy.c - 664 sys sys 1055689885 20024
 sys/src/9/pc/devi82365.c - 664 sys sys 1086406910 19989
@@ -5381,7 +5381,7 @@ sys/src/9/pc/etherwavelan.c - 664 sys sys 1026847642 3722
 sys/src/9/pc/floppy.h - 664 sys sys 1055700609 3835
 sys/src/9/pc/fns.h - 664 sys sys 1089046996 4372
 sys/src/9/pc/hcwAMC.h - 664 sys sys 1026860163 166004
-sys/src/9/pc/i8253.c - 664 sys sys 1084475127 6272
+sys/src/9/pc/i8253.c - 664 sys sys 1096379063 6279
 sys/src/9/pc/i8259.c - 664 sys sys 1015014519 4423
 sys/src/9/pc/init9.c - 664 sys sys 1040002518 94
 sys/src/9/pc/initcode.s - 664 sys sys 1015014519 282
@@ -5406,7 +5406,7 @@ sys/src/9/pc/pcdisk - 664 sys sys 1073851851 1427
 sys/src/9/pc/pcf - 664 sys sys 1079575654 1462
 sys/src/9/pc/pcfl - 664 sys sys 1042004821 1563
 sys/src/9/pc/pcflop - 664 sys sys 1067722894 1383
-sys/src/9/pc/pci.c - 664 sys sys 1087657460 25736
+sys/src/9/pc/pci.c - 664 sys sys 1096379063 25817
 sys/src/9/pc/pcmciamodem.c - 664 sys sys 1048635123 1545
 sys/src/9/pc/piix4smbus.c - 664 sys sys 1091129037 5230
 sys/src/9/pc/plan9l.s - 664 sys sys 1015014521 910
@@ -5425,7 +5425,7 @@ 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 1092080705 20458
 sys/src/9/pc/uarti8250.c - 664 sys sys 1067722686 13859
-sys/src/9/pc/uartpci.c - 664 sys sys 1015014524 2709
+sys/src/9/pc/uartpci.c - 664 sys sys 1096379063 2891
 sys/src/9/pc/usb.h - 664 sys sys 1063857246 3566
 sys/src/9/pc/usbuhci.c - 664 sys sys 1091287613 30721
 sys/src/9/pc/vga.c - 664 sys sys 1039753497 4963
@@ -6480,7 +6480,7 @@ sys/src/boot/pc/boot.c - 664 sys sys 1021579983 3353
 sys/src/boot/pc/bootld.c - 664 sys sys 1015007948 1801
 sys/src/boot/pc/bootp.c - 664 sys sys 1094674486 12069
 sys/src/boot/pc/cga.c - 664 sys sys 1015007948 1362
-sys/src/boot/pc/clock.c - 664 sys sys 1088089722 5783
+sys/src/boot/pc/clock.c - 664 sys sys 1096379794 5819
 sys/src/boot/pc/conf.c - 664 sys sys 1094674484 10217
 sys/src/boot/pc/console.c - 664 sys sys 1094674483 3388
 sys/src/boot/pc/dat.h - 664 sys sys 1094674488 3518
@@ -6508,8 +6508,8 @@ sys/src/boot/pc/ether8390.h - 664 sys sys 1015007951 1392
 sys/src/boot/pc/etherec2t.c - 664 sys sys 1015007951 3598
 sys/src/boot/pc/etherelnk3.c - 664 sys sys 1034454878 44068
 sys/src/boot/pc/etherelnk3x.c - 664 sys sys 1015007951 24989
-sys/src/boot/pc/etherif.h - 664 sys sys 1015007951 1285
-sys/src/boot/pc/etherigbe.c - 664 sys sys 1094674487 39270
+sys/src/boot/pc/etherif.h - 664 sys sys 1096379797 1285
+sys/src/boot/pc/etherigbe.c - 664 sys sys 1096379796 39825
 sys/src/boot/pc/ethermii.c - 664 sys sys 1071175087 4493
 sys/src/boot/pc/ethermii.h - 664 sys sys 1071175087 3259
 sys/src/boot/pc/etherrhine.c - 664 sys sys 1071175087 12403
@@ -6538,13 +6538,13 @@ sys/src/boot/pc/pbsdisk.s - 664 sys sys 1017854325 6371
 sys/src/boot/pc/pbsdisklba - 775 sys sys 1015007954 509
 sys/src/boot/pc/pbsdisklba.s - 664 sys sys 1015007954 6022
 sys/src/boot/pc/pbslba.s - 664 sys sys 1017854326 8147
-sys/src/boot/pc/pci.c - 664 sys sys 1065815736 17580
+sys/src/boot/pc/pci.c - 664 sys sys 1096379795 17688
 sys/src/boot/pc/print.c - 664 sys sys 1094674483 219
 sys/src/boot/pc/queue.c - 664 sys sys 1015007954 566
 sys/src/boot/pc/sd.h - 664 sys sys 1094674489 2271
 sys/src/boot/pc/sd53c8xx.c - 664 sys sys 1077033951 52135
 sys/src/boot/pc/sd53c8xx.i - 664 sys sys 1015007955 27245
-sys/src/boot/pc/sdata.c - 664 sys sys 1094674485 35425
+sys/src/boot/pc/sdata.c - 664 sys sys 1096379795 35481
 sys/src/boot/pc/sdmylex.c - 664 sys sys 1015007955 28743
 sys/src/boot/pc/sdscsi.c - 664 sys sys 1077033682 7022
 sys/src/boot/pc/trap.c - 664 sys sys 1018462833 7098
@@ -6788,7 +6788,7 @@ sys/src/cmd/acme/ecmd.c - 664 sys sys 1077376256 24294
 sys/src/cmd/acme/edit.c - 664 sys sys 1015701171 12055
 sys/src/cmd/acme/edit.h - 664 sys sys 969500816 2466
 sys/src/cmd/acme/elog.c - 664 sys sys 1078839859 7236
-sys/src/cmd/acme/exec.c - 664 sys sys 1086809679 28158
+sys/src/cmd/acme/exec.c - 664 sys sys 1096388101 28104
 sys/src/cmd/acme/file.c - 664 sys sys 1044626079 5717
 sys/src/cmd/acme/fns.h - 664 sys sys 1079102913 2883
 sys/src/cmd/acme/fsys.c - 664 sys sys 1079102915 12799
@@ -6800,7 +6800,7 @@ sys/src/cmd/acme/scrl.c - 664 sys sys 1014926095 3072
 sys/src/cmd/acme/text.c - 664 sys sys 1084542489 27383
 sys/src/cmd/acme/time.c - 664 sys sys 1014926095 1783
 sys/src/cmd/acme/util.c - 664 sys sys 1079102916 7412
-sys/src/cmd/acme/wind.c - 664 sys sys 1082924470 11115
+sys/src/cmd/acme/wind.c - 664 sys sys 1096388102 11187
 sys/src/cmd/acme/xfid.c - 664 sys sys 1079044030 19175
 sys/src/cmd/ar.c - 664 sys sys 1046643027 23717
 sys/src/cmd/archfs.c - 664 sys sys 1014925694 3871

+ 12 - 0
dist/replica/plan9.log

@@ -16772,3 +16772,15 @@
 1096342261 0 c 386/bin/games/juggle - 775 sys sys 1096341940 123161
 1096342261 1 c 386/bin/games/mahjongg - 775 sys sys 1096341940 161454
 1096342261 2 c 386/bin/games/sokoban - 775 sys sys 1096341940 157093
+1096380069 0 c sys/src/9/pc/devarch.c - 664 sys sys 1096379063 18517
+1096380069 1 c sys/src/9/pc/i8253.c - 664 sys sys 1096379063 6279
+1096380069 2 c sys/src/9/pc/pci.c - 664 sys sys 1096379063 25817
+1096380069 3 c sys/src/9/pc/uartpci.c - 664 sys sys 1096379063 2891
+1096380069 4 c sys/src/boot/pc/clock.c - 664 sys sys 1096379794 5819
+1096380069 5 c sys/src/boot/pc/etherif.h - 664 sys sys 1096379797 1285
+1096380069 6 c sys/src/boot/pc/etherigbe.c - 664 sys sys 1096379796 39825
+1096380069 7 c sys/src/boot/pc/pci.c - 664 sys sys 1096379795 17688
+1096380069 8 c sys/src/boot/pc/sdata.c - 664 sys sys 1096379795 35481
+1096389071 0 c sys/src/cmd/acme/exec.c - 664 sys sys 1096388101 28104
+1096389071 1 c sys/src/cmd/acme/wind.c - 664 sys sys 1096388102 11187
+1096428678 0 c 386/bin/acme - 775 sys sys 1096427265 424088

+ 1 - 0
sys/src/9/pc/devarch.c

@@ -558,6 +558,7 @@ static X86type x86intel[] =
 	{ 6,	8,	16,	"PentiumIII/Xeon", },
 	{ 6,	0xB,	16,	"PentiumIII/Xeon", },
 	{ 0xF,	1,	16,	"P4", },	/* P4 */
+	{ 0xF,	2,	16,	"PentiumIV/Xeon", },
 
 	{ 3,	-1,	32,	"386", },	/* family defaults */
 	{ 4,	-1,	22,	"486", },

+ 3 - 3
sys/src/9/pc/i8253.c

@@ -118,8 +118,8 @@ i8253init(void)
 void
 guesscpuhz(int aalcycles)
 {
-	int cpufreq, loops, incr, x, y;
-	uvlong a, b;
+	int loops, incr, x, y;
+	uvlong a, b, cpufreq;
 
 	/* find biggest loop that doesn't wrap */
 	incr = 16000000/(aalcycles*HZ*2);
@@ -160,7 +160,7 @@ guesscpuhz(int aalcycles)
  	 *  figure out clock frequency and a loop multiplier for delay().
 	 *  n.b. counter goes up by 2*Freq
 	 */
-	cpufreq = loops*((aalcycles*2*Freq)/x);
+	cpufreq = (vlong)loops*((aalcycles*2*Freq)/x);
 	m->loopconst = (cpufreq/1000)/aalcycles;	/* AAM+LOOP's for 1 ms */
 
 	if(m->havetsc){

+ 4 - 3
sys/src/9/pc/pci.c

@@ -634,6 +634,7 @@ static Bridge southbridges[] = {
 	{ 0x8086, 0x2420, pIIxget, pIIxset },	// Intel 82801AB
 	{ 0x8086, 0x2440, pIIxget, pIIxset },	// Intel 82801BA
 	{ 0x8086, 0x244c, pIIxget, pIIxset },	// Intel 82801BAM
+	{ 0x8086, 0x24d0, pIIxget, pIIxset },	// Intel ICH5R, as found in 875P chipset
 	{ 0x1106, 0x0586, viaget, viaset },	// Viatech 82C586
 	{ 0x1106, 0x0596, viaget, viaset },	// Viatech 82C596
 	{ 0x1106, 0x0686, viaget, viaset },	// Viatech 82C686
@@ -655,9 +656,9 @@ struct Slot {
 
 typedef struct Router Router;
 struct Router {
-	uchar	signature[4];	// Routing table signature
+	uchar	signature[4];		// Routing table signature
 	uchar	version[2];		// Version number
-	uchar	size[2];			// Total table size
+	uchar	size[2];		// Total table size
 	uchar	bus;			// Interrupt router bus number
 	uchar	devfn;			// Router's devfunc
 	uchar	pciirqs[2];		// Exclusive PCI irqs
@@ -668,7 +669,7 @@ struct Router {
 };
 
 static ushort pciirqs;			// Exclusive PCI irqs
-static Bridge *southbridge;	// Which southbridge to use.
+static Bridge *southbridge;		// Which southbridge to use.
 
 static void
 pcirouting(void)

+ 6 - 1
sys/src/9/pc/uartpci.c

@@ -69,7 +69,8 @@ uartpcipnp(void)
 		switch((p->did<<16)|p->vid){
 		default:
 			continue;
-		case (0x9050<<16)|0x10B5:	/* Perle PCI-Fast4 */
+		case (0x9050<<16)|0x10B5:	/* Perle PCI-Fast4 series */
+		case (0x9030<<16)|0x10B5:	/* Perle Ultraport series */
 			/*
 			 * These devices consists of a PLX bridge (the above
 			 * PCI VID+DID) behind which are some 16C654 UARTs.
@@ -93,6 +94,10 @@ uartpcipnp(void)
 				n = 4;
 				name = "PCI-Fast4";
 				break;
+			case (0x0021<<16)|0x155F:	/* Perle Ultraport8 */
+				n = 8;
+				name = "Ultraport8";	/* 16C754 UARTs */
+				break;
 			}
 			uart = uartpci(ctlrno, p, 2, n, 7372800, name);
 			if(uart == nil)

+ 1 - 0
sys/src/boot/pc/clock.c

@@ -83,6 +83,7 @@ X86type x86intel[] =
 	{ 6,	8,	16,	"PentiumIII/Xeon", },
 	{ 6,	0xB,	16,	"PentiumIII/Xeon", },
 	{ 0xF,	1,	16,	"P4", },	/* P4 */
+	{ 0xF,	2,	16,	"PentiumIV/Xeon", },
 
 	{ 3,	-1,	32,	"386", },	/* family defaults */
 	{ 4,	-1,	22,	"486", },

+ 2 - 2
sys/src/boot/pc/etherif.h

@@ -9,8 +9,8 @@ enum {
 	Host		= 0,		/* buffer owned by host */
 	Interface	= 1,		/* buffer owned by card */
 
-	Nrb		= 16,		/* default number of receive buffers */
-	Ntb		= 2,		/* default number of transmit buffers */
+	Nrb		= 32,		/* default number of receive buffers */
+	Ntb		= 8,		/* default number of transmit buffers */
 };
 
 typedef struct Ether Ether;

+ 26 - 5
sys/src/boot/pc/etherigbe.c

@@ -6,11 +6,12 @@
  * is made to handle the older chip although it should be possible.
  *
  * updated just enough to cope with the
- * Intel 8254[340]NN Gigabit Ethernet Controller
+ * Intel 8254[0347]NN Gigabit Ethernet Controller
  * as found on the Intel PRO/1000 series of adapters:
+ *	82540EM Intel PRO/1000 MT
  *	82543GC	Intel PRO/1000 T
  *	82544EI Intel PRO/1000 XT
- *	82540EM Intel PRO/1000 MT
+ *	82547EI built-in
  *
  * The datasheet is not very clear about running on a big-endian system
  * and this driver assumes little-endian throughout.
@@ -863,6 +864,7 @@ igbeinit(Ether* edev)
 		break;
 	case (0x1004<<16)|0x8086:	/* 82543GC */
 	case (0x1008<<16)|0x8086:	/* 82544EI */
+	case (0x1019<<16)|0x8086:	/* 82547EI */
 	case (0x100E<<16)|0x8086:	/* 82440EM */
 	case (0x101E<<16)|0x8086:	/* 82540EPLP */
 		r = 8;
@@ -1078,9 +1080,10 @@ igbemiimiw(Mii* mii, int pa, int ra, int data)
 static int
 igbemii(Ctlr* ctlr)
 {
-	MiiPhy *phy;
+	MiiPhy *phy = (MiiPhy *)1;
 	int ctrl, p, r;
 
+	USED(phy);
 	r = csr32r(ctlr, Status);
 	if(r & Tbimode)
 		return -1;
@@ -1120,6 +1123,7 @@ igbemii(Ctlr* ctlr)
 		ctlr->mii->miw = i82543miimiw;
 		break;
 	case (0x1008<<16)|0x8086:		/* 82544EI*/
+	case (0x1019<<16)|0x8086:		/* 82547EI*/
 	case (0x100E<<16)|0x8086:		/* 82540EM */
 	case (0x101E<<16)|0x8086:		/* 82540EPLP */
 		ctrl &= ~(Frcdplx|Frcspd);
@@ -1134,6 +1138,8 @@ igbemii(Ctlr* ctlr)
 	}
 
 	if(mii(ctlr->mii, ~0) == 0 || (phy = ctlr->mii->curphy) == nil){
+		if (0)
+			print("phy trouble: phy = 0x%lux\n", (ulong)phy);
 		free(ctlr->mii);
 		ctlr->mii = nil;
 		return -1;
@@ -1326,10 +1332,13 @@ detach(Ctlr *ctlr)
 	delay(10);
 
 	csr32w(ctlr, Ctrl, Devrst);
+	/* apparently needed on multi-GHz processors to avoid infinite loops */
+	delay(1);
 	while(csr32r(ctlr, Ctrl) & Devrst)
 		;
 
 	csr32w(ctlr, Ctrlext, Eerst);
+	delay(1);
 	while(csr32r(ctlr, Ctrlext) & Eerst)
 		;
 
@@ -1345,6 +1354,7 @@ detach(Ctlr *ctlr)
 	}
 
 	csr32w(ctlr, Imc, ~0);
+	delay(1);
 	while(csr32r(ctlr, Icr))
 		;
 }
@@ -1373,7 +1383,9 @@ igbereset(Ctlr* ctlr)
 	 * Read the EEPROM, validate the checksum
 	 * then get the device back to a power-on state.
 	 */
-	if((r = at93c46r(ctlr)) != 0xBABA){
+	r = at93c46r(ctlr);
+	/* zero return means no SPI EEPROM access */
+	if (r != 0 && r != 0xBABA){
 		print("igbe: bad EEPROM checksum - 0x%4.4uX\n", r);
 		return -1;
 	}
@@ -1489,6 +1501,12 @@ igbepci(void)
 	int port, cls;
 	Pcidev *p;
 	Ctlr *ctlr;
+	static int first = 1;
+
+	if (first)
+		first = 0;
+	else
+		return;
 
 	p = nil;
 	while(p = pcimatch(p, 0, 0)){
@@ -1503,14 +1521,17 @@ igbepci(void)
 			break;
 		case (0x1004<<16)|0x8086:	/* 82543GC - copper (PRO/1000 T) */
 		case (0x1008<<16)|0x8086:	/* 82544EI - copper */
+		case (0x1019<<16)|0x8086:	/* 82547EI - copper */
 		case (0x100E<<16)|0x8086:	/* 82540EM - copper */
 		case (0x101E<<16)|0x8086:	/* 82540EPLP - copper */
 			break;
 		}
 
+		/* the 82547EI is on the CSA bus, whatever that is */
 		port = upamalloc(p->mem[0].bar & ~0x0F, p->mem[0].size, 0);
 		if(port == 0){
-			print("igbe: can't map %8.8luX\n", p->mem[0].bar);
+			print("igbe: can't map %d @ 0x%8.8luX\n",
+				p->mem[0].size, p->mem[0].bar);
 			continue;
 		}
 

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

@@ -306,6 +306,7 @@ enum {
 		Intel_82801AB_0 = 0x2420,
 		Intel_82801BA_0 = 0x2440,
 		Intel_82801BAM_0 = 0x244c,
+		Intel_82801ICH5R_0 = 0x24d0,	/* part # is a guess */
 	Viatech = 0x1106,
 		Via_82C586_0 = 0x0586,
 		Via_82C596 = 0x0596,
@@ -337,6 +338,7 @@ static bridge_t southbridges[] = {
 {	Intel, Intel_82801AB_0,		pIIx_link,	pIIx_init },
 {	Intel, Intel_82801BA_0,		pIIx_link,	pIIx_init },
 {	Intel, Intel_82801BAM_0,	pIIx_link,	pIIx_init },
+{	Intel, Intel_82801ICH5R_0,	pIIx_link,	pIIx_init },
 {	Viatech, Via_82C586_0,		via_link,	via_init },
 {	Viatech, Via_82C596,		via_link,	via_init },
 {	Viatech, Via_82C686,		via_link,	via_init },

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

@@ -1372,6 +1372,7 @@ atapnp(void)
 		case (0x4D38<<16)|0x105A:	/* Promise PDC20262 */
 		case (0x4D30<<16)|0x105A:	/* Promise PDC202xx */
 		case (0x4D68<<16)|0x105A:	/* Promise PDC20268 */
+		case (0x4D69<<16)|0x105A:	/* Promise Ultra/133 TX2 */
 		case (0x3373<<16)|0x105A:	/* Promise 20378 RAID */
 		case (0x3149<<16)|0x1106:	/* VIA VT8237 SATA/RAID */
 			pi = 0x85;

+ 27 - 19
sys/src/cmd/acme/exec.c

@@ -1020,18 +1020,27 @@ incl(Text *et, Text*, Text *argt, int, int, Rune *arg, int narg)
 	}
 }
 
-static int indentval(Rune *s, int n){
+enum {
+	IGlobal = -2,
+	IError = -1,
+	Ion = 0,
+	Ioff = 1,
+};
+
+static int
+indentval(Rune *s, int n)
+{
 	if(n < 2)
-		return -1;
+		return IError;
 	if(runestrncmp(s, L"ON", n) == 0){
 		globalautoindent = TRUE;
 		warning(nil, "Indent ON\n");
-		return -2;
+		return IGlobal;
 	}
 	if(runestrncmp(s, L"OFF", n) == 0){
 		globalautoindent = FALSE;
 		warning(nil, "Indent OFF\n");
-		return -2;
+		return IGlobal;
 	}
 	return runestrncmp(s, L"on", n) == 0;
 }
@@ -1042,12 +1051,11 @@ indent(Text *et, Text*, Text *argt, int, int, Rune *arg, int narg)
 	Rune *a, *r;
 	Window *w;
 	int na, len, autoindent;
-	char *result;
 
-	if(et==nil || et->w==nil)
-		return;
-	w = et->w;
-	autoindent = -1;
+	w = nil;
+	if(et!=nil && et->w!=nil)
+		w = et->w;
+	autoindent = IError;
 	getarg(argt, FALSE, TRUE, &r, &len);
 	if(r!=nil && len>0)
 		autoindent = indentval(r, len);
@@ -1056,16 +1064,16 @@ indent(Text *et, Text*, Text *argt, int, int, Rune *arg, int narg)
 		if(a != arg)
 			autoindent = indentval(arg, narg-na);
 	}
-	if(autoindent >= 0)
-		w->autoindent = autoindent;
-	if(autoindent != -2){
-		result = "off";
-		if(w->autoindent)
-			result = "on";
-		if(w->body.file->nname)
-			warning(nil, "%.*S: Indent %s\n", w->body.file->nname, w->body.file->name, result);
-		else
-			warning(nil, "Indent %s\n", result);
+	if(w != nil){
+		switch(autoindent){
+		case Ion:
+		case Ioff:
+			w->autoindent = autoindent;
+			break;
+		case IGlobal:
+			w->autoindent = globalautoindent;
+			break;
+		}
 	}
 }
 

+ 2 - 0
sys/src/cmd/acme/wind.c

@@ -74,10 +74,12 @@ wininit(Window *w, Window *clone, Rectangle r)
 	draw(screen, br, button, nil, button->r.min);
 	w->filemenu = TRUE;
 	w->maxlines = w->body.maxlines;
+	w->autoindent = globalautoindent;
 	if(clone){
 		w->dirty = clone->dirty;
 		textsetselect(&w->body, clone->body.q0, clone->body.q1);
 		winsettag(w);
+		w->autoindent = clone->autoindent;
 	}
 }