Browse Source

Plan 9 from Bell Labs 2006-09-16

David du Colombier 17 years ago
parent
commit
bdcca0eee0
7 changed files with 95 additions and 16 deletions
  1. 4 4
      dist/replica/_plan9.db
  2. 4 4
      dist/replica/plan9.db
  3. 4 0
      dist/replica/plan9.log
  4. 51 3
      sys/man/1/2c
  5. 8 1
      sys/man/6/ndb
  6. 1 1
      sys/src/cmd/fossil/dat.h
  7. 23 3
      sys/src/cmd/fossil/disk.c

+ 4 - 4
dist/replica/_plan9.db

@@ -7254,7 +7254,7 @@ sys/man - 20000000775 sys sys 1012278794 0
 sys/man/1 - 20000000775 sys sys 1018897631 0
 sys/man/1/0intro - 664 sys sys 1101668050 9625
 sys/man/1/2a - 664 sys sys 1158281866 1196
-sys/man/1/2c - 664 sys sys 1143293856 8288
+sys/man/1/2c - 664 sys sys 1158355567 9168
 sys/man/1/2l - 664 sys sys 1158281887 4376
 sys/man/1/INDEX - 664 sys sys 1141357442 3040
 sys/man/1/INDEX.html - 664 sys sys 1141352366 16517
@@ -7672,7 +7672,7 @@ sys/man/6/mnihongo - 664 sys sys 1158064572 716
 sys/man/6/mpictures - 664 sys sys 944959678 2899
 sys/man/6/ms - 664 sys sys 958249504 6815
 sys/man/6/namespace - 664 sys sys 1048637182 1576
-sys/man/6/ndb - 664 sys sys 1128707622 6431
+sys/man/6/ndb - 664 sys sys 1158358889 6579
 sys/man/6/plot - 664 sys sys 944959679 6739
 sys/man/6/plumb - 664 sys sys 969499892 10918
 sys/man/6/regexp - 664 sys sys 954089523 2050
@@ -10178,9 +10178,9 @@ sys/src/cmd/fossil/bwatch.c - 664 sys sys 1042005505 6754
 sys/src/cmd/fossil/cache.c - 664 sys sys 1143759345 43875
 sys/src/cmd/fossil/check.c - 664 sys sys 1091904423 17315
 sys/src/cmd/fossil/conf.rc - 775 sys sys 1084333190 1416
-sys/src/cmd/fossil/dat.h - 664 sys sys 1135487938 7582
+sys/src/cmd/fossil/dat.h - 664 sys sys 1158373945 7622
 sys/src/cmd/fossil/deadlock - 775 sys sys 1042005506 413
-sys/src/cmd/fossil/disk.c - 664 sys sys 1135487937 6426
+sys/src/cmd/fossil/disk.c - 664 sys sys 1158373945 6887
 sys/src/cmd/fossil/dump.c - 664 sys sys 1042005506 1340
 sys/src/cmd/fossil/epoch.c - 664 sys sys 1045600021 997
 sys/src/cmd/fossil/error.c - 664 sys sys 1073851927 1450

+ 4 - 4
dist/replica/plan9.db

@@ -7254,7 +7254,7 @@ sys/man - 20000000775 sys sys 1012278794 0
 sys/man/1 - 20000000775 sys sys 1018897631 0
 sys/man/1/0intro - 664 sys sys 1101668050 9625
 sys/man/1/2a - 664 sys sys 1158281866 1196
-sys/man/1/2c - 664 sys sys 1143293856 8288
+sys/man/1/2c - 664 sys sys 1158355567 9168
 sys/man/1/2l - 664 sys sys 1158281887 4376
 sys/man/1/INDEX - 664 sys sys 1141357442 3040
 sys/man/1/INDEX.html - 664 sys sys 1141352366 16517
@@ -7672,7 +7672,7 @@ sys/man/6/mnihongo - 664 sys sys 1158064572 716
 sys/man/6/mpictures - 664 sys sys 944959678 2899
 sys/man/6/ms - 664 sys sys 958249504 6815
 sys/man/6/namespace - 664 sys sys 1048637182 1576
-sys/man/6/ndb - 664 sys sys 1128707622 6431
+sys/man/6/ndb - 664 sys sys 1158358889 6579
 sys/man/6/plot - 664 sys sys 944959679 6739
 sys/man/6/plumb - 664 sys sys 969499892 10918
 sys/man/6/regexp - 664 sys sys 954089523 2050
@@ -10178,9 +10178,9 @@ sys/src/cmd/fossil/bwatch.c - 664 sys sys 1042005505 6754
 sys/src/cmd/fossil/cache.c - 664 sys sys 1143759345 43875
 sys/src/cmd/fossil/check.c - 664 sys sys 1091904423 17315
 sys/src/cmd/fossil/conf.rc - 775 sys sys 1084333190 1416
-sys/src/cmd/fossil/dat.h - 664 sys sys 1135487938 7582
+sys/src/cmd/fossil/dat.h - 664 sys sys 1158373945 7622
 sys/src/cmd/fossil/deadlock - 775 sys sys 1042005506 413
-sys/src/cmd/fossil/disk.c - 664 sys sys 1135487937 6426
+sys/src/cmd/fossil/disk.c - 664 sys sys 1158373945 6887
 sys/src/cmd/fossil/dump.c - 664 sys sys 1042005506 1340
 sys/src/cmd/fossil/epoch.c - 664 sys sys 1045600021 997
 sys/src/cmd/fossil/error.c - 664 sys sys 1073851927 1450

+ 4 - 0
dist/replica/plan9.log

@@ -30447,3 +30447,7 @@
 1158262206 0 c 386/bin/join - 775 sys sys 1158261630 114476
 1158282007 0 c sys/man/1/2a - 664 sys sys 1158281866 1196
 1158282007 1 c sys/man/1/2l - 664 sys sys 1158281887 4376
+1158355807 0 c sys/man/1/2c - 664 sys sys 1158355567 9168
+1158359406 0 c sys/man/6/ndb - 664 sys sys 1158358889 6579
+1158375607 0 c sys/src/cmd/fossil/dat.h - 664 sys sys 1158373945 7622
+1158375607 1 c sys/src/cmd/fossil/disk.c - 664 sys sys 1158373945 6887

+ 51 - 3
sys/man/1/2c

@@ -1,6 +1,6 @@
 .TH 2C 1 
 .SH NAME
-0c, 1c, 2c, 5c, 7c, 8c, kc, qc, vc \- C compilers
+0c, 1c, 2c, 5c, 6c, 7c, 8c, kc, qc, vc \- C compilers
 .SH SYNOPSIS
 .B 2c
 [
@@ -15,6 +15,11 @@ etc.
 These commands compile the named C
 .I files
 into object files for the corresponding architecture.
+If there are multiple C
+.IR files ,
+the compilers will attempt to keep
+.B $NPROC
+compilations running concurrently.
 Associated with each compiler is a string
 .IR objtype ,
 for example
@@ -31,6 +36,9 @@ Motorola MC68020
 .B "5c arm
 ARM 7500
 .TP
+.B "6c amd64
+AMD64 and compatibles (e.g., Intel EM64T)
+.TP
 .B "7c alpha
 Digital Alpha APX
 .TP
@@ -41,7 +49,7 @@ Intel i386, i486, Pentium, etc.
 Sun SPARC
 .TP
 .B "qc power
-Power PC,
+Power PC
 .TP
 .B "vc mips
 big-endian MIPS 3000 family
@@ -53,9 +61,11 @@ which must be run separately.
 .PP
 Let the first letter of the compiler name be
 .IR O =
+.BR 0 ,
 .BR 1 ,
 .BR 2 ,
 .BR 5 ,
+.BR 6 ,
 .BR 7 ,
 .BR 8 ,
 .BR k ,
@@ -192,6 +202,17 @@ Like
 .B -a
 except suppress information about structures
 declared in included header files.
+.TP
+.B -n
+When used with
+.B -a
+or
+.BR -aa ,
+places acid functions in
+.IB file .acid
+for input
+.IB file .c ,
+and not on standard output.
 .PP
 The compilers support several extensions to ANSI C:
 .TP
@@ -361,7 +382,16 @@ The standard header typedefs this to
 .BR vlong .
 Arithmetic on
 .B  vlong
-values is usually emulated by a run-time library.
+values is usually emulated by a run-time library,
+though in at least
+.IR 8c ,
+only division and modulus use the run-time library
+and the other operators generate in-line code
+(and
+.I uvlong-expression
+.I divison-or-modulus
+.BI "(1<<" constant )
+will turn into in-line bit operations).
 .SH EXAMPLE
 For the 68020, produce a program
 .B prog
@@ -403,6 +433,7 @@ machine-dependent part
 .IR pcc (1),
 .IR db (1),
 .IR acid (1),
+.IR ansitize (1)
 .PP
 Rob Pike,
 ``How to Use the Plan 9 C Compiler''
@@ -428,3 +459,20 @@ option.
 The default search order for include files
 differs to that of
 .IR cpp (1).
+.PP
+Some features of C99, the 1999 ANSI C standard,
+are implemented.
+.PP
+.B switch
+expressions may not be either flavor of
+.B vlong
+.RI ( 8c
+at least).
+.PP
+The implementation of
+.B vlong
+assignment can use a static location
+and this can be disturbed by interrupts
+(e.g., notes)
+.RI ( 8c
+at least).

+ 8 - 1
sys/man/6/ndb

@@ -168,7 +168,14 @@ Internet address
 .TP
 .B ether
 Ethernet address
-(must be lower-case hexadecimal)
+(must be lower-case hexadecimal).
+Beware that for machines with multiple
+.B ether
+attributes,
+.I dhcpd
+may expect requests to come from the address in the first
+.B ether
+attribute.
 .TP
 .B bootf
 file to download for initial bootstrap

+ 1 - 1
sys/src/cmd/fossil/dat.h

@@ -303,7 +303,7 @@ struct Fsck
 	int nclri;
 };
 
-/* disk partitions */
+/* disk partitions; keep in sync with partname[] in disk.c */
 enum {
 	PartError,
 	PartSuper,

+ 23 - 3
sys/src/cmd/fossil/disk.c

@@ -27,6 +27,14 @@ struct Disk {
 	Block *next;		/* blocks to do next scan */
 };
 
+/* keep in sync with Part* enum in dat.h */
+static char *partname[] = {
+	[PartError]	"error",
+	[PartSuper]	"super",
+	[PartLabel]	"label",
+	[PartData]	"data",
+	[PartVenti]	"venti",
+};
 
 Disk *
 diskAlloc(int fd)
@@ -276,6 +284,16 @@ mypc(int x)
 	return getcallerpc(&x);
 }
 
+static char *
+disk2file(Disk *disk)
+{
+	static char buf[256];
+
+	if (fd2path(disk->fd, buf, sizeof buf) < 0)
+		strncpy(buf, "GOK", sizeof buf);
+	return buf;
+}
+
 static void
 diskThread(void *a)
 {
@@ -322,7 +340,7 @@ diskThread(void *a)
 		 * reading or writing state, so this lock should
 		 * not cause deadlock.
 		 */
-if(0)fprint(2, "diskThread: %d:%d %x\n", getpid(), b->part, b->addr);
+if(0)fprint(2, "fossil: diskThread: %d:%d %x\n", getpid(), b->part, b->addr);
 		bwatchLock(b);
 		vtLock(b->lk);
 		b->pc = mypc(0);
@@ -332,7 +350,8 @@ if(0)fprint(2, "diskThread: %d:%d %x\n", getpid(), b->part, b->addr);
 			abort();
 		case BioReading:
 			if(!diskReadRaw(disk, b->part, b->addr, b->data)){
-fprint(2, "diskReadRaw failed: part=%d addr=%ux: %r\n", b->part, b->addr);
+fprint(2, "fossil: diskReadRaw failed: %s: score %V: part=%s addr=%ud: %r\n",
+disk2file(disk), b->score, partname[b->part], b->addr);
 				blockSetIOState(b, BioReadError);
 			}else
 				blockSetIOState(b, BioClean);
@@ -340,7 +359,8 @@ fprint(2, "diskReadRaw failed: part=%d addr=%ux: %r\n", b->part, b->addr);
 		case BioWriting:
 			p = blockRollback(b, buf);
 			if(!diskWriteRaw(disk, b->part, b->addr, p)){
-fprint(2, "diskWriteRaw failed: date=%s part=%d addr=%ux: %r\n", ctime(times(0)), b->part, b->addr);
+fprint(2, "fossil: diskWriteRaw failed: %s: %V: date=%s part=%s addr=%ud: %r\n",
+disk2file(disk), b->score, ctime(times(0)), partname[b->part], b->addr);
 				break;
 			}
 			if(p != buf)