Browse Source

Plan 9 from Bell Labs 2008-06-03

David du Colombier 12 years ago
parent
commit
4af35e1323

+ 27 - 44
dist/replica/_plan9.db

@@ -24,16 +24,16 @@
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1173754547 134719
 386/bin/ape/cc - 775 sys sys 1168402263 70642
-386/bin/ape/diff - 775 sys sys 1184529896 352356
-386/bin/ape/diff3 - 775 sys sys 1184529897 190456
+386/bin/ape/diff - 775 sys sys 1212377290 352888
+386/bin/ape/diff3 - 775 sys sys 1212377294 190748
 386/bin/ape/dirname - 775 sys sys 1173754549 134498
 386/bin/ape/expr - 775 sys sys 1173754549 144138
-386/bin/ape/kill - 775 sys sys 1184529897 140159
+386/bin/ape/kill - 775 sys sys 1212377297 140453
 386/bin/ape/make - 775 sys sys 1173754550 211605
-386/bin/ape/patch - 775 sys sys 1184529898 305940
+386/bin/ape/patch - 775 sys sys 1212377302 306636
 386/bin/ape/psh - 775 sys sys 1042220689 34
 386/bin/ape/sed - 775 sys sys 1173754551 160183
-386/bin/ape/sh - 775 sys sys 1184529899 481824
+386/bin/ape/sh - 775 sys sys 1212377310 482209
 386/bin/ape/stty - 775 sys sys 1148500571 41080
 386/bin/ape/tar - 775 sys sys 1168402264 62184
 386/bin/ape/uname - 775 sys sys 1173754552 134895
@@ -111,10 +111,10 @@
 386/bin/aux/hardcopy - 775 sys sys 1020319063 1699
 386/bin/aux/isvmware - 775 sys sys 1032486791 23997
 386/bin/aux/lines - 775 sys sys 1209614153 60657
-386/bin/aux/listen - 775 sys sys 1209614155 107731
+386/bin/aux/listen - 775 sys sys 1212377312 108405
 386/bin/aux/listen1 - 775 sys sys 1209614157 94801
-386/bin/aux/lpdaemon - 775 sys sys 1212291179 170620
-386/bin/aux/lpdsend - 775 sys sys 1173754553 157339
+386/bin/aux/lpdaemon - 775 sys sys 1212377314 170862
+386/bin/aux/lpdsend - 775 sys sys 1212377318 157412
 386/bin/aux/lpsend - 775 sys sys 1178568255 51124
 386/bin/aux/mapd - 775 sys sys 1210392535 191190
 386/bin/aux/mkflashfs - 775 sys sys 1210392539 67520
@@ -189,7 +189,7 @@
 386/bin/col - 775 sys sys 1209614219 63498
 386/bin/colors - 775 sys sys 1210392633 151189
 386/bin/comm - 775 sys sys 1209614221 61527
-386/bin/compress - 775 sys sys 1184529900 167036
+386/bin/compress - 775 sys sys 1212377321 167330
 386/bin/con - 775 sys sys 1203482824 78416
 386/bin/cp - 775 sys sys 1168402297 63454
 386/bin/cpp - 775 sys sys 1210392637 149307
@@ -229,7 +229,7 @@
 386/bin/echo - 775 sys sys 1168402304 57592
 386/bin/ecp - 775 sys sys 1179777651 72588
 386/bin/ed - 775 sys sys 1209614267 93474
-386/bin/eqn - 775 sys sys 1210476122 244950
+386/bin/eqn - 775 sys sys 1212377326 245242
 386/bin/execnet - 775 sys sys 1210392671 176948
 386/bin/exportfs - 775 sys sys 1210392675 162218
 386/bin/ext2srv - 775 sys sys 1210392679 178650
@@ -265,17 +265,17 @@
 386/bin/games/jukefs - 775 sys sys 1196742485 164538
 386/bin/games/mahjongg - 775 sys sys 1210392721 165427
 386/bin/games/memo - 775 sys sys 1210392726 156830
-386/bin/games/mp3dec - 775 sys sys 1198183090 388585
+386/bin/games/mp3dec - 775 sys sys 1212377334 389058
 386/bin/games/mp3enc - 775 sys sys 1196220182 530357
 386/bin/games/playlistfs - 775 sys sys 1210648934 149337
 386/bin/games/sokoban - 775 sys sys 1210563675 165646
 386/bin/games/sudoku - 775 sys sys 1210392735 171200
 386/bin/getmap - 775 sys sys 1168402311 65423
 386/bin/gif - 775 sys sys 1210476130 158695
-386/bin/grap - 775 sys sys 1193771861 282792
+386/bin/grap - 775 sys sys 1212377340 283153
 386/bin/graph - 775 sys sys 1210392743 129377
 386/bin/grep - 775 sys sys 1209614327 79510
-386/bin/gs - 775 sys sys 1188447224 13278980
+386/bin/gs - 775 sys sys 1212377587 13279308
 386/bin/gunzip - 775 sys sys 1210392746 80464
 386/bin/gview - 775 sys sys 1210392751 240948
 386/bin/gzip - 775 sys sys 1210392754 83529
@@ -372,7 +372,7 @@
 386/bin/passwd - 775 sys sys 1192762788 85264
 386/bin/pbd - 775 sys sys 1085077087 4661
 386/bin/pcc - 775 sys sys 1168402344 68241
-386/bin/pic - 775 sys sys 1184529905 308725
+386/bin/pic - 775 sys sys 1212377594 309019
 386/bin/pipefile - 775 sys sys 1148500683 39431
 386/bin/plot - 775 sys sys 1210392886 222948
 386/bin/plumb - 775 sys sys 1176520491 69487
@@ -449,7 +449,7 @@
 386/bin/tprof - 775 sys sys 1209614681 300993
 386/bin/tr - 775 sys sys 1168402355 62088
 386/bin/trace - 775 sys sys 1210392999 180686
-386/bin/troff - 775 sys sys 1210476137 361158
+386/bin/troff - 775 sys sys 1212377603 361398
 386/bin/troff2html - 775 sys sys 1209614684 84535
 386/bin/tweak - 775 sys sys 1210393003 193489
 386/bin/unicode - 775 sys sys 1209614690 62688
@@ -554,15 +554,15 @@
 386/lib - 20000000775 sys sys 1016826328 0
 386/lib/ape - 20000000775 sys sys 1070519112 0
 386/lib/ape/lib9.a - 664 sys sys 1205611022 8766
-386/lib/ape/libap.a - 664 sys sys 1210393239 820230
-386/lib/ape/libbsd.a - 664 sys sys 1210393243 183900
-386/lib/ape/libdraw.a - 664 sys sys 1210393257 631580
-386/lib/ape/libfmt.a - 664 sys sys 1146156980 156706
-386/lib/ape/libl.a - 664 sys sys 1143777857 9406
-386/lib/ape/libnet.a - 664 sys sys 1203828448 24090
-386/lib/ape/libregexp.a - 664 sys sys 1143777857 47500
-386/lib/ape/libutf.a - 664 sys sys 1146156980 88500
-386/lib/ape/libv.a - 664 sys sys 1202357672 19334
+386/lib/ape/libap.a - 664 sys sys 1212377617 822090
+386/lib/ape/libbsd.a - 664 sys sys 1212377620 183900
+386/lib/ape/libdraw.a - 664 sys sys 1212377632 631580
+386/lib/ape/libfmt.a - 664 sys sys 1212377636 156706
+386/lib/ape/libl.a - 664 sys sys 1212377636 9406
+386/lib/ape/libnet.a - 664 sys sys 1212377637 24090
+386/lib/ape/libregexp.a - 664 sys sys 1212377638 47500
+386/lib/ape/libutf.a - 664 sys sys 1212377640 88500
+386/lib/ape/libv.a - 664 sys sys 1212377641 19334
 386/lib/lib9p.a - 664 sys sys 1209184390 91992
 386/lib/libString.a - 664 sys sys 1209184391 22466
 386/lib/libauth.a - 664 sys sys 1209184392 59742
@@ -8145,7 +8145,7 @@ sys/src/9/pc/ethermii.h - 664 sys sys 1086873891 3258
 sys/src/9/pc/ethersink.c - 664 sys sys 1048644103 1076
 sys/src/9/pc/ethersmc.c - 664 sys sys 1162951986 15116
 sys/src/9/pc/ethervgbe.c - 664 sys sys 1160066496 26838
-sys/src/9/pc/ethervt6102.c - 664 sys sys 1201296945 22600
+sys/src/9/pc/ethervt6102.c - 664 sys sys 1212432407 23073
 sys/src/9/pc/etherwavelan.c - 664 sys sys 1131290380 3747
 sys/src/9/pc/floppy.h - 664 sys sys 1055700609 3835
 sys/src/9/pc/fns.h - 664 sys sys 1190268439 4738
@@ -9221,7 +9221,7 @@ sys/src/boot/pc/etherif.h - 664 sys sys 1174077279 1338
 sys/src/boot/pc/etherigbe.c - 664 sys sys 1201822335 41718
 sys/src/boot/pc/ethermii.c - 664 sys sys 1103641771 4413
 sys/src/boot/pc/ethermii.h - 664 sys sys 1071175087 3259
-sys/src/boot/pc/etherrhine.c - 664 sys sys 1199911576 12759
+sys/src/boot/pc/etherrhine.c - 664 sys sys 1212432164 13178
 sys/src/boot/pc/fns.h - 664 sys sys 1193171343 4880
 sys/src/boot/pc/fs.c - 664 sys sys 1094674483 1509
 sys/src/boot/pc/fs.h - 664 sys sys 1094674488 653
@@ -9498,7 +9498,7 @@ sys/src/cmd/acme/disk.c - 664 sys sys 1014926093 2151
 sys/src/cmd/acme/ecmd.c - 664 sys sys 1199391526 24298
 sys/src/cmd/acme/edit.c - 664 sys sys 1124993578 12019
 sys/src/cmd/acme/edit.h - 664 sys sys 1124993577 2369
-sys/src/cmd/acme/elog.c - 664 sys sys 1111607796 7294
+sys/src/cmd/acme/elog.c - 664 sys sys 1212432645 7429
 sys/src/cmd/acme/exec.c - 664 sys sys 1181880498 28938
 sys/src/cmd/acme/file.c - 664 sys sys 1044626079 5717
 sys/src/cmd/acme/fns.h - 664 sys sys 1107154481 2916
@@ -15894,20 +15894,3 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 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/eqn - 775 sys sys 1212377326 245242
-386/bin/games/mp3dec - 775 sys sys 1212377334 389058
-386/bin/grap - 775 sys sys 1212377340 283153
-386/bin/gs - 775 sys sys 1212377531 10248192
-386/bin/ape/diff - 775 sys sys 1212377290 352888
-386/bin/ape/diff3 - 775 sys sys 1212377294 190748
-386/bin/ape/kill - 775 sys sys 1212377297 140453
-386/bin/ape/patch - 775 sys sys 1212377302 306636
-386/bin/ape/sh - 775 sys sys 1212377310 482209
-386/bin/aux/listen - 775 sys sys 1212377312 108405
-386/bin/aux/lpdaemon - 775 sys sys 1212377314 170862
-386/bin/aux/lpdsend - 775 sys sys 1212377318 157412
-386/bin/compress - 775 sys sys 1212377321 167330
-386/bin/troff - 775 sys sys 1212377603 361398
-386/lib/ape/libap.a - 664 sys sys 1212377617 822090
-386/lib/ape/libbsd.a - 664 sys sys 1212377620 183900
-386/lib/ape/libdraw.a - 664 sys sys 1212377621 49152

+ 12 - 12
dist/replica/plan9.db

@@ -275,7 +275,7 @@
 386/bin/grap - 775 sys sys 1212377340 283153
 386/bin/graph - 775 sys sys 1210392743 129377
 386/bin/grep - 775 sys sys 1209614327 79510
-386/bin/gs - 775 sys sys 1212377531 10248192
+386/bin/gs - 775 sys sys 1212377587 13279308
 386/bin/gunzip - 775 sys sys 1210392746 80464
 386/bin/gview - 775 sys sys 1210392751 240948
 386/bin/gzip - 775 sys sys 1210392754 83529
@@ -372,7 +372,7 @@
 386/bin/passwd - 775 sys sys 1192762788 85264
 386/bin/pbd - 775 sys sys 1085077087 4661
 386/bin/pcc - 775 sys sys 1168402344 68241
-386/bin/pic - 775 sys sys 1184529905 308725
+386/bin/pic - 775 sys sys 1212377594 309019
 386/bin/pipefile - 775 sys sys 1148500683 39431
 386/bin/plot - 775 sys sys 1210392886 222948
 386/bin/plumb - 775 sys sys 1176520491 69487
@@ -556,13 +556,13 @@
 386/lib/ape/lib9.a - 664 sys sys 1205611022 8766
 386/lib/ape/libap.a - 664 sys sys 1212377617 822090
 386/lib/ape/libbsd.a - 664 sys sys 1212377620 183900
-386/lib/ape/libdraw.a - 664 sys sys 1212377621 49152
-386/lib/ape/libfmt.a - 664 sys sys 1146156980 156706
-386/lib/ape/libl.a - 664 sys sys 1143777857 9406
-386/lib/ape/libnet.a - 664 sys sys 1203828448 24090
-386/lib/ape/libregexp.a - 664 sys sys 1143777857 47500
-386/lib/ape/libutf.a - 664 sys sys 1146156980 88500
-386/lib/ape/libv.a - 664 sys sys 1202357672 19334
+386/lib/ape/libdraw.a - 664 sys sys 1212377632 631580
+386/lib/ape/libfmt.a - 664 sys sys 1212377636 156706
+386/lib/ape/libl.a - 664 sys sys 1212377636 9406
+386/lib/ape/libnet.a - 664 sys sys 1212377637 24090
+386/lib/ape/libregexp.a - 664 sys sys 1212377638 47500
+386/lib/ape/libutf.a - 664 sys sys 1212377640 88500
+386/lib/ape/libv.a - 664 sys sys 1212377641 19334
 386/lib/lib9p.a - 664 sys sys 1209184390 91992
 386/lib/libString.a - 664 sys sys 1209184391 22466
 386/lib/libauth.a - 664 sys sys 1209184392 59742
@@ -8145,7 +8145,7 @@ sys/src/9/pc/ethermii.h - 664 sys sys 1086873891 3258
 sys/src/9/pc/ethersink.c - 664 sys sys 1048644103 1076
 sys/src/9/pc/ethersmc.c - 664 sys sys 1162951986 15116
 sys/src/9/pc/ethervgbe.c - 664 sys sys 1160066496 26838
-sys/src/9/pc/ethervt6102.c - 664 sys sys 1201296945 22600
+sys/src/9/pc/ethervt6102.c - 664 sys sys 1212432407 23073
 sys/src/9/pc/etherwavelan.c - 664 sys sys 1131290380 3747
 sys/src/9/pc/floppy.h - 664 sys sys 1055700609 3835
 sys/src/9/pc/fns.h - 664 sys sys 1190268439 4738
@@ -9221,7 +9221,7 @@ sys/src/boot/pc/etherif.h - 664 sys sys 1174077279 1338
 sys/src/boot/pc/etherigbe.c - 664 sys sys 1201822335 41718
 sys/src/boot/pc/ethermii.c - 664 sys sys 1103641771 4413
 sys/src/boot/pc/ethermii.h - 664 sys sys 1071175087 3259
-sys/src/boot/pc/etherrhine.c - 664 sys sys 1199911576 12759
+sys/src/boot/pc/etherrhine.c - 664 sys sys 1212432164 13178
 sys/src/boot/pc/fns.h - 664 sys sys 1193171343 4880
 sys/src/boot/pc/fs.c - 664 sys sys 1094674483 1509
 sys/src/boot/pc/fs.h - 664 sys sys 1094674488 653
@@ -9498,7 +9498,7 @@ sys/src/cmd/acme/disk.c - 664 sys sys 1014926093 2151
 sys/src/cmd/acme/ecmd.c - 664 sys sys 1199391526 24298
 sys/src/cmd/acme/edit.c - 664 sys sys 1124993578 12019
 sys/src/cmd/acme/edit.h - 664 sys sys 1124993577 2369
-sys/src/cmd/acme/elog.c - 664 sys sys 1111607796 7294
+sys/src/cmd/acme/elog.c - 664 sys sys 1212432645 7429
 sys/src/cmd/acme/exec.c - 664 sys sys 1181880498 28938
 sys/src/cmd/acme/file.c - 664 sys sys 1044626079 5717
 sys/src/cmd/acme/fns.h - 664 sys sys 1107154481 2916

+ 12 - 0
dist/replica/plan9.log

@@ -19814,3 +19814,15 @@
 1212377410 14 c 386/lib/ape/libap.a - 664 sys sys 1212377617 822090
 1212377410 15 c 386/lib/ape/libbsd.a - 664 sys sys 1212377620 183900
 1212377410 16 c 386/lib/ape/libdraw.a - 664 sys sys 1212377621 49152
+1212379204 0 c 386/bin/gs - 775 sys sys 1212377587 13279308
+1212379204 1 c 386/bin/pic - 775 sys sys 1212377594 309019
+1212379204 2 c 386/lib/ape/libdraw.a - 664 sys sys 1212377632 631580
+1212379204 3 c 386/lib/ape/libfmt.a - 664 sys sys 1212377636 156706
+1212379204 4 c 386/lib/ape/libl.a - 664 sys sys 1212377636 9406
+1212379204 5 c 386/lib/ape/libnet.a - 664 sys sys 1212377637 24090
+1212379204 6 c 386/lib/ape/libregexp.a - 664 sys sys 1212377638 47500
+1212379204 7 c 386/lib/ape/libutf.a - 664 sys sys 1212377640 88500
+1212379204 8 c 386/lib/ape/libv.a - 664 sys sys 1212377641 19334
+1212433204 0 c sys/src/9/pc/ethervt6102.c - 664 sys sys 1212432407 23073
+1212433204 1 c sys/src/boot/pc/etherrhine.c - 664 sys sys 1212432164 13178
+1212433204 2 c sys/src/cmd/acme/elog.c - 664 sys sys 1212432645 7429

+ 22 - 2
sys/src/9/pc/ethervt6102.c

@@ -40,6 +40,10 @@ enum {
 	Miiadr		= 0x71,		/* MII Address */
 	Miidata		= 0x72,		/* MII Data */
 	Eecsr		= 0x74,		/* EEPROM Control and Status */
+	Stickhw		= 0x83,		/* Sticky Hardware Control */
+	Wolcrclr	= 0xA4,
+	Wolcgclr	= 0xA7,
+	Pwrcsrclr	= 0xAC,
 };
 
 enum {					/* Rcr */
@@ -292,7 +296,7 @@ typedef struct Ctlr {
 	uint	rxstats[Nrxstats];	/* statistics */
 	uint	txstats[Ntxstats];
 	uint	intr;
-	uint	lintr;			
+	uint	lintr;
 	uint	lsleep;
 	uint	rintr;
 	uint	tintr;
@@ -837,7 +841,23 @@ vt6102miimiw(Mii* mii, int pa, int ra, int data)
 static int
 vt6102detach(Ctlr* ctlr)
 {
-	int timeo;
+	int revid, timeo;
+
+	/*
+	 * Reset power management registers.
+	 */
+	revid = pcicfgr8(ctlr->pcidev, PciRID);
+	if(revid >= 0x40){
+		/* Set power state D0. */
+		csr8w(ctlr, Stickhw, csr8r(ctlr, Stickhw) & 0xFC);
+
+		/* Disable force PME-enable. */
+		csr8w(ctlr, Wolcgclr, 0x80);
+
+		/* Clear WOL config and status bits. */
+		csr8w(ctlr, Wolcrclr, 0xFF);
+		csr8w(ctlr, Pwrcsrclr, 0xFF);
+	}
 
 	/*
 	 * Soft reset the controller.

+ 21 - 4
sys/src/boot/pc/etherrhine.c

@@ -96,15 +96,16 @@ enum Regs {
 	ConfigB		= 0x79,
 	ConfigD		= 0x7B,
 	MiscCr		= 0x80,
-	HwSticky	= 0x83,
+	Stickhw		= 0x83,		/* Sticky Hardware Control */
 	MiscIsr		= 0x84,
 	MiscImr		= 0x86,
 	WolCrSet	= 0xA0,
 	WolCfgSet	= 0xA1,
 	WolCgSet	= 0xA3,
-	WolCrClr	= 0xA4,
+	Wolcrclr	= 0xA4,
 	PwrCfgClr	= 0xA5,
-	WolCgClr	= 0xA7,
+	Wolcgclr	= 0xA7,
+	Pwrcsrclr	= 0xAC,
 };
 
 enum {					/* Rcr */
@@ -486,7 +487,23 @@ miiwrite(Mii *mii, int phy, int reg, int data)
 static void
 reset(Ctlr* ctlr)
 {
-	int r, timeo;
+	int r, timeo, revid;
+
+	/*
+	 * Reset power management registers.
+	 */
+	revid = pcicfgr8(ctlr->pci, PciRID);
+	if(revid >= 0x40){
+		/* Set power state D0. */
+		csr8w(ctlr, Stickhw, csr8r(ctlr, Stickhw) & 0xFC);
+
+		/* Disable force PME-enable. */
+		csr8w(ctlr, Wolcgclr, 0x80);
+
+		/* Clear WOL config and status bits. */
+		csr8w(ctlr, Wolcrclr, 0xFF);
+		csr8w(ctlr, Pwrcsrclr, 0xFF);
+	}
 
 	/*
 	 * Soft reset the controller.

+ 11 - 0
sys/src/cmd/acme/elog.c

@@ -221,6 +221,7 @@ elogapply(File *f)
 	uint tq0, tq1;
 	Buffer *log;
 	Text *t;
+	int owner;
 
 	elogflush(f);
 	log = f->elogbuf;
@@ -229,6 +230,13 @@ elogapply(File *f)
 	buf = fbufalloc();
 	mod = FALSE;
 
+	owner = 0;
+	if(t->w){
+		owner = t->w->owner;
+		if(owner == 0)
+			t->w->owner = 'E';
+	}
+
 	/*
 	 * The edit commands have already updated the selection in t->q0, t->q1,
 	 * but using coordinates relative to the unmodified buffer.  As we apply the log,
@@ -339,4 +347,7 @@ elogapply(File *f)
 		t->q1 = min(t->q1, f->nc);
 		t->q0 = min(t->q0, t->q1);
 	}
+
+	if(t->w)
+		t->w->owner = owner;
 }