Browse Source

Plan 9 from Bell Labs 2003-06-23

David du Colombier 17 years ago
parent
commit
d76d3492ca

+ 9 - 9
dist/replica/plan9.db

@@ -5091,7 +5091,7 @@ sys/src/9/mtx/main.c - 664 sys sys 1018721287 8344
 sys/src/9/mtx/mem.h - 664 sys sys 1026848200 5959
 sys/src/9/mtx/mkfile - 664 sys sys 1055825923 1508
 sys/src/9/mtx/mmu.c - 664 sys sys 1018721287 4388
-sys/src/9/mtx/mtx - 664 sys sys 1039753441 413
+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 1018721287 16662
 sys/src/9/mtx/random.c - 664 sys sys 1036813598 1983
@@ -5145,7 +5145,7 @@ sys/src/9/pc/ethersink.c - 664 sys sys 1048644103 1076
 sys/src/9/pc/ethersmc.c - 664 sys sys 1015014518 15079
 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 1026847643 4216
+sys/src/9/pc/fns.h - 664 sys sys 1056299506 4215
 sys/src/9/pc/hcwAMC.h - 664 sys sys 1026860163 166004
 sys/src/9/pc/i8253.c - 664 sys sys 1055689890 6219
 sys/src/9/pc/i8259.c - 664 sys sys 1015014519 4423
@@ -5157,7 +5157,7 @@ sys/src/9/pc/l.s - 664 sys sys 1055700610 20868
 sys/src/9/pc/main.c - 664 sys sys 1055700611 14507
 sys/src/9/pc/mem.h - 664 sys sys 1018553448 4573
 sys/src/9/pc/memory.c - 664 sys sys 1032303986 12994
-sys/src/9/pc/mkfile - 664 sys sys 1055825916 3100
+sys/src/9/pc/mkfile - 664 sys sys 1056336303 3092
 sys/src/9/pc/mmu.c - 664 sys sys 1049509456 10014
 sys/src/9/pc/mouse.c - 664 sys sys 1020369766 6315
 sys/src/9/pc/mp.c - 664 sys sys 1048644112 16928
@@ -5186,8 +5186,8 @@ sys/src/9/pc/sd53c8xx.n - 664 sys sys 1032059019 12455
 sys/src/9/pc/sdata.c - 664 sys sys 1055087706 49704
 sys/src/9/pc/sdmylex.c - 664 sys sys 1015014523 27750
 sys/src/9/pc/sdscsi.c - 664 sys sys 1055689892 7406
-sys/src/9/pc/trap.c - 664 sys sys 1047261661 18991
-sys/src/9/pc/uarti8250.c - 664 sys sys 1020369766 12671
+sys/src/9/pc/trap.c - 664 sys sys 1056299507 19012
+sys/src/9/pc/uarti8250.c - 664 sys sys 1056299508 12605
 sys/src/9/pc/uartpci.c - 664 sys sys 1015014524 2709
 sys/src/9/pc/usb.h - 664 sys sys 1015014524 3505
 sys/src/9/pc/usbuhci.c - 664 sys sys 1026847653 30686
@@ -5215,7 +5215,7 @@ sys/src/9/pc/vgatvp3020.c - 664 sys sys 1015014528 4491
 sys/src/9/pc/vgatvp3026.c - 664 sys sys 1015014528 3940
 sys/src/9/pc/vgavmware.c - 664 sys sys 1020284822 6334
 sys/src/9/pc/vgax.c - 664 sys sys 1015014528 1655
-sys/src/9/pc/wavelan.c - 664 sys sys 1055689894 27253
+sys/src/9/pc/wavelan.c - 664 sys sys 1056299581 27253
 sys/src/9/pc/wavelan.h - 664 sys sys 1055700615 6151
 sys/src/9/port - 20000000775 sys sys 1018469625 0
 sys/src/9/port/alarm.c - 664 sys sys 1026847545 1733
@@ -9300,7 +9300,7 @@ sys/src/cmd/mk/mk.h - 664 sys sys 1055698812 3735
 sys/src/cmd/mk/mkconv - 775 sys sys 944961025 555
 sys/src/cmd/mk/mkfile - 664 sys sys 1055698812 376
 sys/src/cmd/mk/parse.c - 664 sys sys 944961025 5310
-sys/src/cmd/mk/plan9.c - 664 sys sys 1055698813 6818
+sys/src/cmd/mk/plan9.c - 664 sys sys 1056337347 6921
 sys/src/cmd/mk/rc.c - 664 sys sys 944961025 3206
 sys/src/cmd/mk/recipe.c - 664 sys sys 1014926074 2551
 sys/src/cmd/mk/rule.c - 664 sys sys 944961025 1970
@@ -10829,7 +10829,7 @@ sys/src/lib9p/tpost.c - 664 sys sys 1044429939 324
 sys/src/lib9p/uid.c - 664 sys sys 1015023311 517
 sys/src/lib9p/util.c - 664 sys sys 1017679319 465
 sys/src/libString - 20000000775 sys sys 984754301 0
-sys/src/libString/mkfile - 664 sys sys 1035389776 415
+sys/src/libString/mkfile - 664 sys sys 1056299302 432
 sys/src/libString/s_alloc.c - 664 sys sys 1014930579 1277
 sys/src/libString/s_append.c - 664 sys sys 984754296 270
 sys/src/libString/s_array.c - 664 sys sys 985037746 319
@@ -11064,7 +11064,7 @@ sys/src/libc/9sys/syslog.c - 664 sys sys 1014927339 1951
 sys/src/libc/9sys/sysname.c - 664 sys sys 944961713 238
 sys/src/libc/9sys/time.c - 664 sys sys 1014927340 871
 sys/src/libc/9sys/times.c - 664 sys sys 944961712 995
-sys/src/libc/9sys/tm2sec.c - 664 sys sys 1045502952 3192
+sys/src/libc/9sys/tm2sec.c - 664 sys sys 1056331608 3059
 sys/src/libc/9sys/truerand.c - 664 sys sys 1014927340 306
 sys/src/libc/9sys/wait.c - 664 sys sys 1014927340 565
 sys/src/libc/9sys/waitpid.c - 664 sys sys 1014927340 313

+ 9 - 0
dist/replica/plan9.log

@@ -12345,3 +12345,12 @@
 1056171697 2 c sys/src/cmd/ndb/cs.c - 664 sys sys 1056171180 32752
 1056171697 3 c sys/src/cmd/ndb/dnstcp.c - 664 sys sys 1056171180 7066
 1056214978 0 d sys/src/cmd/mk/xyz - 775 sys sys 1055698814 0
+1056299553 0 c sys/src/9/pc/fns.h - 664 sys sys 1056299506 4215
+1056299553 1 c sys/src/9/pc/trap.c - 664 sys sys 1056299507 19012
+1056299553 2 c sys/src/9/pc/uarti8250.c - 664 sys sys 1056299508 12605
+1056299553 3 c sys/src/9/pc/wavelan.c - 664 sys sys 1056299581 27253
+1056299553 4 c sys/src/libString/mkfile - 664 sys sys 1056299302 432
+1056331863 0 c sys/src/libc/9sys/tm2sec.c - 664 sys sys 1056331608 3059
+1056337267 0 c sys/src/9/mtx/mtx - 664 sys sys 1056336297 416
+1056337267 1 c sys/src/9/pc/mkfile - 664 sys sys 1056336303 3092
+1056339068 0 c sys/src/cmd/mk/plan9.c - 664 sys sys 1056337347 6921

+ 3 - 2
sys/src/9/mtx/mtx

@@ -42,5 +42,6 @@ boot
 
 bootdir
 	bootmtx.out boot
-	ipconfig.hack ipconfig
-	factotum.hack factotum
+	/power/bin/ip/ipconfig
+	/power/bin/auth/factotum
+

+ 1 - 1
sys/src/9/pc/fns.h

@@ -58,7 +58,7 @@ ushort	ins(int);
 void	inss(int, void*, int);
 ulong	inl(int);
 void	insl(int, void*, int);
-void	intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
+int	intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
 void	intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
 void	iofree(int);
 void	ioinit(void);

+ 1 - 1
sys/src/9/pc/mkfile

@@ -1,5 +1,5 @@
 CONF=pc
-CONFLIST=pc pccpu pcdisk pcauth pcblast
+CONFLIST=pc pccpu pcdisk pcauth
 
 objtype=386
 </$objtype/mkfile

+ 4 - 2
sys/src/9/pc/trap.c

@@ -64,7 +64,7 @@ intrenable(int irq, void (*f)(Ureg*, void*), void* a, int tbdf, char *name)
 	iunlock(&vctllock);
 }
 
-void
+int
 intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
 {
 	Vctl **pv, *v;
@@ -76,7 +76,7 @@ intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
 	 * is pretty meaningless.
 	 */
 	if(arch->intrvecno == nil)
-		return;
+		return -1;
 	vno = arch->intrvecno(irq);
 	ilock(&vctllock);
 	pv = &vctl[vno];
@@ -93,6 +93,7 @@ intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
 		arch->intrdisable(irq);
 	iunlock(&vctllock);
 	xfree(v);
+	return 0;
 }
 
 static long
@@ -456,6 +457,7 @@ _dumpstack(Ureg *ureg)
 	ulong l, v, i, estack;
 	extern ulong etext;
 
+return;
 	print("ktrace /kernel/path %.8lux %.8lux\n", ureg->pc, ureg->sp);
 	i = 0;
 	if(up

+ 2 - 6
sys/src/9/pc/uarti8250.c

@@ -445,7 +445,6 @@ i8250interrupt(Ureg*, void* arg)
 	Ctlr *ctlr;
 	Uart *uart;
 	int iir, lsr, old, r;
-int nin;
 
 	uart = arg;
 
@@ -487,7 +486,6 @@ int nin;
 			 * overrun is an indication that something has
 			 * already been tossed.
 			 */
-nin = 0;
 			while((lsr = csr8r(ctlr, Lsr)) & Dr){
 				if(lsr & Oe)
 					uart->oerr++;
@@ -498,9 +496,7 @@ nin = 0;
 				r = csr8r(ctlr, Rbr);
 				if(!(lsr & (Bi|Fe|Pe)))
 					uartrecv(uart, r);
-				nin++;
 			}
-if(nin == 0) print("%ux but no data\n", iir);
 			break;
 
 		default:
@@ -527,8 +523,8 @@ i8250disable(Uart* uart)
 	csr8w(ctlr, Ier, ctlr->sticky[Ier]);
 
 	if(ctlr->iena != 0){
-		intrdisable(ctlr->irq, i8250interrupt, uart, ctlr->tbdf, uart->name);
-		ctlr->iena = 0;
+		if(intrdisable(ctlr->irq, i8250interrupt, uart, ctlr->tbdf, uart->name) == 0)
+			ctlr->iena = 0;
 	}
 }
 

+ 1 - 1
sys/src/9/pc/wavelan.c

@@ -1005,7 +1005,7 @@ w_option(Ctlr* ctlr, char* buf, long n)
 			ctlr->ptype = WPTypeWDS;
 		else if(cistrcmp(cb->f[1], "adhoc") == 0)
 			ctlr->ptype = WPTypeAdHoc;
-		else if((i = atoi(cb->f[1])) >= 1 && i <= 3)
+		else if((i = atoi(cb->f[1])) >= 0 && i <= 3)
 			ctlr->ptype = i;
 		else
 			r = -1;

+ 10 - 3
sys/src/cmd/mk/plan9.c

@@ -372,9 +372,10 @@ void
 bulkmtime(char *dir)
 {
 	char buf[4096];
-	char *ss, *s;
+	char *ss, *s, *sym;
 
 	if(dir){
+		sym = dir;
 		s = dir;
 		if(strcmp(dir, "/") == 0)
 			strcpy(buf, dir);
@@ -382,11 +383,12 @@ bulkmtime(char *dir)
 			sprint(buf, "%s/", dir);
 	}else{
 		s = ".";
+		sym = "";
 		buf[0] = 0;
 	}
-	if(symlook(s, S_BULKED, 0))
+	if(symlook(sym, S_BULKED, 0))
 		return;
-	ss = strdup(s);
+	ss = strdup(sym);
 	symlook(ss, S_BULKED, (void*)ss);
 	dirtime(s, buf);
 }
@@ -398,6 +400,11 @@ mkmtime(char *name, int force)
 	char *s, *ss, carry;
 	ulong t;
 	Symtab *sym;
+	char buf[4096];
+
+	strcpy(buf, name);
+	cleanname(buf);
+	name = buf;
 
 	s = utfrrune(name, '/');
 	if(s == name)

+ 3 - 2
sys/src/libString/mkfile

@@ -12,12 +12,13 @@ OFILES=\
 	s_memappend.$O\
 	s_nappend.$O\
 	s_parse.$O\
+	s_putc.$O\
+	s_rdinstack.$O\
 	s_read.$O\
 	s_read_line.$O\
 	s_reset.$O\
-	s_tolower.$O\
-	s_putc.$O\
 	s_terminate.$O\
+	s_tolower.$O\
 	s_unique.$O\
 
 HFILES=/sys/include/String.h

+ 10 - 16
sys/src/libc/9sys/tm2sec.c

@@ -51,7 +51,7 @@ long
 tm2sec(Tm *tm)
 {
 	long secs;
-	int i, year, *d2m;
+	int i, yday, year, *d2m;
 
 	if(strcmp(tm->zone, "GMT") != 0 && timezone.stname[0] == 0)
 		readtimezone();
@@ -67,24 +67,18 @@ tm2sec(Tm *tm)
 	}
 
 	/*
-	 *  use the day of the year or, if that
-	 *  isn't set, calculate it from the month
-	 *  and day of the month.
+	 *  if mday is set, use mon and mday to compute yday
 	 */
-	if (tm->yday != 0)
-		secs += (tm->yday - 1) * SEC2DAY;
-	else {
-		/*
-		 *  seconds per month
-		 */
+	if(tm->mday){
+		yday = 0;
 		d2m = yrsize(year);
-		for(i = 0; i < tm->mon; i++)
-			secs += d2m[i+1] * SEC2DAY;
-		/*
-		 * secs in last month
-		 */
-		secs += (tm->mday-1) * SEC2DAY;
+		for(i=0; i<tm->mon; i++)
+			yday += d2m[i+1];
+		yday += tm->mday-1;
+	}else{
+		yday = tm->yday;
 	}
+	secs += yday * SEC2DAY;
 
 	/*
 	 * hours, minutes, seconds