Browse Source

Plan 9 from Bell Labs 2007-03-14

David du Colombier 14 years ago
parent
commit
af25f5dbc3

+ 9 - 9
dist/replica/_plan9.db

@@ -108,7 +108,7 @@
 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 1168402281 60716
-386/bin/aux/listen - 775 sys sys 1173754552 108570
+386/bin/aux/listen - 775 sys sys 1173813638 109045
 386/bin/aux/listen1 - 775 sys sys 1168402281 94721
 386/bin/aux/lpdaemon - 775 sys sys 1173754553 170710
 386/bin/aux/lpdsend - 775 sys sys 1173754553 157339
@@ -6058,7 +6058,7 @@ sys/lib/acid/68020 - 664 sys sys 944955985 2487
 sys/lib/acid/acme - 664 sys sys 969499632 2291
 sys/lib/acid/alef - 664 sys sys 944955985 2293
 sys/lib/acid/alpha - 664 sys sys 944955985 4849
-sys/lib/acid/arm - 664 sys sys 984696197 1842
+sys/lib/acid/arm - 664 sys sys 1173788243 2090
 sys/lib/acid/coverage - 664 sys sys 944955985 1746
 sys/lib/acid/kernel - 664 sys sys 1134390252 6399
 sys/lib/acid/leak - 664 sys sys 1141940182 3022
@@ -7822,7 +7822,7 @@ sys/src/9/alphapc/mem.h - 664 sys sys 1137179967 2312
 sys/src/9/alphapc/memmove.s - 664 sys sys 1015012786 2936
 sys/src/9/alphapc/memset.s - 664 sys sys 1015012786 844
 sys/src/9/alphapc/mkfile - 664 sys sys 1173412020 1973
-sys/src/9/alphapc/mmu.c - 664 sys sys 1173386681 5219
+sys/src/9/alphapc/mmu.c - 664 sys sys 1173788325 5218
 sys/src/9/alphapc/osf1pal.h - 664 sys sys 1137179966 1471
 sys/src/9/alphapc/pci.c - 664 sys sys 1039753420 7868
 sys/src/9/alphapc/screen.h - 664 sys sys 1147108286 3923
@@ -7847,7 +7847,7 @@ sys/src/9/bitsy/etherwavelan.c - 664 sys sys 1071245513 870
 sys/src/9/bitsy/fns.h - 664 sys sys 1171761416 3086
 sys/src/9/bitsy/fpi.c - 664 sys sys 1017695513 5248
 sys/src/9/bitsy/fpi.h - 664 sys sys 1017695513 1679
-sys/src/9/bitsy/fpiarm.c - 664 sys sys 1017695513 9328
+sys/src/9/bitsy/fpiarm.c - 664 sys sys 1173788243 9402
 sys/src/9/bitsy/fpimem.c - 664 sys sys 1017695513 2229
 sys/src/9/bitsy/gamma.c - 664 sys sys 1017695513 646
 sys/src/9/bitsy/gamma.h - 664 sys sys 1017695514 540718
@@ -7950,8 +7950,8 @@ sys/src/9/mtx/kbd.c - 664 sys sys 1018721286 8358
 sys/src/9/mtx/l.s - 664 sys sys 1143129840 11000
 sys/src/9/mtx/main.c - 664 sys sys 1131289814 8307
 sys/src/9/mtx/mem.h - 664 sys sys 1026848200 5959
-sys/src/9/mtx/mkfile - 664 sys sys 1072972534 1520
-sys/src/9/mtx/mmu.c - 664 sys sys 1169491806 4666
+sys/src/9/mtx/mkfile - 664 sys sys 1173788325 1612
+sys/src/9/mtx/mmu.c - 664 sys sys 1173788325 4695
 sys/src/9/mtx/mtx - 664 sys sys 1056336297 416
 sys/src/9/mtx/mtxcpu - 664 sys sys 1039753442 421
 sys/src/9/mtx/pci.c - 664 sys sys 1087657434 16662
@@ -8159,7 +8159,7 @@ sys/src/9/port/pgrp.c - 664 sys sys 1138458260 4760
 sys/src/9/port/portclock.c - 664 sys sys 1146746630 4276
 sys/src/9/port/portdat.h - 664 sys sys 1155995676 22703
 sys/src/9/port/portfns.h - 664 sys sys 1146746630 11059
-sys/src/9/port/portmkfile - 664 sys sys 1173368230 1387
+sys/src/9/port/portmkfile - 664 sys sys 1173788325 2069
 sys/src/9/port/print.c - 664 sys sys 1014931178 227
 sys/src/9/port/proc.c - 664 sys sys 1166244036 28770
 sys/src/9/port/qio.c - 664 sys sys 1070287837 23562
@@ -9681,7 +9681,7 @@ sys/src/cmd/aux/gps/mkfile - 664 sys sys 1108397331 219
 sys/src/cmd/aux/gps/util.c - 664 sys sys 1107448815 2795
 sys/src/cmd/aux/lines.c - 664 sys sys 1015008782 546
 sys/src/cmd/aux/lis - 775 sys sys 944960794 45
-sys/src/cmd/aux/listen.c - 664 sys sys 1173736994 8997
+sys/src/cmd/aux/listen.c - 664 sys sys 1173762441 9291
 sys/src/cmd/aux/listen1.c - 664 sys sys 1143759349 2005
 sys/src/cmd/aux/mkfile - 664 sys sys 1147022848 1021
 sys/src/cmd/aux/mklatinkbd.c - 664 sys sys 953253425 3813
@@ -15259,7 +15259,7 @@ sys/src/libmach/2db.c - 664 sys sys 1143696097 61333
 sys/src/libmach/2obj.c - 664 sys sys 1148106911 2393
 sys/src/libmach/5.c - 664 sys sys 1173387335 1564
 sys/src/libmach/5db.c - 664 sys sys 1143696172 21599
-sys/src/libmach/5obj.c - 664 sys sys 1148106911 2267
+sys/src/libmach/5obj.c - 664 sys sys 1173788325 2268
 sys/src/libmach/6.c - 664 sys sys 1138471019 3482
 sys/src/libmach/6c - 20000000775 sys sys 1123100867 0
 sys/src/libmach/6c/6.out.h - 664 sys sys 1114459480 7984

+ 9 - 9
dist/replica/plan9.db

@@ -108,7 +108,7 @@
 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 1168402281 60716
-386/bin/aux/listen - 775 sys sys 1173754552 108570
+386/bin/aux/listen - 775 sys sys 1173813638 109045
 386/bin/aux/listen1 - 775 sys sys 1168402281 94721
 386/bin/aux/lpdaemon - 775 sys sys 1173754553 170710
 386/bin/aux/lpdsend - 775 sys sys 1173754553 157339
@@ -6058,7 +6058,7 @@ sys/lib/acid/68020 - 664 sys sys 944955985 2487
 sys/lib/acid/acme - 664 sys sys 969499632 2291
 sys/lib/acid/alef - 664 sys sys 944955985 2293
 sys/lib/acid/alpha - 664 sys sys 944955985 4849
-sys/lib/acid/arm - 664 sys sys 984696197 1842
+sys/lib/acid/arm - 664 sys sys 1173788243 2090
 sys/lib/acid/coverage - 664 sys sys 944955985 1746
 sys/lib/acid/kernel - 664 sys sys 1134390252 6399
 sys/lib/acid/leak - 664 sys sys 1141940182 3022
@@ -7822,7 +7822,7 @@ sys/src/9/alphapc/mem.h - 664 sys sys 1137179967 2312
 sys/src/9/alphapc/memmove.s - 664 sys sys 1015012786 2936
 sys/src/9/alphapc/memset.s - 664 sys sys 1015012786 844
 sys/src/9/alphapc/mkfile - 664 sys sys 1173412020 1973
-sys/src/9/alphapc/mmu.c - 664 sys sys 1173386681 5219
+sys/src/9/alphapc/mmu.c - 664 sys sys 1173788325 5218
 sys/src/9/alphapc/osf1pal.h - 664 sys sys 1137179966 1471
 sys/src/9/alphapc/pci.c - 664 sys sys 1039753420 7868
 sys/src/9/alphapc/screen.h - 664 sys sys 1147108286 3923
@@ -7847,7 +7847,7 @@ sys/src/9/bitsy/etherwavelan.c - 664 sys sys 1071245513 870
 sys/src/9/bitsy/fns.h - 664 sys sys 1171761416 3086
 sys/src/9/bitsy/fpi.c - 664 sys sys 1017695513 5248
 sys/src/9/bitsy/fpi.h - 664 sys sys 1017695513 1679
-sys/src/9/bitsy/fpiarm.c - 664 sys sys 1017695513 9328
+sys/src/9/bitsy/fpiarm.c - 664 sys sys 1173788243 9402
 sys/src/9/bitsy/fpimem.c - 664 sys sys 1017695513 2229
 sys/src/9/bitsy/gamma.c - 664 sys sys 1017695513 646
 sys/src/9/bitsy/gamma.h - 664 sys sys 1017695514 540718
@@ -7950,8 +7950,8 @@ sys/src/9/mtx/kbd.c - 664 sys sys 1018721286 8358
 sys/src/9/mtx/l.s - 664 sys sys 1143129840 11000
 sys/src/9/mtx/main.c - 664 sys sys 1131289814 8307
 sys/src/9/mtx/mem.h - 664 sys sys 1026848200 5959
-sys/src/9/mtx/mkfile - 664 sys sys 1072972534 1520
-sys/src/9/mtx/mmu.c - 664 sys sys 1169491806 4666
+sys/src/9/mtx/mkfile - 664 sys sys 1173788325 1612
+sys/src/9/mtx/mmu.c - 664 sys sys 1173788325 4695
 sys/src/9/mtx/mtx - 664 sys sys 1056336297 416
 sys/src/9/mtx/mtxcpu - 664 sys sys 1039753442 421
 sys/src/9/mtx/pci.c - 664 sys sys 1087657434 16662
@@ -8159,7 +8159,7 @@ sys/src/9/port/pgrp.c - 664 sys sys 1138458260 4760
 sys/src/9/port/portclock.c - 664 sys sys 1146746630 4276
 sys/src/9/port/portdat.h - 664 sys sys 1155995676 22703
 sys/src/9/port/portfns.h - 664 sys sys 1146746630 11059
-sys/src/9/port/portmkfile - 664 sys sys 1173368230 1387
+sys/src/9/port/portmkfile - 664 sys sys 1173788325 2069
 sys/src/9/port/print.c - 664 sys sys 1014931178 227
 sys/src/9/port/proc.c - 664 sys sys 1166244036 28770
 sys/src/9/port/qio.c - 664 sys sys 1070287837 23562
@@ -9681,7 +9681,7 @@ sys/src/cmd/aux/gps/mkfile - 664 sys sys 1108397331 219
 sys/src/cmd/aux/gps/util.c - 664 sys sys 1107448815 2795
 sys/src/cmd/aux/lines.c - 664 sys sys 1015008782 546
 sys/src/cmd/aux/lis - 775 sys sys 944960794 45
-sys/src/cmd/aux/listen.c - 664 sys sys 1173736994 8997
+sys/src/cmd/aux/listen.c - 664 sys sys 1173762441 9291
 sys/src/cmd/aux/listen1.c - 664 sys sys 1143759349 2005
 sys/src/cmd/aux/mkfile - 664 sys sys 1147022848 1021
 sys/src/cmd/aux/mklatinkbd.c - 664 sys sys 953253425 3813
@@ -15259,7 +15259,7 @@ sys/src/libmach/2db.c - 664 sys sys 1143696097 61333
 sys/src/libmach/2obj.c - 664 sys sys 1148106911 2393
 sys/src/libmach/5.c - 664 sys sys 1173387335 1564
 sys/src/libmach/5db.c - 664 sys sys 1143696172 21599
-sys/src/libmach/5obj.c - 664 sys sys 1148106911 2267
+sys/src/libmach/5obj.c - 664 sys sys 1173788325 2268
 sys/src/libmach/6.c - 664 sys sys 1138471019 3482
 sys/src/libmach/6c - 20000000775 sys sys 1123100867 0
 sys/src/libmach/6c/6.out.h - 664 sys sys 1114459480 7984

+ 9 - 0
dist/replica/plan9.log

@@ -47872,3 +47872,12 @@
 1173754806 20 c 386/bin/fossil/fossil - 775 sys sys 1173754557 364538
 1173754806 21 c 386/lib/ape/libap.a - 664 sys sys 1173754584 819938
 1173756606 0 c rc/bin/man - 775 sys sys 1173755398 2504
+1173763806 0 c sys/src/cmd/aux/listen.c - 664 sys sys 1173762441 9291
+1173789006 0 c sys/lib/acid/arm - 664 sys sys 1173788243 2090
+1173789006 1 c sys/src/9/alphapc/mmu.c - 664 sys sys 1173788325 5218
+1173789006 2 c sys/src/9/bitsy/fpiarm.c - 664 sys sys 1173788243 9402
+1173789006 3 c sys/src/9/mtx/mkfile - 664 sys sys 1173788325 1612
+1173789006 4 c sys/src/9/mtx/mmu.c - 664 sys sys 1173788325 4695
+1173789006 5 c sys/src/9/port/portmkfile - 664 sys sys 1173788325 2069
+1173789006 6 c sys/src/libmach/5obj.c - 664 sys sys 1173788325 2268
+1173814206 0 c 386/bin/aux/listen - 775 sys sys 1173813638 109045

+ 23 - 11
sys/lib/acid/arm

@@ -1,9 +1,9 @@
-// ARM7500 support
+// ARM support
 
 defn acidinit()			// Called after all the init modules are loaded
 {
 	bplist = {};
-	bpfmt = 'b';
+	bpfmt = 'X';
 
 	srcpath = {
 		"./",
@@ -18,17 +18,17 @@ defn acidinit()			// Called after all the init modules are loaded
 
 defn linkreg(addr)
 {
-	return 0;
+	return *R14;
 }
 
 defn stk()				// trace
 {
-	_stk(*PC, *SP, 0, 0);
+	_stk(*PC, *SP, linkreg(0), 0);
 }
 
 defn lstk()				// trace with locals
 {
-	_stk(*PC, *SP, 0, 1);
+	_stk(*PC, *SP, linkreg(0), 1);
 }
 
 defn gpr()			// print general purpose registers
@@ -48,7 +48,24 @@ defn regs()				// print all registers
 
 defn pstop(pid)
 {
-	return 0;
+	local l;
+	local pc;
+
+	pc = *PC;
+
+	print(pid,": ", reason(*TYPE), "\t");
+	print(fmt(pc, 'a'), "\t", fmt(pc, 'i'), "\n");
+
+	if notes then {
+		if notes[0] != "sys: breakpoint" then {
+			print("Notes pending:\n");
+			l = notes;
+			while l do {
+				print("\t", head l, "\n");
+				l = tail l;
+			}
+		}
+	}
 }
 
 aggr Ureg
@@ -96,9 +113,4 @@ Ureg(addr) {
 	print("	pc	", addr.pc, "\n");
 };
 
-defn acornmap()
-{
-	map({"text", _startup, end, 0x20});
-}
-
 print("/sys/lib/acid/arm");

+ 0 - 1
sys/src/9/alphapc/mmu.c

@@ -297,4 +297,3 @@ cankaddr(ulong pa)
 		return 0;
 	return kzero - pa;
 }
-

+ 6 - 1
sys/src/9/bitsy/fpiarm.c

@@ -185,12 +185,17 @@ static ulong
 fcmp(Internal *n, Internal *m)
 {
 	int i;
+	Internal rm, rn;
 
 	if(IsWeird(m) || IsWeird(n)){
 		/* BUG: should trap if not masked */
 		return V|C;
 	}
-	i = fpicmp(n, m);
+	rn = *n;
+	rm = *m;
+	fpiround(&rn);
+	fpiround(&rm);
+	i = fpicmp(&rn, &rm);
 	if(i > 0)
 		return C;
 	else if(i == 0)

+ 5 - 2
sys/src/9/mtx/mkfile

@@ -79,9 +79,12 @@ install:V: $p$CONF
 <../port/portmkfile
 <|../port/mkbootrules $CONF
 
-clock.$O devether.$O main.$O trap.$O:	/$objtype/include/ureg.h
+clock.$O:	/$objtype/include/ureg.h
+devether.$O:	/$objtype/include/ureg.h
+main.$O:	/$objtype/include/ureg.h errstr.h init.h
+trap.$O:	/$objtype/include/ureg.h
 
-$ETHER: 			etherif.h ../port/netif.h
+$ETHER: 	etherif.h ../port/netif.h
 
 init.h:	initcode /sys/src/libc/9syscall/sys.h
 	$AS initcode

+ 5 - 3
sys/src/9/mtx/mmu.c

@@ -248,8 +248,10 @@ countpagerefs(ulong*, int)
 ulong
 cankaddr(ulong pa)
 {
-	if(pa >= -KZERO)
+	ulong kzero;
+
+	kzero = -KZERO;
+	if(pa >= kzero)
 		return 0;
-	return -KZERO - pa;
+	return kzero - pa;
 }
-

+ 23 - 0
sys/src/9/port/portmkfile

@@ -37,6 +37,8 @@ clean:V:
 %.clean:V:
 	rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* *.acid
 
+%.$O:	/$objtype/include/u.h ../port/lib.h mem.h dat.h fns.h io.h ../port/error.h ../port/portdat.h ../port/portfns.h
+
 ../port/systab.h:	/sys/src/libc/9syscall/sys.h ../port/mksystab
 	rc ../port/mksystab > ../port/systab.h
 
@@ -55,6 +57,27 @@ errstr.h:	../port/mkerrstr ../port/error.h
 %.db:		main.$O
 	$CC -s$stem main.c | dbfmt > $stem.db
 
+alloc.$O:	/sys/include/pool.h
+devmnt.$O:	/sys/include/fcall.h
+proc.$O:	errstr.h
+devroot.$O:	errstr.h
+trap.$O:	/$objtype/include/ureg.h
+devproc.$O:	/$objtype/include/ureg.h
+main.$O:	init.h
+trap.$O:	../port/systab.h
+devpipe.$O:	../port/netif.h
+netif.$O:	../port/netif.h
+devuart.$O:	../port/netif.h
+devmouse.$O:	screen.h
+devdraw.$O:	screen.h
+screen.$O:	screen.h
+latin1.$O:	../port/latin1.h
+thwack.$O:	../port/thwack.h
+unthwack.$O:	../port/thwack.h
+devsdp.$O:	../port/thwack.h
+devproc.$O sysproc.$O:	/sys/include/tos.h
+devproc.$O edf.$O proc.$O: /sys/include/trace.h
+
 boot$CONF.out: $CONF print.$O $BOOTDIR/boot.c $BOOTLIB
 	$BOOTDIR/mkboot $CONF > boot$CONF.c
 	$CC $CFLAGS boot$CONF.c

+ 21 - 6
sys/src/cmd/aux/listen.c

@@ -258,10 +258,24 @@ addannounce(char *fmt, ...)
 	*l = a;
 }
 
+static int
+ignore(char *srvdir, char *name)
+{
+	int rv;
+	char *file = smprint("%s/%s", srvdir, name);
+	Dir *d = dirstat(file);
+
+	rv = !d || d->length <= 0;	/* ignore unless it's non-empty */
+	free(d);
+	free(file);
+	return rv;
+}
+
 void
 scandir(char *proto, char *protodir, char *dname)
 {
 	int fd, i, n, nlen;
+	char *nm;
 	Dir *db;
 
 	fd = open(dname, OREAD);
@@ -271,11 +285,12 @@ scandir(char *proto, char *protodir, char *dname)
 	nlen = strlen(proto);
 	while((n=dirread(fd, &db)) > 0){
 		for(i=0; i<n; i++){
-			if(db[i].qid.type&QTDIR)
+			nm = db[i].name;
+			if(db[i].qid.type&QTDIR ||
+			    strncmp(nm, proto, nlen) != 0 ||
+			    ignore(dname, nm))
 				continue;
-			if(strncmp(db[i].name, proto, nlen) != 0)
-				continue;
-			addannounce("%s!*!%s", protodir, db[i].name+nlen);
+			addannounce("%s!*!%s", protodir, nm+nlen);
 		}
 		free(db);
 	}
@@ -357,7 +372,7 @@ dolisten(char *proto, char *dir, int ctl, char *srvdir, char *dialstr)
  * if the shell script or program is zero-length, ignore it,
  * thus providing a way to disable a service with a bind.
  */
-int 
+int
 findserv(char *proto, char *dir, Service *s, char *srvdir)
 {
 	int rv;
@@ -367,7 +382,7 @@ findserv(char *proto, char *dir, Service *s, char *srvdir)
 		return 0;
 	snprint(s->prog, sizeof s->prog, "%s/%s", srvdir, s->serv);
 	d = dirstat(s->prog);
-	rv = d && d->length > 0;
+	rv = d && d->length > 0;	/* ignore unless it's non-empty */
 	free(d);
 	return rv;
 }

+ 1 - 1
sys/src/libmach/5obj.c

@@ -1,5 +1,5 @@
 /*
- * 5obj.c - identify and parse a arm object file
+ * 5obj.c - identify and parse an arm object file
  */
 #include <u.h>
 #include <libc.h>