Browse Source

Plan 9 from Bell Labs 2007-02-24

David du Colombier 13 years ago
parent
commit
bb1d16dbc7

+ 11 - 5
dist/replica/_plan9.db

@@ -1396,9 +1396,10 @@ lib/face/48x48x4/x/xigh.1 - 664 sys sys 1142019024 1204
 lib/face/48x48x4/y - 20000000775 sys sys 1020895714 0
 lib/face/48x48x4/z - 20000000775 sys sys 1020895714 0
 lib/face/48x48x8 - 20000000775 sys sys 1123100641 0
-lib/face/48x48x8/.dict - 664 sys sys 1169491532 2868
+lib/face/48x48x8/.dict - 664 sys sys 1172265593 2972
 lib/face/48x48x8/Z - 20000000775 sys sys 1020895714 0
 lib/face/48x48x8/a - 20000000775 sys sys 1056983599 0
+lib/face/48x48x8/a/alu.1 - 664 sys sys 1172265619 1719
 lib/face/48x48x8/a/axel.1 - 664 sys sys 1056983599 473
 lib/face/48x48x8/b - 20000000775 sys sys 1059679697 0
 lib/face/48x48x8/b/boyd.1 - 664 sys sys 1059679697 1897
@@ -1413,6 +1414,7 @@ lib/face/48x48x8/d/dlewis.1 - 664 sys sys 1118196820 2364
 lib/face/48x48x8/e - 20000000775 sys sys 1155331573 0
 lib/face/48x48x8/e/ericvh.2 - 664 sys sys 1155331573 1049
 lib/face/48x48x8/f - 20000000775 sys sys 1155331586 0
+lib/face/48x48x8/f/faa.1 - 664 sys sys 1172265611 2013
 lib/face/48x48x8/f/forsyth.1 - 664 sys sys 1056982111 1864
 lib/face/48x48x8/f/fst.1 - 664 sys sys 1157149515 1099
 lib/face/48x48x8/g - 20000000775 sys sys 1140276024 0
@@ -1441,10 +1443,12 @@ lib/face/48x48x8/p/plus.1 - 664 sys sys 1157142255 1049
 lib/face/48x48x8/q - 20000000775 sys sys 1136200674 0
 lib/face/48x48x8/q/quanstro.1 - 664 sys sys 1136131296 2250
 lib/face/48x48x8/r - 20000000775 sys sys 1123100691 0
+lib/face/48x48x8/r/rit.1 - 664 sys sys 1172264510 1128
 lib/face/48x48x8/r/rog.1 - 664 sys sys 1057005153 1621
 lib/face/48x48x8/s - 20000000775 sys sys 1118196836 0
 lib/face/48x48x8/s/scottschwartz.1 - 664 sys sys 1056981529 1837
 lib/face/48x48x8/s/sdavis.1 - 664 sys sys 1118196836 2364
+lib/face/48x48x8/s/st.1 - 664 sys sys 1172265601 629
 lib/face/48x48x8/s/stevesimon.1 - 664 sys sys 1056982262 1598
 lib/face/48x48x8/t - 20000000775 sys sys 1078950263 0
 lib/face/48x48x8/t/tiit.1 - 664 sys sys 1078950263 2061
@@ -7983,10 +7987,10 @@ sys/src/9/pc/ether589.c - 664 sys sys 1015014516 4644
 sys/src/9/pc/ether79c970.c - 664 sys sys 1160070602 14088
 sys/src/9/pc/ether8003.c - 664 sys sys 1015014516 6665
 sys/src/9/pc/ether8139.c - 664 sys sys 1160066369 18561
-sys/src/9/pc/ether8169.c - 664 sys sys 1168305932 25430
+sys/src/9/pc/ether8169.c - 664 sys sys 1172259757 25466
 sys/src/9/pc/ether82543gc.c - 664 sys sys 1131290377 32294
 sys/src/9/pc/ether82557.c - 664 sys sys 1153082663 30197
-sys/src/9/pc/ether83815.c - 664 sys sys 1140271743 26125
+sys/src/9/pc/ether83815.c - 664 sys sys 1172259521 26346
 sys/src/9/pc/ether8390.c - 664 sys sys 1131290377 17702
 sys/src/9/pc/ether8390.h - 664 sys sys 1015014517 1511
 sys/src/9/pc/etherdp83820.c - 664 sys sys 1160069116 29352
@@ -12265,7 +12269,7 @@ sys/src/cmd/gzip/zip.h - 664 sys sys 954778719 1428
 sys/src/cmd/hget.c - 664 sys sys 1161442159 25962
 sys/src/cmd/history.c - 664 sys sys 1136378274 6098
 sys/src/cmd/hoc - 20000000775 sys sys 1039727559 0
-sys/src/cmd/hoc/code.c - 664 sys sys 1132451870 10050
+sys/src/cmd/hoc/code.c - 664 sys sys 1172257358 10061
 sys/src/cmd/hoc/hoc.h - 664 sys sys 944960999 2358
 sys/src/cmd/hoc/hoc.y - 664 sys sys 1155364037 9666
 sys/src/cmd/hoc/init.c - 664 sys sys 944960999 1441
@@ -13033,7 +13037,7 @@ sys/src/cmd/postscript/trofftable/trofftable.ps - 664 sys sys 944961073 3678
 sys/src/cmd/postscript/trofftable/trofftable.rc - 664 sys sys 984789206 2637
 sys/src/cmd/postscript/trofftable/trofftable.sh - 664 sys sys 984789206 2613
 sys/src/cmd/pr.c - 664 sys sys 1168307016 11172
-sys/src/cmd/primes.c - 664 sys sys 1135081181 2123
+sys/src/cmd/primes.c - 664 sys sys 1172257895 2471
 sys/src/cmd/prof.c - 664 sys sys 1124305301 5547
 sys/src/cmd/proof - 20000000775 sys sys 1039727677 0
 sys/src/cmd/proof/font.c - 664 sys sys 944961621 8525
@@ -15681,3 +15685,5 @@ 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/hoc - 775 sys sys 1172289653 100101
+386/bin/primes - 775 sys sys 1172289653 63329

+ 11 - 7
dist/replica/plan9.db

@@ -274,7 +274,7 @@
 386/bin/hayes - 775 sys sys 1168402314 64793
 386/bin/hget - 775 sys sys 1169612024 233943
 386/bin/history - 775 sys sys 1168402314 75705
-386/bin/hoc - 775 sys sys 1168402314 100096
+386/bin/hoc - 775 sys sys 1172289653 100101
 386/bin/html2ms - 775 sys sys 1168402315 66321
 386/bin/htmlfmt - 775 sys sys 1168402315 163476
 386/bin/htmlroff - 775 sys sys 1168402315 148450
@@ -370,7 +370,7 @@
 386/bin/png - 775 sys sys 1168402344 164582
 386/bin/ppm - 775 sys sys 1168402345 149765
 386/bin/pr - 775 sys sys 1168402345 77717
-386/bin/primes - 775 sys sys 1148500685 38820
+386/bin/primes - 775 sys sys 1172289653 63329
 386/bin/prof - 775 sys sys 1172203055 110892
 386/bin/proof - 775 sys sys 1132506869 178756
 386/bin/ps - 775 sys sys 1168402346 68812
@@ -1396,9 +1396,10 @@ lib/face/48x48x4/x/xigh.1 - 664 sys sys 1142019024 1204
 lib/face/48x48x4/y - 20000000775 sys sys 1020895714 0
 lib/face/48x48x4/z - 20000000775 sys sys 1020895714 0
 lib/face/48x48x8 - 20000000775 sys sys 1123100641 0
-lib/face/48x48x8/.dict - 664 sys sys 1169491532 2868
+lib/face/48x48x8/.dict - 664 sys sys 1172265593 2972
 lib/face/48x48x8/Z - 20000000775 sys sys 1020895714 0
 lib/face/48x48x8/a - 20000000775 sys sys 1056983599 0
+lib/face/48x48x8/a/alu.1 - 664 sys sys 1172265619 1719
 lib/face/48x48x8/a/axel.1 - 664 sys sys 1056983599 473
 lib/face/48x48x8/b - 20000000775 sys sys 1059679697 0
 lib/face/48x48x8/b/boyd.1 - 664 sys sys 1059679697 1897
@@ -1413,6 +1414,7 @@ lib/face/48x48x8/d/dlewis.1 - 664 sys sys 1118196820 2364
 lib/face/48x48x8/e - 20000000775 sys sys 1155331573 0
 lib/face/48x48x8/e/ericvh.2 - 664 sys sys 1155331573 1049
 lib/face/48x48x8/f - 20000000775 sys sys 1155331586 0
+lib/face/48x48x8/f/faa.1 - 664 sys sys 1172265611 2013
 lib/face/48x48x8/f/forsyth.1 - 664 sys sys 1056982111 1864
 lib/face/48x48x8/f/fst.1 - 664 sys sys 1157149515 1099
 lib/face/48x48x8/g - 20000000775 sys sys 1140276024 0
@@ -1441,10 +1443,12 @@ lib/face/48x48x8/p/plus.1 - 664 sys sys 1157142255 1049
 lib/face/48x48x8/q - 20000000775 sys sys 1136200674 0
 lib/face/48x48x8/q/quanstro.1 - 664 sys sys 1136131296 2250
 lib/face/48x48x8/r - 20000000775 sys sys 1123100691 0
+lib/face/48x48x8/r/rit.1 - 664 sys sys 1172264510 1128
 lib/face/48x48x8/r/rog.1 - 664 sys sys 1057005153 1621
 lib/face/48x48x8/s - 20000000775 sys sys 1118196836 0
 lib/face/48x48x8/s/scottschwartz.1 - 664 sys sys 1056981529 1837
 lib/face/48x48x8/s/sdavis.1 - 664 sys sys 1118196836 2364
+lib/face/48x48x8/s/st.1 - 664 sys sys 1172265601 629
 lib/face/48x48x8/s/stevesimon.1 - 664 sys sys 1056982262 1598
 lib/face/48x48x8/t - 20000000775 sys sys 1078950263 0
 lib/face/48x48x8/t/tiit.1 - 664 sys sys 1078950263 2061
@@ -7983,10 +7987,10 @@ sys/src/9/pc/ether589.c - 664 sys sys 1015014516 4644
 sys/src/9/pc/ether79c970.c - 664 sys sys 1160070602 14088
 sys/src/9/pc/ether8003.c - 664 sys sys 1015014516 6665
 sys/src/9/pc/ether8139.c - 664 sys sys 1160066369 18561
-sys/src/9/pc/ether8169.c - 664 sys sys 1168305932 25430
+sys/src/9/pc/ether8169.c - 664 sys sys 1172259757 25466
 sys/src/9/pc/ether82543gc.c - 664 sys sys 1131290377 32294
 sys/src/9/pc/ether82557.c - 664 sys sys 1153082663 30197
-sys/src/9/pc/ether83815.c - 664 sys sys 1140271743 26125
+sys/src/9/pc/ether83815.c - 664 sys sys 1172259521 26346
 sys/src/9/pc/ether8390.c - 664 sys sys 1131290377 17702
 sys/src/9/pc/ether8390.h - 664 sys sys 1015014517 1511
 sys/src/9/pc/etherdp83820.c - 664 sys sys 1160069116 29352
@@ -12265,7 +12269,7 @@ sys/src/cmd/gzip/zip.h - 664 sys sys 954778719 1428
 sys/src/cmd/hget.c - 664 sys sys 1161442159 25962
 sys/src/cmd/history.c - 664 sys sys 1136378274 6098
 sys/src/cmd/hoc - 20000000775 sys sys 1039727559 0
-sys/src/cmd/hoc/code.c - 664 sys sys 1132451870 10050
+sys/src/cmd/hoc/code.c - 664 sys sys 1172257358 10061
 sys/src/cmd/hoc/hoc.h - 664 sys sys 944960999 2358
 sys/src/cmd/hoc/hoc.y - 664 sys sys 1155364037 9666
 sys/src/cmd/hoc/init.c - 664 sys sys 944960999 1441
@@ -13033,7 +13037,7 @@ sys/src/cmd/postscript/trofftable/trofftable.ps - 664 sys sys 944961073 3678
 sys/src/cmd/postscript/trofftable/trofftable.rc - 664 sys sys 984789206 2637
 sys/src/cmd/postscript/trofftable/trofftable.sh - 664 sys sys 984789206 2613
 sys/src/cmd/pr.c - 664 sys sys 1168307016 11172
-sys/src/cmd/primes.c - 664 sys sys 1135081181 2123
+sys/src/cmd/primes.c - 664 sys sys 1172257895 2471
 sys/src/cmd/prof.c - 664 sys sys 1124305301 5547
 sys/src/cmd/proof - 20000000775 sys sys 1039727677 0
 sys/src/cmd/proof/font.c - 664 sys sys 944961621 8525

+ 11 - 0
dist/replica/plan9.log

@@ -47550,3 +47550,14 @@
 1172203206 9 c 386/bin/aux/ms2 - 775 sys sys 1172203053 87397
 1172203206 10 c 386/bin/tprof - 775 sys sys 1172203056 297762
 1172203206 11 c 386/lib/libmach.a - 664 sys sys 1172203058 785440
+1172259006 0 c sys/src/cmd/hoc/code.c - 664 sys sys 1172257358 10061
+1172259006 1 c sys/src/cmd/primes.c - 664 sys sys 1172257895 2471
+1172260806 0 c sys/src/9/pc/ether83815.c - 664 sys sys 1172259521 26346
+1172260806 1 c sys/src/9/pc/ether8169.c - 664 sys sys 1172259757 25466
+1172264511 0 a lib/face/48x48x8/r/rit.1 - 664 sys sys 1172264510 1128
+1172266206 0 c lib/face/48x48x8/.dict - 664 sys sys 1172265593 2972
+1172266206 1 a lib/face/48x48x8/a/alu.1 - 664 sys sys 1172265619 1719
+1172266206 2 a lib/face/48x48x8/f/faa.1 - 664 sys sys 1172265611 2013
+1172266206 3 a lib/face/48x48x8/s/st.1 - 664 sys sys 1172265601 629
+1172291406 0 c 386/bin/hoc - 775 sys sys 1172289653 100101
+1172291406 1 c 386/bin/primes - 775 sys sys 1172289653 63329

+ 4 - 0
lib/face/48x48x8/.dict

@@ -5,6 +5,7 @@
 acsnet/boyd b/boyd.1
 alcatel-lucent.com/plus p/plus.1
 alcatel-lucent.com/unknown a/alu.1
+alcatel-lucent.fr/unknown a/alu.1
 alchar.org/aedil k/kris.1
 aprote.ee/t.lankots t/tiit.1
 ar/unknown u/unknown.ar
@@ -32,6 +33,7 @@ de/unknown u/unknown.de
 dk/unknown u/unknown.dk
 ee/unknown u/unknown.ee
 es/unknown u/unknown.es
+faa.gov/unknown f/faa.1
 fi/unknown u/unknown.fi
 flowerbed.dyndns.org/zfolkerts z/zfolkerts.1
 fr/unknown u/unknown.fr
@@ -75,6 +77,7 @@ proxima.alt.za/lucio l/lucio.1
 pt/unknown u/unknown.pt
 quanstro.net/quanstro q/quanstro.1
 quintile.net/steve s/stevesimon.1
+rit.edu/unknown r/rit.1
 ru/unknown u/unknown.ru
 sdgm.net/boyd b/boyd.1
 se/unknown u/unknown.se
@@ -85,6 +88,7 @@ snellwilcox.com/steve.simon s/stevesimon.1
 solnetworks.net/dlewis d/dlewis.1
 southern.edu/zfolkerts z/zfolkerts.1
 speakeasy.net/quanstro q/quanstro.1
+st.com/unknown s/st.1
 starcenter.tn.org/sdavis s/sdavis.1
 strakt.com/boyd b/boyd.1
 su/unknown u/unknown.su

BIN
lib/face/48x48x8/a/alu.1


BIN
lib/face/48x48x8/f/faa.1


BIN
lib/face/48x48x8/r/rit.1


BIN
lib/face/48x48x8/s/st.1


+ 7 - 5
sys/src/9/pc/ether8169.c

@@ -796,15 +796,17 @@ rtl8169link(Ether* edev)
 	 * Maybe the link changed - do we care very much?
 	 * Could stall transmits if no link, maybe?
 	 */
-	if(!((r = csr8r(ctlr, Phystatus)) & Linksts))
+	if(!((r = csr8r(ctlr, Phystatus)) & Linksts)){
+		edev->link = 0;
 		return;
+	}
+	edev->link = 1;
 
 	limit = 256*1024;
 	if(r & Speed10){
 		edev->mbps = 10;
 		limit = 65*1024;
-	}
-	else if(r & Speed100)
+	} else if(r & Speed100)
 		edev->mbps = 100;
 	else if(r & Speed1000)
 		edev->mbps = 1000;
@@ -887,7 +889,7 @@ rtl8169receive(Ether* edev)
 	rdh = ctlr->rdh;
 	for(;;){
 		d = &ctlr->rd[rdh];
-	
+
 		if(d->control & Own)
 			break;
 
@@ -1031,7 +1033,7 @@ rtl8169pci(void)
 
 		if(pcigetpms(p) > 0){
 			pcisetpms(p, 0);
-	
+
 			for(i = 0; i < 6; i++)
 				pcicfgw32(p, PciBAR0+i*4, p->mem[i].bar);
 			pcicfgw8(p, PciINTL, p->intl);

+ 18 - 10
sys/src/9/pc/ether83815.c

@@ -469,9 +469,9 @@ txrxcfg(Ctlr *ctlr, int txdrth)
 static void
 interrupt(Ureg*, void* arg)
 {
+	int len, status, cmdsts, n;
 	Ctlr *ctlr;
 	Ether *ether;
-	int len, status, cmdsts;
 	Des *des;
 	Block *bp;
 
@@ -496,6 +496,15 @@ interrupt(Ureg*, void* arg)
 			status &= ~(Hiberr|Txrcmp|Rxrcmp|Rxsovr|Dperr|Sserr|Rmabt|Rtabt);
 		}
 
+		/* update link state */
+		if(status&Phy){
+			status &= ~Phy;
+			csr32r(ctlr, Rcfg);
+			n = csr32r(ctlr, Rcfg);
+//			iprint("83815 phy %x %x\n", n, n&Lnksts);
+			ether->link = (n&Lnksts) != 0;
+		}
+
 		/*
 		 * Received packets.
 		 */
@@ -656,8 +665,10 @@ ctlrinit(Ether* ether)
 
 	txrxcfg(ctlr, Drth512);
 
-	csr32w(ctlr, Rimr, Dperr|Sserr|Rmabt|Rtabt|Rxsovr|Hiberr|Txurn|Txerr|Txdesc|Txok|Rxorn|Rxerr|Rxdesc|Rxok);	/* Phy|Pme|Mib */
-	csr32r(ctlr, Risr);	/* clear status */
+	csr32w(ctlr, Rimr, Dperr|Sserr|Rmabt|Rtabt|Rxsovr|Hiberr|Txurn|Txerr|
+		Txdesc|Txok|Rxorn|Rxerr|Rxdesc|Rxok);	/* Phy|Pme|Mib */
+	csr32w(ctlr, Rmicr, Inten);	/* enable phy interrupts */
+	csr32r(ctlr, Risr);		/* clear status */
 	csr32w(ctlr, Rier, Ie);
 }
 
@@ -783,7 +794,7 @@ softreset(Ctlr* ctlr, int resetphys)
 	if(csr16r(ctlr, Ranar) == 0 || (csr32r(ctlr, Rcfg) & Aneg_dn) == 0){
 		csr16w(ctlr, Rbmcr, Anena|Anrestart);
 		for(i=0;; i++){
-			if(i > 6000){
+			if(i > 3000){
 				print("ns83815: auto neg timed out\n");
 				break;
 			}
@@ -812,11 +823,8 @@ media(Ether* ether)
 	ctlr = ether->ctlr;
 	cfg = csr32r(ctlr, Rcfg);
 	ctlr->fd = (cfg & Fdup) != 0;
-	if(cfg & Speed100)
-		return 100;
-	if((cfg & Lnksts) == 0)
-		return 100;	/* no link: use 100 to ensure larger queues */
-	return 10;
+	ether->link = (cfg&Lnksts) != 0;
+	return (cfg&(Lnksts|Speed100)) == Lnksts? 10: 100;
 }
 
 static char* mediatable[9] = {
@@ -950,7 +958,7 @@ scanpci83815(void)
 
 	p = nil;
 	while(p = pcimatch(p, 0, 0)){
-		if(p->ccrb != 0x02 || p->ccru != 0)
+		if(p->ccrb != Pcibcnet || p->ccru != 0)
 			continue;
 		id = (p->did<<16)|p->vid;
 		switch(id){

+ 1 - 1
sys/src/cmd/hoc/code.c

@@ -612,7 +612,7 @@ varread(void)	/* read into variable */
   Again:
 	do
 		c = Bgetc(bin);
-	while(c==' ' || c=='\t');
+	while(c==' ' || c=='\t' || c=='\n');
 	if(c == Beof){
   Iseof:
 		if(moreinput())

+ 71 - 37
sys/src/cmd/primes.c

@@ -1,14 +1,10 @@
-#include	<u.h>
-#include	<libc.h>
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
 
-#define	ptsiz	(sizeof(pt)/sizeof(pt[0]))
-#define	whsiz	(sizeof(wheel)/sizeof(wheel[0]))
-#define	tabsiz	(sizeof(table)/sizeof(table[0]))
-#define	tsiz8	(tabsiz*8)
+double big = 9.007199254740992e15;
 
-double	big = 9.007199254740992e15;
-
-int	pt[] =
+int pt[] =
 {
 	  2,  3,  5,  7, 11, 13, 17, 19, 23, 29,
 	 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
@@ -16,7 +12,7 @@ int	pt[] =
 	127,131,137,139,149,151,157,163,167,173,
 	179,181,191,193,197,199,211,223,227,229,
 };
-double	wheel[] =
+double wheel[] =
 {
 	10, 2, 4, 2, 4, 6, 2, 6, 4, 2,
 	 4, 6, 6, 2, 6, 4, 2, 6, 4, 6,
@@ -24,34 +20,79 @@ double	wheel[] =
 	 2, 4, 6, 2, 6, 6, 4, 2, 4, 6,
 	 2, 6, 4, 2, 4, 2,10, 2,
 };
-uchar	table[1000];
-uchar	bittab[] =
+uchar table[1000];
+uchar bittab[] =
 {
 	1, 2, 4, 8, 16, 32, 64, 128,
 };
 
+enum {
+	ptsiz	= nelem(pt),
+	whsiz	= nelem(wheel),
+	tabsiz	= nelem(table),
+	tsiz8	= tabsiz*8,
+};
+
 void	mark(double nn, long k);
-void	ouch(void);
 
 void
-main(int argc, char *argp[])
+usage(void)
+{
+	fprint(2, "usage: %s [start [finish]]\n", argv0);
+	exits("limits");
+}
+
+void
+ouch(void)
+{
+	fprint(2, "limits exceeded\n");
+	exits("limits");
+}
+
+void
+main(int argc, char *argv[])
 {
 	int i;
 	double k, temp, v, limit, nn;
+	char *l;
+	Biobuf bin;
 
-	if(argc <= 1) {
-		fprint(2, "usage: primes start [finish]\n");
-		exits("usage");
-	}
-	nn = atof(argp[1]);
+	ARGBEGIN{
+	default:
+		usage();
+		break;
+	}ARGEND;
+
+	nn = 0;
 	limit = big;
-	if(argc > 2) {
-		limit = atof(argp[2]);
+	switch (argc) {
+	case 0:
+		Binit(&bin, 0, OREAD);
+		while ((l = Brdline(&bin, '\n')) != nil) {
+			if (*l == '\n')
+				continue;
+			nn = atof(l);
+			if(nn < 0)
+				sysfatal("negative start");
+			break;
+		}
+		Bterm(&bin);
+		break;
+	case 2:
+		limit = atof(argv[1]);
 		if(limit < nn)
 			exits(0);
 		if(limit > big)
 			ouch();
+		/* fallthrough */
+	case 1:
+		nn = atof(argv[0]);
+		break;
+	default:
+		usage();
+		break;
 	}
+
 	if(nn < 0 || nn > big)
 		ouch();
 	if(nn == 0)
@@ -64,19 +105,19 @@ main(int argc, char *argp[])
 			if(pt[i] > limit)
 				exits(0);
 			print("%d\n", pt[i]);
-			if(limit >= big)
-				exits(0);
+//			if(limit >= big)
+//				exits(0);
 		}
 		nn = 230;
 	}
 
 	modf(nn/2, &temp);
-	nn = 2.*temp + 1;
+	nn = 2*temp + 1;
 /*
  *	clear the sieve table.
  */
 	for(;;) {
-		for(i=0; i<tabsiz; i++)
+		for(i = 0; i < tabsiz; i++)
 			table[i] = 0;
 /*
  *	run the sieve.
@@ -85,7 +126,7 @@ main(int argc, char *argp[])
 		mark(nn, 3);
 		mark(nn, 5);
 		mark(nn, 7);
-		for(i=0,k=11; k<=v; k+=wheel[i]) {
+		for(i = 0, k = 11; k <= v; k += wheel[i]) {
 			mark(nn, k);
 			i++;
 			if(i >= whsiz)
@@ -95,15 +136,15 @@ main(int argc, char *argp[])
  *	now get the primes from the table
  *	and print them.
  */
-		for(i=0; i<tsiz8; i+=2) {
+		for(i = 0; i < tsiz8; i += 2) {
 			if(table[i>>3] & bittab[i&07])
 				continue;
 			temp = nn + i;
 			if(temp > limit)
 				exits(0);
 			print("%.0f\n", temp);
-			if(limit >= big)
-				exits(0);
+//			if(limit >= big)
+//				exits(0);
 		}
 		nn += tsiz8;
 	}
@@ -119,13 +160,6 @@ mark(double nn, long k)
 	j = k*t1 - nn;
 	if(j < 0)
 		j += k;
-	for(; j<tsiz8; j+=k)
+	for(; j < tsiz8; j += k)
 		table[j>>3] |= bittab[j&07];
 }
-
-void
-ouch(void)
-{
-	fprint(2, "limits exceeded\n");
-	exits("limits");
-}