Browse Source

Plan 9 from Bell Labs 2007-07-15

David du Colombier 13 years ago
parent
commit
5bea58a5ba

+ 26 - 21
dist/replica/_plan9.db

@@ -538,8 +538,8 @@
 386/lib - 20000000775 sys sys 1016826328 0
 386/lib/ape - 20000000775 sys sys 1070519112 0
 386/lib/ape/lib9.a - 664 sys sys 1135531447 6906
-386/lib/ape/libap.a - 664 sys sys 1183661796 792640
-386/lib/ape/libbsd.a - 664 sys sys 1146156978 183900
+386/lib/ape/libap.a - 664 sys sys 1184467169 792928
+386/lib/ape/libbsd.a - 664 sys sys 1184467169 183900
 386/lib/ape/libdraw.a - 664 sys sys 1179372118 622218
 386/lib/ape/libfmt.a - 664 sys sys 1146156980 156706
 386/lib/ape/libl.a - 664 sys sys 1143777857 9406
@@ -6009,7 +6009,7 @@ sys/include/ape/ctype.h - 664 sys sys 1014927763 1654
 sys/include/ape/cursor.h - 664 sys sys 1146097782 161
 sys/include/ape/dirent.h - 664 sys sys 1035117682 717
 sys/include/ape/draw.h - 664 sys sys 1146097782 16321
-sys/include/ape/errno.h - 664 sys sys 1070327359 1525
+sys/include/ape/errno.h - 664 sys sys 1184449103 1548
 sys/include/ape/error.h - 664 sys sys 944948759 356
 sys/include/ape/event.h - 664 sys sys 1146097783 158
 sys/include/ape/fcntl.h - 664 sys sys 969500385 1231
@@ -6027,7 +6027,7 @@ sys/include/ape/lock.h - 664 sys sys 1146097783 415
 sys/include/ape/mouse.h - 664 sys sys 1146097783 112
 sys/include/ape/netdb.h - 664 sys sys 1014927764 3907
 sys/include/ape/netinet - 20000000775 sys sys 1039727356 0
-sys/include/ape/netinet/in.h - 664 sys sys 944948759 4717
+sys/include/ape/netinet/in.h - 664 sys sys 1184455015 4780
 sys/include/ape/netinet/tcp.h - 664 sys sys 944948759 0
 sys/include/ape/pwd.h - 664 sys sys 944948759 423
 sys/include/ape/qlock.h - 664 sys sys 1146097782 508
@@ -6046,7 +6046,7 @@ sys/include/ape/sys/param.h - 664 sys sys 944948759 243
 sys/include/ape/sys/pty.h - 664 sys sys 944948759 274
 sys/include/ape/sys/resource.h - 664 sys sys 1093980308 932
 sys/include/ape/sys/select.h - 664 sys sys 1014927751 779
-sys/include/ape/sys/socket.h - 664 sys sys 984696196 5783
+sys/include/ape/sys/socket.h - 664 sys sys 1184455001 5848
 sys/include/ape/sys/stat.h - 664 sys sys 1068478179 2177
 sys/include/ape/sys/time.h - 664 sys sys 944948759 418
 sys/include/ape/sys/times.h - 664 sys sys 944948759 340
@@ -7894,7 +7894,7 @@ sys/src/9/bitsy/dat.h - 664 sys sys 1143129783 5829
 sys/src/9/bitsy/defont.c - 664 sys sys 1017695511 21570
 sys/src/9/bitsy/devether.c - 664 sys sys 1178548255 10676
 sys/src/9/bitsy/devflash.c - 664 sys sys 1138500612 16830
-sys/src/9/bitsy/devpcmcia.c - 664 sys sys 1099801570 12977
+sys/src/9/bitsy/devpcmcia.c - 664 sys sys 1184464654 12994
 sys/src/9/bitsy/devpenmouse.c - 664 sys sys 1131289775 9589
 sys/src/9/bitsy/devuda1341.c - 664 sys sys 1071245420 30346
 sys/src/9/bitsy/devµc.c - 664 sys sys 1068393562 8125
@@ -7940,7 +7940,7 @@ sys/src/9/boot - 20000000775 sys sys 1161222920 0
 sys/src/9/boot/aux.c - 664 sys sys 1168305725 2586
 sys/src/9/boot/boot.c - 664 sys sys 1146746630 6013
 sys/src/9/boot/boot.h - 664 sys sys 1181823402 1722
-sys/src/9/boot/bootauth.c - 664 sys sys 1131289783 1160
+sys/src/9/boot/bootauth.c - 664 sys sys 1184466298 1172
 sys/src/9/boot/bootcache.c - 664 sys sys 1171955975 1608
 sys/src/9/boot/bootip.c - 664 sys sys 1072972133 3418
 sys/src/9/boot/bootmkfile - 664 sys sys 1091732792 404
@@ -7953,7 +7953,7 @@ sys/src/9/boot/mkboot - 775 sys sys 1171608307 1935
 sys/src/9/boot/nopsession.c - 664 sys sys 957373374 843
 sys/src/9/boot/paq.c - 664 sys sys 1067722601 1099
 sys/src/9/boot/printstub.c - 664 sys sys 1091732792 169
-sys/src/9/boot/sac.c - 664 sys sys 1015012530 802
+sys/src/9/boot/sac.c - 664 sys sys 1184466374 815
 sys/src/9/boot/settime.c - 664 sys sys 1036813626 2473
 sys/src/9/boot/testboot.c - 664 sys sys 1039763734 496
 sys/src/9/ip - 20000000775 sys sys 1119710004 0
@@ -8054,13 +8054,13 @@ sys/src/9/pc/ether82563.c - 664 sys sys 1178932992 32729
 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 1175292818 29621
+sys/src/9/pc/etherdp83820.c - 664 sys sys 1184468435 29621
 sys/src/9/pc/etherec2t.c - 664 sys sys 1135784135 4092
 sys/src/9/pc/etherelnk3.c - 664 sys sys 1158012427 48807
 sys/src/9/pc/etherga620.c - 664 sys sys 1175322931 29912
 sys/src/9/pc/etherga620fw.h - 664 sys sys 1026847642 222295
 sys/src/9/pc/etherif.h - 664 sys sys 1088178711 961
-sys/src/9/pc/etherigbe.c - 664 sys sys 1168306113 44967
+sys/src/9/pc/etherigbe.c - 664 sys sys 1184468343 44976
 sys/src/9/pc/etherm10g.c - 664 sys sys 1174595240 27681
 sys/src/9/pc/etherm10g2k.i - 664 sys sys 1174590427 957485
 sys/src/9/pc/etherm10g4k.i - 664 sys sys 1174590430 926959
@@ -8100,10 +8100,10 @@ sys/src/9/pc/pcdisk - 664 sys sys 1161302470 1495
 sys/src/9/pc/pcf - 664 sys sys 1161302469 1553
 sys/src/9/pc/pcfl - 664 sys sys 1161302470 1587
 sys/src/9/pc/pcflop - 664 sys sys 1158061762 1513
-sys/src/9/pc/pci.c - 664 sys sys 1176379998 29317
+sys/src/9/pc/pci.c - 664 sys sys 1184468036 29418
 sys/src/9/pc/pcmciamodem.c - 664 sys sys 1099761153 1586
 sys/src/9/pc/pcmkfile - 664 sys sys 1109303822 101
-sys/src/9/pc/piix4smbus.c - 664 sys sys 1091129037 5230
+sys/src/9/pc/piix4smbus.c - 664 sys sys 1184467714 5324
 sys/src/9/pc/plan9l.s - 664 sys sys 1015014521 910
 sys/src/9/pc/psaux.c - 664 sys sys 1026847650 915
 sys/src/9/pc/ptclbsum386.s - 664 sys sys 1015014521 1493
@@ -8114,18 +8114,18 @@ sys/src/9/pc/screen.c - 664 sys sys 1136336092 13971
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1170456695 55276
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sd63xxesb.c - 664 sys sys 1181160430 35976
+sys/src/9/pc/sd63xxesb.c - 664 sys sys 1184467400 35975
 sys/src/9/pc/sdata.c - 664 sys sys 1175564140 52809
-sys/src/9/pc/sdmv50xx.c - 664 sys sys 1177393607 33810
+sys/src/9/pc/sdmv50xx.c - 664 sys sys 1184467229 33837
 sys/src/9/pc/sdmylex.c - 664 sys sys 1171321627 28237
 sys/src/9/pc/sdscsi.c - 664 sys sys 1158889425 7241
-sys/src/9/pc/trap.c - 664 sys sys 1168306369 21848
+sys/src/9/pc/trap.c - 664 sys sys 1184466909 21852
 sys/src/9/pc/uartaxp.c - 664 sys sys 1166247784 18879
 sys/src/9/pc/uarti8250.c - 664 sys sys 1177676872 13957
 sys/src/9/pc/uartisa.c - 664 sys sys 1127126907 1777
 sys/src/9/pc/uartpci.c - 664 sys sys 1162859151 3617
 sys/src/9/pc/usb.h - 664 sys sys 1165555430 4257
-sys/src/9/pc/usbuhci.c - 664 sys sys 1170456715 31131
+sys/src/9/pc/usbuhci.c - 664 sys sys 1184466791 31205
 sys/src/9/pc/vga.c - 664 sys sys 1131290595 5148
 sys/src/9/pc/vga3dfx.c - 664 sys sys 1133218367 3833
 sys/src/9/pc/vgaark2000pv.c - 664 sys sys 1131290600 3422
@@ -8137,7 +8137,7 @@ sys/src/9/pc/vgacyber938x.c - 664 sys sys 1131290601 3707
 sys/src/9/pc/vgaet4000.c - 664 sys sys 1131290601 5111
 sys/src/9/pc/vgahiqvideo.c - 664 sys sys 1131290601 4098
 sys/src/9/pc/vgai81x.c - 664 sys sys 1135487942 4421
-sys/src/9/pc/vgamach64xx.c - 664 sys sys 1131290601 28257
+sys/src/9/pc/vgamach64xx.c - 664 sys sys 1184466732 28044
 sys/src/9/pc/vgamga2164w.c - 664 sys sys 1132331257 4769
 sys/src/9/pc/vgamga4xx.c - 664 sys sys 1155364221 9879
 sys/src/9/pc/vganeomagic.c - 664 sys sys 1131422294 10255
@@ -8226,7 +8226,7 @@ sys/src/9/port/print.c - 664 sys sys 1014931178 227
 sys/src/9/port/proc.c - 664 sys sys 1176658321 28742
 sys/src/9/port/qio.c - 664 sys sys 1070287837 23562
 sys/src/9/port/qlock.c - 664 sys sys 1178057654 3300
-sys/src/9/port/rdb.c - 664 sys sys 1018721202 1698
+sys/src/9/port/rdb.c - 664 sys sys 1184465938 1704
 sys/src/9/port/rebootcmd.c - 664 sys sys 1015278340 1561
 sys/src/9/port/sd.h - 664 sys sys 1134411408 2494
 sys/src/9/port/segment.c - 664 sys sys 1170456581 14052
@@ -8886,7 +8886,7 @@ sys/src/ape/lib/ap/stdio/sopenw.c - 664 sys sys 1014921982 287
 sys/src/ape/lib/ap/stdio/sprintf.c - 664 sys sys 1134052382 295
 sys/src/ape/lib/ap/stdio/sscanf.c - 664 sys sys 1014921982 238
 sys/src/ape/lib/ap/stdio/stdio.c - 664 sys sys 1014921982 209
-sys/src/ape/lib/ap/stdio/strerror.c - 664 sys sys 1071245622 1816
+sys/src/ape/lib/ap/stdio/strerror.c - 664 sys sys 1184449249 2091
 sys/src/ape/lib/ap/stdio/strtod.c - 664 sys sys 1014921983 14375
 sys/src/ape/lib/ap/stdio/tmpfile.c - 664 sys sys 1014921982 706
 sys/src/ape/lib/ap/stdio/tmpnam.c - 664 sys sys 1014921982 314
@@ -10093,7 +10093,7 @@ sys/src/cmd/db/runpcs.c - 664 sys sys 1134305454 2928
 sys/src/cmd/db/setup.c - 664 sys sys 1014925293 3581
 sys/src/cmd/db/trcrun.c - 664 sys sys 1131297926 4433
 sys/src/cmd/dc.c - 664 sys sys 1121977159 36572
-sys/src/cmd/dd.c - 664 sys sys 1158983783 11831
+sys/src/cmd/dd.c - 664 sys sys 1184464448 11893
 sys/src/cmd/deroff.c - 664 sys sys 1017679319 14611
 sys/src/cmd/dial - 20000000775 sys sys 1059696920 0
 sys/src/cmd/dial/at.c - 664 sys sys 1058789951 2011
@@ -14180,7 +14180,7 @@ sys/src/cmd/upas/fs/rfc2047-test - 664 sys sys 1143946985 1146
 sys/src/cmd/upas/fs/strtotm.c - 664 sys sys 1041137528 1904
 sys/src/cmd/upas/fs/tester.c - 664 sys sys 985037420 1418
 sys/src/cmd/upas/marshal - 20000000775 sys sys 1057272769 0
-sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1179087968 34023
+sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1184451870 33901
 sys/src/cmd/upas/marshal/mkfile - 664 sys sys 1047490298 235
 sys/src/cmd/upas/misc - 20000000775 sys sys 1039727596 0
 sys/src/cmd/upas/misc/gone.fishing - 664 sys sys 944961318 313
@@ -15843,3 +15843,8 @@ 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
+sys/src/9/pc/devlpt.c - 664 sys sys 1184469951 4423
+sys/src/9/pc/devpccard.c - 664 sys sys 1184469910 39336
+sys/src/9/pc/devtv.c - 664 sys sys 1184469620 45423
+sys/src/9/pc/ether2114x.c - 664 sys sys 1184468570 41707
+sys/src/9/pc/devlml.h - 664 sys sys 1184470164 3031

+ 26 - 26
dist/replica/plan9.db

@@ -538,8 +538,8 @@
 386/lib - 20000000775 sys sys 1016826328 0
 386/lib/ape - 20000000775 sys sys 1070519112 0
 386/lib/ape/lib9.a - 664 sys sys 1135531447 6906
-386/lib/ape/libap.a - 664 sys sys 1183661796 792640
-386/lib/ape/libbsd.a - 664 sys sys 1146156978 183900
+386/lib/ape/libap.a - 664 sys sys 1184467169 792928
+386/lib/ape/libbsd.a - 664 sys sys 1184467169 183900
 386/lib/ape/libdraw.a - 664 sys sys 1179372118 622218
 386/lib/ape/libfmt.a - 664 sys sys 1146156980 156706
 386/lib/ape/libl.a - 664 sys sys 1143777857 9406
@@ -6009,7 +6009,7 @@ sys/include/ape/ctype.h - 664 sys sys 1014927763 1654
 sys/include/ape/cursor.h - 664 sys sys 1146097782 161
 sys/include/ape/dirent.h - 664 sys sys 1035117682 717
 sys/include/ape/draw.h - 664 sys sys 1146097782 16321
-sys/include/ape/errno.h - 664 sys sys 1070327359 1525
+sys/include/ape/errno.h - 664 sys sys 1184449103 1548
 sys/include/ape/error.h - 664 sys sys 944948759 356
 sys/include/ape/event.h - 664 sys sys 1146097783 158
 sys/include/ape/fcntl.h - 664 sys sys 969500385 1231
@@ -6027,7 +6027,7 @@ sys/include/ape/lock.h - 664 sys sys 1146097783 415
 sys/include/ape/mouse.h - 664 sys sys 1146097783 112
 sys/include/ape/netdb.h - 664 sys sys 1014927764 3907
 sys/include/ape/netinet - 20000000775 sys sys 1039727356 0
-sys/include/ape/netinet/in.h - 664 sys sys 944948759 4717
+sys/include/ape/netinet/in.h - 664 sys sys 1184455015 4780
 sys/include/ape/netinet/tcp.h - 664 sys sys 944948759 0
 sys/include/ape/pwd.h - 664 sys sys 944948759 423
 sys/include/ape/qlock.h - 664 sys sys 1146097782 508
@@ -6046,7 +6046,7 @@ sys/include/ape/sys/param.h - 664 sys sys 944948759 243
 sys/include/ape/sys/pty.h - 664 sys sys 944948759 274
 sys/include/ape/sys/resource.h - 664 sys sys 1093980308 932
 sys/include/ape/sys/select.h - 664 sys sys 1014927751 779
-sys/include/ape/sys/socket.h - 664 sys sys 984696196 5783
+sys/include/ape/sys/socket.h - 664 sys sys 1184455001 5848
 sys/include/ape/sys/stat.h - 664 sys sys 1068478179 2177
 sys/include/ape/sys/time.h - 664 sys sys 944948759 418
 sys/include/ape/sys/times.h - 664 sys sys 944948759 340
@@ -7894,7 +7894,7 @@ sys/src/9/bitsy/dat.h - 664 sys sys 1143129783 5829
 sys/src/9/bitsy/defont.c - 664 sys sys 1017695511 21570
 sys/src/9/bitsy/devether.c - 664 sys sys 1178548255 10676
 sys/src/9/bitsy/devflash.c - 664 sys sys 1138500612 16830
-sys/src/9/bitsy/devpcmcia.c - 664 sys sys 1099801570 12977
+sys/src/9/bitsy/devpcmcia.c - 664 sys sys 1184464654 12994
 sys/src/9/bitsy/devpenmouse.c - 664 sys sys 1131289775 9589
 sys/src/9/bitsy/devuda1341.c - 664 sys sys 1071245420 30346
 sys/src/9/bitsy/devµc.c - 664 sys sys 1068393562 8125
@@ -7940,7 +7940,7 @@ sys/src/9/boot - 20000000775 sys sys 1161222920 0
 sys/src/9/boot/aux.c - 664 sys sys 1168305725 2586
 sys/src/9/boot/boot.c - 664 sys sys 1146746630 6013
 sys/src/9/boot/boot.h - 664 sys sys 1181823402 1722
-sys/src/9/boot/bootauth.c - 664 sys sys 1131289783 1160
+sys/src/9/boot/bootauth.c - 664 sys sys 1184466298 1172
 sys/src/9/boot/bootcache.c - 664 sys sys 1171955975 1608
 sys/src/9/boot/bootip.c - 664 sys sys 1072972133 3418
 sys/src/9/boot/bootmkfile - 664 sys sys 1091732792 404
@@ -7953,7 +7953,7 @@ sys/src/9/boot/mkboot - 775 sys sys 1171608307 1935
 sys/src/9/boot/nopsession.c - 664 sys sys 957373374 843
 sys/src/9/boot/paq.c - 664 sys sys 1067722601 1099
 sys/src/9/boot/printstub.c - 664 sys sys 1091732792 169
-sys/src/9/boot/sac.c - 664 sys sys 1015012530 802
+sys/src/9/boot/sac.c - 664 sys sys 1184466374 815
 sys/src/9/boot/settime.c - 664 sys sys 1036813626 2473
 sys/src/9/boot/testboot.c - 664 sys sys 1039763734 496
 sys/src/9/ip - 20000000775 sys sys 1119710004 0
@@ -8033,16 +8033,16 @@ sys/src/9/pc/devfloppy.c - 664 sys sys 1142958305 20139
 sys/src/9/pc/devi82365.c - 664 sys sys 1146318335 20504
 sys/src/9/pc/devlm78.c - 664 sys sys 1128255048 6291
 sys/src/9/pc/devlml.c - 664 sys sys 1132448361 7502
-sys/src/9/pc/devlml.h - 664 sys sys 1026847636 2948
-sys/src/9/pc/devlpt.c - 664 sys sys 1015014514 4420
-sys/src/9/pc/devpccard.c - 664 sys sys 1173225108 39296
+sys/src/9/pc/devlml.h - 664 sys sys 1184470164 3031
+sys/src/9/pc/devlpt.c - 664 sys sys 1184469951 4423
+sys/src/9/pc/devpccard.c - 664 sys sys 1184469910 39336
 sys/src/9/pc/devrtc.c - 664 sys sys 1015014515 7167
-sys/src/9/pc/devtv.c - 664 sys sys 1131290299 45676
+sys/src/9/pc/devtv.c - 664 sys sys 1184469620 45423
 sys/src/9/pc/devusb.c - 664 sys sys 1168305372 18752
 sys/src/9/pc/devvga.c - 664 sys sys 1181083003 9334
 sys/src/9/pc/dma.c - 664 sys sys 1142966373 5332
 sys/src/9/pc/ether2000.c - 664 sys sys 1173287379 4901
-sys/src/9/pc/ether2114x.c - 664 sys sys 1145359795 41693
+sys/src/9/pc/ether2114x.c - 664 sys sys 1184468570 41707
 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
@@ -8054,13 +8054,13 @@ sys/src/9/pc/ether82563.c - 664 sys sys 1178932992 32729
 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 1175292818 29621
+sys/src/9/pc/etherdp83820.c - 664 sys sys 1184468435 29621
 sys/src/9/pc/etherec2t.c - 664 sys sys 1135784135 4092
 sys/src/9/pc/etherelnk3.c - 664 sys sys 1158012427 48807
 sys/src/9/pc/etherga620.c - 664 sys sys 1175322931 29912
 sys/src/9/pc/etherga620fw.h - 664 sys sys 1026847642 222295
 sys/src/9/pc/etherif.h - 664 sys sys 1088178711 961
-sys/src/9/pc/etherigbe.c - 664 sys sys 1168306113 44967
+sys/src/9/pc/etherigbe.c - 664 sys sys 1184468343 44976
 sys/src/9/pc/etherm10g.c - 664 sys sys 1174595240 27681
 sys/src/9/pc/etherm10g2k.i - 664 sys sys 1174590427 957485
 sys/src/9/pc/etherm10g4k.i - 664 sys sys 1174590430 926959
@@ -8100,10 +8100,10 @@ sys/src/9/pc/pcdisk - 664 sys sys 1161302470 1495
 sys/src/9/pc/pcf - 664 sys sys 1161302469 1553
 sys/src/9/pc/pcfl - 664 sys sys 1161302470 1587
 sys/src/9/pc/pcflop - 664 sys sys 1158061762 1513
-sys/src/9/pc/pci.c - 664 sys sys 1176379998 29317
+sys/src/9/pc/pci.c - 664 sys sys 1184468036 29418
 sys/src/9/pc/pcmciamodem.c - 664 sys sys 1099761153 1586
 sys/src/9/pc/pcmkfile - 664 sys sys 1109303822 101
-sys/src/9/pc/piix4smbus.c - 664 sys sys 1091129037 5230
+sys/src/9/pc/piix4smbus.c - 664 sys sys 1184467714 5324
 sys/src/9/pc/plan9l.s - 664 sys sys 1015014521 910
 sys/src/9/pc/psaux.c - 664 sys sys 1026847650 915
 sys/src/9/pc/ptclbsum386.s - 664 sys sys 1015014521 1493
@@ -8114,18 +8114,18 @@ sys/src/9/pc/screen.c - 664 sys sys 1136336092 13971
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1170456695 55276
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sd63xxesb.c - 664 sys sys 1181160430 35976
+sys/src/9/pc/sd63xxesb.c - 664 sys sys 1184467400 35975
 sys/src/9/pc/sdata.c - 664 sys sys 1175564140 52809
-sys/src/9/pc/sdmv50xx.c - 664 sys sys 1177393607 33810
+sys/src/9/pc/sdmv50xx.c - 664 sys sys 1184467229 33837
 sys/src/9/pc/sdmylex.c - 664 sys sys 1171321627 28237
 sys/src/9/pc/sdscsi.c - 664 sys sys 1158889425 7241
-sys/src/9/pc/trap.c - 664 sys sys 1168306369 21848
+sys/src/9/pc/trap.c - 664 sys sys 1184466909 21852
 sys/src/9/pc/uartaxp.c - 664 sys sys 1166247784 18879
 sys/src/9/pc/uarti8250.c - 664 sys sys 1177676872 13957
 sys/src/9/pc/uartisa.c - 664 sys sys 1127126907 1777
 sys/src/9/pc/uartpci.c - 664 sys sys 1162859151 3617
 sys/src/9/pc/usb.h - 664 sys sys 1165555430 4257
-sys/src/9/pc/usbuhci.c - 664 sys sys 1170456715 31131
+sys/src/9/pc/usbuhci.c - 664 sys sys 1184466791 31205
 sys/src/9/pc/vga.c - 664 sys sys 1131290595 5148
 sys/src/9/pc/vga3dfx.c - 664 sys sys 1133218367 3833
 sys/src/9/pc/vgaark2000pv.c - 664 sys sys 1131290600 3422
@@ -8137,7 +8137,7 @@ sys/src/9/pc/vgacyber938x.c - 664 sys sys 1131290601 3707
 sys/src/9/pc/vgaet4000.c - 664 sys sys 1131290601 5111
 sys/src/9/pc/vgahiqvideo.c - 664 sys sys 1131290601 4098
 sys/src/9/pc/vgai81x.c - 664 sys sys 1135487942 4421
-sys/src/9/pc/vgamach64xx.c - 664 sys sys 1131290601 28257
+sys/src/9/pc/vgamach64xx.c - 664 sys sys 1184466732 28044
 sys/src/9/pc/vgamga2164w.c - 664 sys sys 1132331257 4769
 sys/src/9/pc/vgamga4xx.c - 664 sys sys 1155364221 9879
 sys/src/9/pc/vganeomagic.c - 664 sys sys 1131422294 10255
@@ -8226,7 +8226,7 @@ sys/src/9/port/print.c - 664 sys sys 1014931178 227
 sys/src/9/port/proc.c - 664 sys sys 1176658321 28742
 sys/src/9/port/qio.c - 664 sys sys 1070287837 23562
 sys/src/9/port/qlock.c - 664 sys sys 1178057654 3300
-sys/src/9/port/rdb.c - 664 sys sys 1018721202 1698
+sys/src/9/port/rdb.c - 664 sys sys 1184465938 1704
 sys/src/9/port/rebootcmd.c - 664 sys sys 1015278340 1561
 sys/src/9/port/sd.h - 664 sys sys 1134411408 2494
 sys/src/9/port/segment.c - 664 sys sys 1170456581 14052
@@ -8886,7 +8886,7 @@ sys/src/ape/lib/ap/stdio/sopenw.c - 664 sys sys 1014921982 287
 sys/src/ape/lib/ap/stdio/sprintf.c - 664 sys sys 1134052382 295
 sys/src/ape/lib/ap/stdio/sscanf.c - 664 sys sys 1014921982 238
 sys/src/ape/lib/ap/stdio/stdio.c - 664 sys sys 1014921982 209
-sys/src/ape/lib/ap/stdio/strerror.c - 664 sys sys 1071245622 1816
+sys/src/ape/lib/ap/stdio/strerror.c - 664 sys sys 1184449249 2091
 sys/src/ape/lib/ap/stdio/strtod.c - 664 sys sys 1014921983 14375
 sys/src/ape/lib/ap/stdio/tmpfile.c - 664 sys sys 1014921982 706
 sys/src/ape/lib/ap/stdio/tmpnam.c - 664 sys sys 1014921982 314
@@ -10093,7 +10093,7 @@ sys/src/cmd/db/runpcs.c - 664 sys sys 1134305454 2928
 sys/src/cmd/db/setup.c - 664 sys sys 1014925293 3581
 sys/src/cmd/db/trcrun.c - 664 sys sys 1131297926 4433
 sys/src/cmd/dc.c - 664 sys sys 1121977159 36572
-sys/src/cmd/dd.c - 664 sys sys 1158983783 11831
+sys/src/cmd/dd.c - 664 sys sys 1184464448 11893
 sys/src/cmd/deroff.c - 664 sys sys 1017679319 14611
 sys/src/cmd/dial - 20000000775 sys sys 1059696920 0
 sys/src/cmd/dial/at.c - 664 sys sys 1058789951 2011
@@ -14180,7 +14180,7 @@ sys/src/cmd/upas/fs/rfc2047-test - 664 sys sys 1143946985 1146
 sys/src/cmd/upas/fs/strtotm.c - 664 sys sys 1041137528 1904
 sys/src/cmd/upas/fs/tester.c - 664 sys sys 985037420 1418
 sys/src/cmd/upas/marshal - 20000000775 sys sys 1057272769 0
-sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1179087968 34023
+sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1184451870 33901
 sys/src/cmd/upas/marshal/mkfile - 664 sys sys 1047490298 235
 sys/src/cmd/upas/misc - 20000000775 sys sys 1039727596 0
 sys/src/cmd/upas/misc/gone.fishing - 664 sys sys 944961318 313

+ 26 - 0
dist/replica/plan9.log

@@ -49494,3 +49494,29 @@
 1184360411 0 c sys/src/cmd/5c/5.out.h - 664 sys sys 1184360192 2602
 1184360411 1 c sys/src/cmd/5c/reg.c - 664 sys sys 1184360192 19498
 1184382004 0 c 386/lib/libmach.a - 664 sys sys 1184380786 807390
+1184450404 0 c sys/include/ape/errno.h - 664 sys sys 1184449103 1548
+1184450404 1 c sys/src/ape/lib/ap/stdio/strerror.c - 664 sys sys 1184449249 2091
+1184452204 0 c sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1184451870 33901
+1184455804 0 c sys/include/ape/netinet/in.h - 664 sys sys 1184455015 4780
+1184455804 1 c sys/include/ape/sys/socket.h - 664 sys sys 1184455001 5848
+1184464804 0 c sys/src/9/bitsy/devpcmcia.c - 664 sys sys 1184464654 12994
+1184464804 1 c sys/src/cmd/dd.c - 664 sys sys 1184464448 11893
+1184466603 0 c sys/src/9/boot/bootauth.c - 664 sys sys 1184466298 1172
+1184466603 1 c sys/src/9/boot/sac.c - 664 sys sys 1184466374 815
+1184466603 2 c sys/src/9/port/rdb.c - 664 sys sys 1184465938 1704
+1184468404 0 c 386/lib/ape/libap.a - 664 sys sys 1184467169 792928
+1184468404 1 c 386/lib/ape/libbsd.a - 664 sys sys 1184467169 183900
+1184468404 2 c sys/src/9/pc/etherigbe.c - 664 sys sys 1184468343 44976
+1184468404 3 c sys/src/9/pc/pci.c - 664 sys sys 1184468036 29418
+1184468404 4 c sys/src/9/pc/piix4smbus.c - 664 sys sys 1184467714 5324
+1184468404 5 c sys/src/9/pc/trap.c - 664 sys sys 1184466909 21852
+1184468404 6 c sys/src/9/pc/etherdp83820.c - 664 sys sys 1184468435 29621
+1184468404 7 c sys/src/9/pc/sd63xxesb.c - 664 sys sys 1184467400 35975
+1184468404 8 c sys/src/9/pc/sdmv50xx.c - 664 sys sys 1184467229 33837
+1184468404 9 c sys/src/9/pc/usbuhci.c - 664 sys sys 1184466791 31205
+1184468404 10 c sys/src/9/pc/vgamach64xx.c - 664 sys sys 1184466732 28044
+1184470204 0 c sys/src/9/pc/devlpt.c - 664 sys sys 1184469951 4423
+1184470204 1 c sys/src/9/pc/devpccard.c - 664 sys sys 1184469910 39336
+1184470204 2 c sys/src/9/pc/devtv.c - 664 sys sys 1184469620 45423
+1184470204 3 c sys/src/9/pc/ether2114x.c - 664 sys sys 1184468570 41707
+1184470204 4 c sys/src/9/pc/devlml.h - 664 sys sys 1184470164 3031

+ 1 - 1
sys/include/ape/errno.h

@@ -49,7 +49,7 @@ extern int errno;
 /* bsd networking software */
 #define ENOTSOCK	36
 #define EPROTONOSUPPORT	37
-#define EPROTOTYPE 37
+#define EPROTOTYPE	37	/* two names for 37 */
 #define ECONNREFUSED	38
 #define EAFNOSUPPORT	39
 #define ENOBUFS		40

+ 1 - 0
sys/include/ape/netinet/in.h

@@ -97,6 +97,7 @@ struct in_addr {
 
 #define	INADDR_ANY		(unsigned long)0x00000000
 #define	INADDR_BROADCAST	(unsigned long)0xffffffff	/* must be masked */
+#define INADDR_NONE		(unsigned long)0xffffffff	/* -1 return */
 
 #define	IN_LOOPBACKNET		127			/* official! */
 

+ 3 - 2
sys/include/ape/sys/socket.h

@@ -99,8 +99,8 @@ struct	linger {
 #define	AF_ROUTE	17		/* Internal Routing Protocol */
 #define	AF_LINK		18		/* Link layer interface */
 #define	pseudo_AF_XTP	19		/* eXpress Transfer Protocol (no AF) */
-
-#define	AF_MAX		20
+#define AF_INET6	24		/* IP version 6 */
+#define	AF_MAX		30
 
 /*
  * Structure used by kernel to store most
@@ -144,6 +144,7 @@ struct sockproto {
 #define	PF_ROUTE	AF_ROUTE
 #define	PF_LINK		AF_LINK
 #define	PF_XTP		pseudo_AF_XTP	/* really just proto family, no AF */
+#define	PF_INET6	AF_INET6
 
 #define	PF_MAX		AF_MAX
 

+ 1 - 1
sys/include/control.h

@@ -27,7 +27,7 @@ enum	/* types */
 	Ctltext,
 	Ctltextbutton,
 	Ctltextbutton3,
-	Ctlgroup,		// divider between controls and metacontrols
+	Ctlgroup,		/* divider between controls and metacontrols */
 	Ctlboxbox,
 	Ctlcolumn,
 	Ctlrow,

+ 76 - 75
sys/include/thread.h

@@ -7,27 +7,28 @@ typedef struct Alt	Alt;
 typedef struct Channel	Channel;
 typedef struct Ref	Ref;
 
-/* Channel structure.  S is the size of the buffer.  For unbuffered channels
+/*
+ * Channel structure.  S is the size of the buffer.  For unbuffered channels
  * s is zero.  v is an array of s values.  If s is zero, v is unused.
  * f and n represent the state of the queue pointed to by v.
  */
 
 enum {
 	Nqwds = 2,
-	Nqshift = 5,	// 2log #of bits in long
-	Nqmask =  - 1,
+	Nqshift = 5,		/* log₂ # of bits in long */
+	Nqmask =  -1,
 	Nqbits = (1 << Nqshift) * 2,
 };
 
 struct Channel {
-	int			s;		// Size of the channel (may be zero)
-	uint			f;		// Extraction point (insertion pt: (f + n) % s)
-	uint			n;		// Number of values in the channel
-	int			e;		// Element size
-	int			freed;	// Set when channel is being deleted
-	volatile Alt	**qentry;	// Receivers/senders waiting (malloc)
-	volatile int	nentry;	// # of entries malloc-ed
-	uchar		v[1];		// Array of s values in the channel
+	int	s;		/* Size of the channel (may be zero) */
+	uint	f;		/* Extraction point (insertion pt: (f+n) % s) */
+	uint	n;		/* Number of values in the channel */
+	int	e;		/* Element size */
+	int	freed;		/* Set when channel is being deleted */
+	volatile Alt **qentry;	/* Receivers/senders waiting (malloc) */
+	volatile int nentry;	/* # of entries malloc-ed */
+	uchar	v[1];		/* Array of s values in the channel */
 };
 
 
@@ -42,69 +43,69 @@ typedef enum {
 
 struct Alt {
 	Channel	*c;		/* channel */
-	void		*v;		/* pointer to value */
+	void	*v;		/* pointer to value */
 	ChanOp	op;		/* operation */
-
-	/* the next variables are used internally to alt
+	/*
+	 * the next variables are used internally to alt
 	 * they need not be initialized
 	 */
-	Channel	**tag;	/* pointer to rendez-vous tag */
-	int		entryno;	/* entry number */
+	Channel	**tag;		/* pointer to rendez-vous tag */
+	int	entryno;	/* entry number */
 };
 
 struct Ref {
-	long ref;
+	long	ref;
 };
 
-int		alt(Alt alts[]);
-Channel*	chancreate(int elemsize, int bufsize);
-int		chaninit(Channel *c, int elemsize, int elemcnt);
-void		chanfree(Channel *c);
-int		chanprint(Channel *, char *, ...);
-long		decref(Ref *r);		/* returns 0 iff value is now zero */
-void		incref(Ref *r);
-int		nbrecv(Channel *c, void *v);
-void*		nbrecvp(Channel *c);
-ulong		nbrecvul(Channel *c);
-int		nbsend(Channel *c, void *v);
-int		nbsendp(Channel *c, void *v);
-int		nbsendul(Channel *c, ulong v);
-void		needstack(int);
-int		proccreate(void (*f)(void *arg), void *arg, uint stacksize);
-int		procrfork(void (*f)(void *arg), void *arg, uint stacksize, int flag);
-void**		procdata(void);
-void		procexec(Channel *, char *, char *[]);
-void		procexecl(Channel *, char *, ...);
-int		recv(Channel *c, void *v);
-void*		recvp(Channel *c);
-ulong		recvul(Channel *c);
-int		send(Channel *c, void *v);
-int		sendp(Channel *c, void *v);
-int		sendul(Channel *c, ulong v);
-int		threadcreate(void (*f)(void *arg), void *arg, uint stacksize);
-void**		threaddata(void);
-void		threadexits(char *);
-void		threadexitsall(char *);
-int		threadgetgrp(void);	/* return thread group of current thread */
-char*		threadgetname(void);
-void		threadint(int);	/* interrupt thread */
-void		threadintgrp(int);	/* interrupt threads in grp */
-void		threadkill(int);	/* kill thread */
-void		threadkillgrp(int);	/* kill threads in group */
-void		threadmain(int argc, char *argv[]);
-void		threadnonotes(void);
-int		threadnotify(int (*f)(void*, char*), int in);
-int		threadid(void);
-int		threadpid(int);
-int		threadsetgrp(int);	/* set thread group, return old */
-void		threadsetname(char *fmt, ...);
-Channel*	threadwaitchan(void);
+int	alt(Alt alts[]);
+Channel*chancreate(int elemsize, int bufsize);
+int	chaninit(Channel *c, int elemsize, int elemcnt);
+void	chanfree(Channel *c);
+int	chanprint(Channel *, char *, ...);
+long	decref(Ref *r);			/* returns 0 iff value is now zero */
+void	incref(Ref *r);
+int	nbrecv(Channel *c, void *v);
+void*	nbrecvp(Channel *c);
+ulong	nbrecvul(Channel *c);
+int	nbsend(Channel *c, void *v);
+int	nbsendp(Channel *c, void *v);
+int	nbsendul(Channel *c, ulong v);
+void	needstack(int);
+int	proccreate(void (*f)(void *arg), void *arg, uint stacksize);
+int	procrfork(void (*f)(void *arg), void *arg, uint stacksize, int flag);
+void**	procdata(void);
+void	procexec(Channel *, char *, char *[]);
+void	procexecl(Channel *, char *, ...);
+int	recv(Channel *c, void *v);
+void*	recvp(Channel *c);
+ulong	recvul(Channel *c);
+int	send(Channel *c, void *v);
+int	sendp(Channel *c, void *v);
+int	sendul(Channel *c, ulong v);
+int	threadcreate(void (*f)(void *arg), void *arg, uint stacksize);
+void**	threaddata(void);
+void	threadexits(char *);
+void	threadexitsall(char *);
+int	threadgetgrp(void);	/* return thread group of current thread */
+char*	threadgetname(void);
+void	threadint(int);		/* interrupt thread */
+void	threadintgrp(int);	/* interrupt threads in grp */
+void	threadkill(int);	/* kill thread */
+void	threadkillgrp(int);	/* kill threads in group */
+void	threadmain(int argc, char *argv[]);
+void	threadnonotes(void);
+int	threadnotify(int (*f)(void*, char*), int in);
+int	threadid(void);
+int	threadpid(int);
+int	threadsetgrp(int);		/* set thread group, return old */
+void	threadsetname(char *fmt, ...);
+Channel*threadwaitchan(void);
 int	tprivalloc(void);
 void	tprivfree(int);
 void	**tprivaddr(int);
-void		yield(void);
+void	yield(void);
 
-extern	int		mainstacksize;
+extern	int	mainstacksize;
 
 /* slave I/O processes */
 typedef struct Ioproc Ioproc;
@@ -113,16 +114,16 @@ typedef struct Ioproc Ioproc;
 
 
 Ioproc*	ioproc(void);
-void		closeioproc(Ioproc*);
-void		iointerrupt(Ioproc*);
-
-int		ioclose(Ioproc*, int);
-int		iodial(Ioproc*, char*, char*, char*, int*);
-int		ioopen(Ioproc*, char*, int);
-long		ioread(Ioproc*, int, void*, long);
-long		ioreadn(Ioproc*, int, void*, long);
-long		iowrite(Ioproc*, int, void*, long);
-int		iosleep(Ioproc*, long);
-
-long		iocall(Ioproc*, long (*)(va_list*), ...);
-void		ioret(Ioproc*, int);
+void	closeioproc(Ioproc*);
+void	iointerrupt(Ioproc*);
+
+int	ioclose(Ioproc*, int);
+int	iodial(Ioproc*, char*, char*, char*, int*);
+int	ioopen(Ioproc*, char*, int);
+long	ioread(Ioproc*, int, void*, long);
+long	ioreadn(Ioproc*, int, void*, long);
+long	iowrite(Ioproc*, int, void*, long);
+int	iosleep(Ioproc*, long);
+
+long	iocall(Ioproc*, long (*)(va_list*), ...);
+void	ioret(Ioproc*, int);

+ 1 - 0
sys/src/9/bitsy/devpcmcia.c

@@ -407,6 +407,7 @@ pcmctlwrite(char *p, long n, ulong, PCMslot *sp)
 		if(devtab[dtx]->config(1, p, &cf) < 0)
 			error("couldn't configure device");
 		sp->dev = devtab[dtx];
+		free(cf.type);
 		wunlock(sp);
 		poperror();
 

+ 2 - 2
sys/src/9/boot/bootauth.c

@@ -24,8 +24,8 @@ authentication(int cpuflag)
 	av[ac++] = "factotum";
 	if(getenv("debugfactotum"))
 		av[ac++] = "-p";
-//av[ac++] = "-d";	//debug traces
-//av[ac++] = "-D";	//9p messages
+//	av[ac++] = "-d";		/* debug traces */
+//	av[ac++] = "-D";		/* 9p messages */
 	if(cpuflag)
 		av[ac++] = "-S";
 	else

+ 6 - 4
sys/src/9/boot/sac.c

@@ -2,8 +2,10 @@
 #include <libc.h>
 #include <../boot/boot.h>
 
-// HACK - take over from boot since file system is not
-// available on a pipe
+/*
+ * HACK - take over from boot since file system is not
+ * available on a pipe
+ */
 
 void
 configsac(Method *mp)
@@ -21,7 +23,7 @@ configsac(Method *mp)
 	if(bind("#C", "/", MAFTER) < 0)
 		fatal("bind /");
 
-	// fixed sysname - enables correct namespace file
+	/* fixed sysname - enables correct namespace file */
 	fd = open("#c/sysname", OWRITE);
 	if(fd < 0)
 		fatal("open sysname");
@@ -43,6 +45,6 @@ configsac(Method *mp)
 int
 connectsac(void)
 {
-	// does not get here
+	/* does not get here */
 	return -1;
 }

+ 4 - 4
sys/src/9/ip/arp.c

@@ -94,7 +94,7 @@ newarp6(Arp *arp, uchar *ip, Ipifc *ifc, int addrxt)
 			xp = next;
 		}
 	}
-	else {	// queue icmp unreachable for rxmitproc later on, w/o arp lock
+	else { /* queue icmp unreachable for rxmitproc later on, w/o arp lock */
 		if(xp){
 			if(arp->dropl == nil) 
 				arp->dropf = xp;
@@ -436,7 +436,7 @@ arpwrite(Fs *fs, char *s, int len)
 			}
 		}
 		memset(arp->hash, 0, sizeof(arp->hash));
-// clear all pkts on these lists (rxmt, dropf/l)
+		/* clear all pkts on these lists (rxmt, dropf/l) */
 		arp->rxmt = nil;
 		arp->dropf = nil;
 		arp->dropl = nil;
@@ -573,11 +573,11 @@ rxmitsols(Arp *arp)
 	a = arp->rxmt;
 	if(a==nil){
 		nrxt = 0;
-		goto dodrops; 		//return nrxt;
+		goto dodrops; 		/* return nrxt; */
 	}
 	nrxt = a->rtime - NOW;
 	if(nrxt > 3*ReTransTimer/4) 
-		goto dodrops; 		//return nrxt;
+		goto dodrops; 		/* return nrxt; */
 
 	for(; a; a = a->nextrxt){
 		ifc = a->ifc;

+ 9 - 9
sys/src/9/ip/ipaux.c

@@ -99,7 +99,7 @@ uchar v6linklocalmask[IPaddrlen] = {
 	0, 0, 0, 0,
 	0, 0, 0, 0
 };
-int v6llpreflen = 8;	// link-local prefix length
+int v6llpreflen = 8;	/* link-local prefix length */
 uchar v6sitelocal[IPaddrlen] = {
 	0xfe, 0xc0, 0, 0,
 	0, 0, 0, 0,
@@ -112,7 +112,7 @@ uchar v6sitelocalmask[IPaddrlen] = {
 	0, 0, 0, 0,
 	0, 0, 0, 0
 };
-int v6slpreflen = 6;	// site-local prefix length
+int v6slpreflen = 6;	/* site-local prefix length */
 uchar v6glunicast[IPaddrlen] = {
 	0x08, 0, 0, 0,
 	0, 0, 0, 0,
@@ -131,7 +131,7 @@ uchar v6multicastmask[IPaddrlen] = {
 	0, 0, 0, 0,
 	0, 0, 0, 0
 };
-int v6mcpreflen = 1;	// multicast prefix length
+int v6mcpreflen = 1;	/* multicast prefix length */
 uchar v6allnodesN[IPaddrlen] = {
 	0xff, 0x01, 0, 0,
 	0, 0, 0, 0,
@@ -144,7 +144,7 @@ uchar v6allnodesNmask[IPaddrlen] = {
 	0, 0, 0, 0,
 	0, 0, 0, 0
 };
-int v6aNpreflen = 2;	// all nodes (N) prefix
+int v6aNpreflen = 2;	/* all nodes (N) prefix */
 uchar v6allnodesL[IPaddrlen] = {
 	0xff, 0x02, 0, 0,
 	0, 0, 0, 0,
@@ -157,7 +157,7 @@ uchar v6allnodesLmask[IPaddrlen] = {
 	0, 0, 0, 0,
 	0, 0, 0, 0
 };
-int v6aLpreflen = 2;	// all nodes (L) prefix
+int v6aLpreflen = 2;	/* all nodes (L) prefix */
 uchar v6allroutersN[IPaddrlen] = {
 	0xff, 0x01, 0, 0,
 	0, 0, 0, 0,
@@ -683,7 +683,7 @@ iphtlook(Ipht *ht, uchar *sa, ushort sp, uchar *da, ushort dp)
 			return c;
 		}
 	}
-	
+
 	/* match local address and port */
 	hv = iphash(IPnoaddr, 0, da, dp);
 	for(h = ht->tab[hv]; h != nil; h = h->next){
@@ -695,7 +695,7 @@ iphtlook(Ipht *ht, uchar *sa, ushort sp, uchar *da, ushort dp)
 			return c;
 		}
 	}
-	
+
 	/* match just port */
 	hv = iphash(IPnoaddr, 0, IPnoaddr, dp);
 	for(h = ht->tab[hv]; h != nil; h = h->next){
@@ -707,7 +707,7 @@ iphtlook(Ipht *ht, uchar *sa, ushort sp, uchar *da, ushort dp)
 			return c;
 		}
 	}
-	
+
 	/* match local address */
 	hv = iphash(IPnoaddr, 0, da, 0);
 	for(h = ht->tab[hv]; h != nil; h = h->next){
@@ -719,7 +719,7 @@ iphtlook(Ipht *ht, uchar *sa, ushort sp, uchar *da, ushort dp)
 			return c;
 		}
 	}
-	
+
 	/* look for something that matches anything */
 	hv = iphash(IPnoaddr, 0, IPnoaddr, 0);
 	for(h = ht->tab[hv]; h != nil; h = h->next){

+ 6 - 4
sys/src/9/ip/tcp.c

@@ -608,7 +608,7 @@ timerstate(Tcppriv *priv, Tcptimer *t, int newstate)
 {
 	if(newstate != TcptimerON){
 		if(t->state == TcptimerON){
-			// unchain
+			/* unchain */
 			if(priv->timers == t){
 				priv->timers = t->next;
 				if(t->prev != nil)
@@ -622,7 +622,7 @@ timerstate(Tcppriv *priv, Tcptimer *t, int newstate)
 		}
 	} else {
 		if(t->state != TcptimerON){
-			// chain
+			/* chain */
 			if(t->prev != nil || t->next != nil)
 				panic("timerstate2");
 			t->prev = nil;
@@ -2888,8 +2888,10 @@ addreseq(Tcpctl *tcb, Tcppriv *tpriv, Tcp *seg, Block *bp, ushort length)
 			}
 		}
 
-		// delete entire reassembly queue; wait for retransmit.
-		// - should we be smarter and only delete the tail?
+		/*
+		 * delete entire reassembly queue; wait for retransmit.
+		 * - should we be smarter and only delete the tail?
+		 */
 		for(rp = tcb->reseq; rp != nil; rp = rp1){
 			rp1 = rp->next;
 			freeblist(rp->bp);

+ 4 - 2
sys/src/9/ip/udp.c

@@ -296,8 +296,10 @@ udpkick(void *x, Block *bp)
 		if(bp == nil)
 			return;
 
-		// using the v6 ip header to create pseudo header 
-		// first then reset it to the normal ip header
+		/*
+		 * using the v6 ip header to create pseudo header 
+		 * first then reset it to the normal ip header
+		 */
 		uh6 = (Udp6hdr *)(bp->rp);
 		memset(uh6, 0, 8);
 		ptcllen = dlen + UDP_UDPHDR_SZ;

+ 24 - 22
sys/src/9/pc/devarch.c

@@ -22,9 +22,9 @@ static struct
 	Lock;
 	IOMap	*m;
 	IOMap	*free;
-	IOMap	maps[32];		// some initial free maps
+	IOMap	maps[32];	/* some initial free maps */
 
-	QLock	ql;			// lock for reading map
+	QLock	ql;		/* lock for reading map */
 } iomap;
 
 enum {
@@ -110,9 +110,9 @@ ioinit(void)
 	/*
 	 * This is necessary to make the IBM X20 boot.
 	 * Have not tracked down the reason.
+	 * i82557 is at 0x1000, the dummy entry is needed for swappable devs.
 	 */
-	ioalloc(0x0fff, 1, 0, "dummy");	// i82557 is at 0x1000, the dummy
-					// entry is needed for swappable devs.
+	ioalloc(0x0fff, 1, 0, "dummy");
 
 	if ((excluded = getconf("ioexclude")) != nil) {
 		char *s;
@@ -140,9 +140,11 @@ ioinit(void)
 
 }
 
-// Reserve a range to be ioalloced later. 
-// This is in particular useful for exchangable cards, such
-// as pcmcia and cardbus cards.
+/*
+ * Reserve a range to be ioalloced later.
+ * This is in particular useful for exchangable cards, such
+ * as pcmcia and cardbus cards.
+ */
 int
 ioreserve(int, int size, int align, char *tag)
 {
@@ -150,7 +152,7 @@ ioreserve(int, int size, int align, char *tag)
 	int i, port;
 
 	lock(&iomap);
-	// find a free port above 0x400 and below 0x1000
+	/* find a free port above 0x400 and below 0x1000 */
 	port = 0x400;
 	for(l = &iomap.m; *l; l = &(*l)->next){
 		m = *l;
@@ -188,10 +190,10 @@ ioreserve(int, int size, int align, char *tag)
 	return m->start;
 }
 
-//
-//	alloc some io port space and remember who it was
-//	alloced to.  if port < 0, find a free region.
-//
+/*
+ *	alloc some io port space and remember who it was
+ *	alloced to.  if port < 0, find a free region.
+ */
 int
 ioalloc(int port, int size, int align, char *tag)
 {
@@ -200,7 +202,7 @@ ioalloc(int port, int size, int align, char *tag)
 
 	lock(&iomap);
 	if(port < 0){
-		// find a free port above 0x400 and below 0x1000
+		/* find a free port above 0x400 and below 0x1000 */
 		port = 0x400;
 		for(l = &iomap.m; *l; l = &(*l)->next){
 			m = *l;
@@ -218,12 +220,12 @@ ioalloc(int port, int size, int align, char *tag)
 			return -1;
 		}
 	} else {
-		// Only 64KB I/O space on the x86.
+		/* Only 64KB I/O space on the x86. */
 		if((port+size) > 0x10000){
 			unlock(&iomap);
 			return -1;
 		}
-		// see if the space clashes with previously allocated ports
+		/* see if the space clashes with previously allocated ports */
 		for(l = &iomap.m; *l; l = &(*l)->next){
 			m = *l;
 			if(m->end <= port)
@@ -288,7 +290,7 @@ iounused(int start, int end)
 	for(m = iomap.m; m; m = m->next){
 		if(start >= m->start && start < m->end
 		|| start <= m->start && end > m->start)
-			return 0; 
+			return 0;
 	}
 	return 1;
 }
@@ -504,7 +506,7 @@ static int
 cmpswap386(long *addr, long old, long new)
 {
 	int r, s;
-	
+
 	s = splhi();
 	if(r = (*addr == old))
 		*addr = new;
@@ -699,7 +701,7 @@ cpuidentify(void)
 		tab = x86sis;
 	else
 		tab = x86intel;
-	
+
 	family = X86FAMILY(m->cpuidax);
 	model = X86MODEL(m->cpuidax);
 	for(t=tab; t->name; t++)
@@ -745,13 +747,13 @@ cpuidentify(void)
 				rdmsr(0x01, &mct);
 			}
 		}
-	
+
 		/*
 		 * Detect whether the chip supports the global bit
 		 * in page directory and page table entries.  When set
 		 * in a particular entry, it means ``don't bother removing
-		 * this from the TLB when CR3 changes.''  
-		 * 
+		 * this from the TLB when CR3 changes.''
+		 *
 		 * We flag all kernel pages with this bit.  Doing so lessens the
 		 * overhead of switching processes on bare hardware,
 		 * even more so on VMware.  See mmu.c:/^memglobal.
@@ -792,7 +794,7 @@ archctlread(Chan*, void *a, long nn, vlong offset)
 {
 	char buf[256];
 	int n;
-	
+
 	n = snprint(buf, sizeof buf, "cpu %s %lud%s\n",
 		cputype->name, (ulong)(m->cpuhz+999999)/1000000,
 		m->havepge ? " pge" : "");

+ 81 - 60
sys/src/9/pc/devlml.c

@@ -1,3 +1,6 @@
+/*
+ * Lml 22 driver
+ */
 #include	"u.h"
 #include	"../port/lib.h"
 #include	"mem.h"
@@ -15,8 +18,6 @@
 
 int debug = 0;
 
-// Lml 22 driver
-
 enum{
 	Qdir,
 	Qctl0,
@@ -30,34 +31,36 @@ enum{
 #define	QID(q)		((ulong)(q).path)
 #define	QIDLML(q)	((((ulong)(q).path)-1)>>1)
 
-static Dirtab lmldir[]={
-	".",			{Qdir, 0, QTDIR},	0,	DMDIR|0555,
-	"lml0ctl",		{Qctl0},			0,	0666,
-	"lml0jpg",		{Qjpg0},			0,	0444,
-	"lml0raw",	{Qraw0},			0,	0444,
-	"lml1ctl",		{Qctl1},			0,	0666,
-	"lml1jpg",		{Qjpg1},			0,	0444,
-	"lml1raw",	{Qraw1},			0,	0444,
+static Dirtab lmldir[] = {
+	".",		{Qdir, 0, QTDIR},	0,	DMDIR|0555,
+	"lml0ctl",	{Qctl0},		0,	0666,
+	"lml0jpg",	{Qjpg0},		0,	0444,
+	"lml0raw",	{Qraw0},		0,	0444,
+	"lml1ctl",	{Qctl1},		0,	0666,
+	"lml1jpg",	{Qjpg1},		0,	0444,
+	"lml1raw",	{Qraw1},		0,	0444,
 };
 
 typedef struct LML LML;
 
 struct LML {
-	// Hardware
-	Pcidev *		pcidev;
-	ulong		pciBaseAddr;
-	// Allocated memory
-	CodeData *	codedata;
-	// Software state
-	ulong		jpgframeno;
-	int			frameNo;
-	Rendez		sleepjpg;
-	int			jpgopens;
+	/* Hardware */
+	Pcidev	*pcidev;
+	ulong	pciBaseAddr;
+
+	/* Allocated memory */
+	CodeData *codedata;
+
+	/* Software state */
+	ulong	jpgframeno;
+	int	frameNo;
+	Rendez	sleepjpg;
+	int	jpgopens;
 } lmls[NLML];
 
 int nlml;
 
-static FrameHeader	jpgheader = {
+static FrameHeader jpgheader = {
 	MRK_SOI, MRK_APP3, (sizeof(FrameHeader)-4) << 8,
 	{ 'L', 'M', 'L', '\0'},
 	-1, 0, 0,  0
@@ -67,7 +70,8 @@ static FrameHeader	jpgheader = {
 #define readl(a) *(ulong*)(a)
 
 static int
-getbuffer(void *x){
+getbuffer(void *x)
+{
 	static last = NBUF-1;
 	int l = last;
 	LML *lml;
@@ -84,12 +88,15 @@ getbuffer(void *x){
 }
 
 static long
-jpgread(LML *lml, void *va, long nbytes, vlong, int dosleep) {
+jpgread(LML *lml, void *va, long nbytes, vlong, int dosleep)
+{
 	int bufno;
 	FrameHeader *jpgheader;
-	
-	// reads should be of size 1 or sizeof(FrameHeader)
-	// Frameno is the number of the buffer containing the data
+
+	/*
+	 * reads should be of size 1 or sizeof(FrameHeader).
+	 * Frameno is the number of the buffer containing the data.
+	 */
 	while ((bufno = getbuffer(lml)) == 0 && dosleep)
 		sleep(&lml->sleepjpg, getbuffer, lml);
 	if (--bufno < 0)
@@ -110,48 +117,55 @@ jpgread(LML *lml, void *va, long nbytes, vlong, int dosleep) {
 static void lmlintr(Ureg *, void *);
 
 static void
-prepbuf(LML *lml) {
+prepbuf(LML *lml)
+{
 	int i;
+	CodeData *cd;
 
+	cd = lml->codedata;
 	for (i = 0; i < NBUF; i++) {
-		lml->codedata->statCom[i] = PADDR(&(lml->codedata->fragdesc[i]));
-		lml->codedata->fragdesc[i].addr = PADDR(lml->codedata->frag[i].fb);
-		// Length is in double words, in position 1..20
-		lml->codedata->fragdesc[i].leng = (FRAGSIZE >> 1) | FRAGM_FINAL_B;
-		memmove(lml->codedata->frag[i].hdr+2, &jpgheader, sizeof(FrameHeader)-2);
+		cd->statCom[i] = PADDR(&(cd->fragdesc[i]));
+		cd->fragdesc[i].addr = PADDR(cd->frag[i].fb);
+		/* Length is in double words, in position 1..20 */
+		cd->fragdesc[i].leng = FRAGSIZE >> 1 | FRAGM_FINAL_B;
+		memmove(cd->frag[i].hdr+2, &jpgheader, sizeof(FrameHeader)-2);
 	}
 }
 
 static void
 lmlreset(void)
 {
-	Physseg segbuf;
 	ulong regpa;
+	char name[32];
 	void *regva;
 	ISAConf isa;
-	char name[32];
-	Pcidev *pcidev;
 	LML *lml;
+	Pcidev *pcidev;
+	Physseg segbuf;
 
 	pcidev = nil;
-	
-	for (nlml = 0; nlml < NLML && (pcidev = pcimatch(pcidev, VENDOR_ZORAN, ZORAN_36067)); nlml++){
+
+	for (nlml = 0; nlml < NLML && (pcidev = pcimatch(pcidev, VENDOR_ZORAN,
+	    ZORAN_36067)); nlml++){
 		if(isaconfig("lml", nlml, &isa) == 0) {
 			if (debug) print("lml %d not in plan9.ini\n", nlml);
 			break;
 		}
 		lml = &lmls[nlml];
 		lml->pcidev = pcidev;
-		lml->codedata = (CodeData*)(((ulong)xalloc(Codedatasize+ BY2PG) + BY2PG-1) & ~(BY2PG-1));
+		lml->codedata = (CodeData*)(((ulong)xalloc(Codedatasize+ BY2PG)
+			+ BY2PG-1) & ~(BY2PG-1));
 		if (lml->codedata == nil) {
 			print("devlml: xalloc(%ux, %ux, 0)\n", Codedatasize, BY2PG);
 			return;
 		}
 
-		print("Installing Motion JPEG driver %s, irq %d\n", MJPG_VERSION, pcidev->intl); 
-		print("MJPG buffer at 0x%.8lux, size 0x%.8ux\n", lml->codedata, Codedatasize); 
+		print("Installing Motion JPEG driver %s, irq %d\n",
+			MJPG_VERSION, pcidev->intl);
+		print("MJPG buffer at 0x%.8lux, size 0x%.8ux\n", lml->codedata,
+			Codedatasize);
 
-		// Get access to DMA memory buffer
+		/* Get access to DMA memory buffer */
 		lml->codedata->pamjpg = PADDR(lml->codedata->statCom);
 
 		prepbuf(lml);
@@ -189,10 +203,9 @@ lmlreset(void)
 			return;
 		}
 
-		// Interrupt handler
+		/* set up interrupt handler */
 		intrenable(pcidev->intl, lmlintr, lml, pcidev->tbdf, "lml");
 	}
-	return;
 }
 
 static Chan*
@@ -214,7 +227,8 @@ lmlstat(Chan *c, uchar *db, int n)
 }
 
 static Chan*
-lmlopen(Chan *c, int omode) {
+lmlopen(Chan *c, int omode)
+{
 	int i;
 	LML *lml;
 
@@ -225,6 +239,7 @@ lmlopen(Chan *c, int omode) {
 	switch((ulong)c->qid.path){
 	case Qctl1:
 		i++;
+		/* fall through */
 	case Qctl0:
 		if (i >= nlml)
 			error(Eio);
@@ -232,9 +247,10 @@ lmlopen(Chan *c, int omode) {
 	case Qjpg1:
 	case Qraw1:
 		i++;
+		/* fall through */
 	case Qjpg0:
 	case Qraw0:
-		// allow one open
+		/* allow one open */
 		if (i >= nlml)
 			error(Eio);
 		lml = lmls+i;
@@ -249,7 +265,8 @@ lmlopen(Chan *c, int omode) {
 }
 
 static void
-lmlclose(Chan *c) {
+lmlclose(Chan *c)
+{
 	int i;
 
 	i = 0;
@@ -257,6 +274,7 @@ lmlclose(Chan *c) {
 	case Qjpg1:
 	case Qraw1:
 		i++;
+		/* fall through */
 	case Qjpg0:
 	case Qraw0:
 		lmls[i].jpgopens = 0;
@@ -265,13 +283,13 @@ lmlclose(Chan *c) {
 }
 
 static long
-lmlread(Chan *c, void *va, long n, vlong voff) {
-	int i;
-	uchar *buf = va;
+lmlread(Chan *c, void *va, long n, vlong voff)
+{
+	int i, len;
 	long off = voff;
+	uchar *buf = va;
 	LML *lml;
 	static char lmlinfo[1024];
-	int len;
 
 	i = 0;
 	switch((ulong)c->qid.path){
@@ -279,6 +297,7 @@ lmlread(Chan *c, void *va, long n, vlong voff) {
 		return devdirread(c, (char *)buf, n, lmldir, nelem(lmldir), devgen);
 	case Qctl1:
 		i++;
+		/* fall through */
 	case Qctl0:
 		if (i >= nlml)
 			error(Eio);
@@ -295,12 +314,14 @@ lmlread(Chan *c, void *va, long n, vlong voff) {
 		return n;
 	case Qjpg1:
 		i++;
+		/* fall through */
 	case Qjpg0:
 		if (i >= nlml)
 			error(Eio);
 		return jpgread(lmls+i, buf, n, off, 1);
 	case Qraw1:
 		i++;
+		/* fall through */
 	case Qraw0:
 		if (i >= nlml)
 			error(Eio);
@@ -309,8 +330,8 @@ lmlread(Chan *c, void *va, long n, vlong voff) {
 }
 
 static long
-lmlwrite(Chan *, void *, long, vlong) {
-
+lmlwrite(Chan *, void *, long, vlong)
+{
 	error(Eperm);
 	return 0;
 }
@@ -320,7 +341,7 @@ Dev lmldevtab = {
 	"video",
 
 	lmlreset,
-	devinit,	
+	devinit,
 	devshutdown,
 	lmlattach,
 	lmlwalk,
@@ -337,14 +358,15 @@ Dev lmldevtab = {
 };
 
 static void
-lmlintr(Ureg *, void *x) {
-	FrameHeader *jpgheader;
+lmlintr(Ureg *, void *x)
+{
 	ulong fstart, fno, flags, statcom;
+	FrameHeader *jpgheader;
 	LML *lml;
 
 	lml = x;
 	flags = readl(lml->pciBaseAddr+INTR_STAT);
-	// Reset all interrupts from 067
+	/* Reset all interrupts from 067 */
 	writel(0xff000000, lml->pciBaseAddr + INTR_STAT);
 
 	if(flags & INTR_JPEGREP) {
@@ -352,10 +374,10 @@ lmlintr(Ureg *, void *x) {
 		if(debug&(DBGINTR))
 			print("MjpgDrv_intrHandler stat=0x%.8lux\n", flags);
 
-		fstart = lml->jpgframeno & 0x00000003;
+		fstart = lml->jpgframeno & 3;
 		for (;;) {
 			lml->jpgframeno++;
-			fno = lml->jpgframeno & 0x00000003;
+			fno = lml->jpgframeno & 3;
 			if (lml->codedata->statCom[fno] & STAT_BIT)
 				break;
 			if (fno == fstart) {
@@ -365,12 +387,11 @@ lmlintr(Ureg *, void *x) {
 			}
 		}
 		statcom = lml->codedata->statCom[fno];
-		jpgheader = (FrameHeader *)(lml->codedata->frag[fno].hdr+2);
+		jpgheader = (FrameHeader *)(lml->codedata->frag[fno].hdr + 2);
 		jpgheader->frameNo = lml->jpgframeno;
 		jpgheader->ftime  = todget(nil);
 		jpgheader->frameSize = (statcom & 0x00ffffff) >> 1;
 		jpgheader->frameSeqNo = statcom >> 24;
 		wakeup(&lml->sleepjpg);
 	}
-	return;
 }

+ 51 - 43
sys/src/9/pc/devlml.h

@@ -1,48 +1,56 @@
-// Lml 22 driver
+/* Lml 22 driver */
 
 #define MJPG_VERSION "LML33 v0.2"
 #define NLML 2
 
-// The following values can be modified to tune/set default behaviour of the
-// driver.
+/*
+ * The following values can be modified to tune/set default behaviour of the
+ * driver.
+ */
 
-// The number of uS delay in I2C state transitions (probably >= 10)
+/* The number of uS delay in I2C state transitions (probably >= 10) */
 #define I2C_DELAY 50
 
-// The amount of spinning to do before the I2C bus is timed out
+/* The amount of spinning to do before the I2C bus is timed out */
 #define I2C_TIMEOUT 10000000
 
-// The amount of spinning to do before the guest bus is timed out
+/* The amount of spinning to do before the guest bus is timed out */
 #define GUEST_TIMEOUT 10000000
 
-// The amount of spinning to do before the polling of the still
-// transfer port is aborted.
+/*
+ * The amount of spinning to do before the polling of the still
+ * transfer port is aborted.
+ */
 #define STILL_TIMEOUT 1000000
 
-// The following number is the maximum number of cards permited. Each
-// card found is mapped to a device minor number starting from 0.
+/*
+ * The following number is the maximum number of cards permited. Each
+ * card found is mapped to a device minor number starting from 0.
+ */
 #define MAX_CARDS 1
 
-// The following are the datastructures needed by the device.
+/* The following are the datastructures needed by the device. */
 #define I2C_BUS		0x044
-// which bit of I2C_BUS is which
+/* which bit of I2C_BUS is which */
 #define I2C_SCL		1
 #define I2C_SDA		2
 #define INTR_JPEGREP	0x08000000
 #define INTR_GIRQ0	0x20000000
 #define INTR_STAT	0x03c
 
-// A Device records the properties of the various card types supported.
+/* A Device records the properties of the various card types supported. */
 typedef struct {
-	int	number;		// The H33_CARDTYPE_ assigned
-	char	*card_name;	// A string name
-	int	zr060addr;	// Which guest bus address for the ZR36060
+	int	number;		/* The H33_CARDTYPE_ assigned */
+	char	*card_name;	/* A string name */
+	int	zr060addr;	/* Which guest bus address for the ZR36060 */
 } Device;
 
-// The remainder of the #defs are constants which should not need changing.
-
-// The PCI vendor and device ids of the zoran chipset on the dc30
-// these really belong in pci.h
+/*
+ * The remainder of the #defs are constants which should not need changing.
+ *
+ * The PCI vendor and device ids of the zoran chipset on the dc30.
+ * these really belong in pci.h.
+ */
 #define VENDOR_ZORAN		0x11de
 #define ZORAN_36057		0x6057
 #define ZORAN_36067		ZORAN_36057
@@ -61,28 +69,28 @@ typedef union	Fragment		Fragment;
 typedef struct	FragmentTable		FragmentTable;
 typedef struct	CodeData		CodeData;
 
-//If we're on the little endian architecture, then 0xFF, 0xD8 byte sequence is
-#define MRK_SOI	0xD8FF
+/* If we're on a little endian architecture, then 0xFF, 0xD8 byte sequence is */
+#define MRK_SOI		0xD8FF
 #define MRK_APP3	0xE3FF
 #define APP_NAME	"LML"
 
-struct FrameHeader {	// Don't modify this struct, used by h/w
-	ushort mrkSOI;
-	ushort mrkAPP3;
-	ushort lenAPP3;
-	char nm[4];
-	ushort frameNo;
-	vlong ftime;
-	ulong frameSize;
-	ushort frameSeqNo;
-	ushort SOIfiller;
+struct FrameHeader {		/* Don't modify this struct, used by h/w */
+	ushort	mrkSOI;
+	ushort	mrkAPP3;
+	ushort	lenAPP3;
+	char	nm[4];
+	ushort	frameNo;
+	vlong	ftime;
+	ulong	frameSize;
+	ushort	frameSeqNo;
+	ushort	SOIfiller;
 };
 
 #define FRAGSIZE (128*1024)
 
 union Fragment {
-	FrameHeader	fh;
-	char		fb[FRAGSIZE];
+	FrameHeader fh;
+	char	fb[FRAGSIZE];
 };
 
 struct HdrFragment {
@@ -90,17 +98,17 @@ struct HdrFragment {
 	Fragment;
 };
 
-struct FragmentTable {	// Don't modify this struct, used by h/w
-	ulong		addr;		// Physical address
-	ulong		leng;
+struct FragmentTable {		/* Don't modify this struct, used by h/w */
+	ulong	addr;		/* Physical address */
+	ulong	leng;
 };
 
-struct CodeData {	// Don't modify this struct, used by h/w
-	ulong		pamjpg;		// Physical addr of statCom[0]
-	ulong		pagrab;		// Physical addr of grab buffer
-	ulong		statCom[4];	// Physical addresses of fragdescs
-	FragmentTable	fragdesc[4];
-	HdrFragment	frag[4];
+struct CodeData {		/* Don't modify this struct, used by h/w */
+	ulong	pamjpg;		/* Physical addr of statCom[0] */
+	ulong	pagrab;		/* Physical addr of grab buffer */
+	ulong	statCom[4];	/* Physical addresses of fragdescs */
+	FragmentTable fragdesc[4];
+	HdrFragment frag[4];
 };
 
 enum{

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

@@ -100,7 +100,7 @@ lptattach(char *spec)
 		if(ioalloc(lptbase[i-1], 3, 0, name) < 0)
 			error("lpt port space in use");
 		lptallocd[i-1] = 1;
-		// Detect ECP - if found, put into PS/2 mode to suit style of driver
+		/* Detect ECP - if found, put into PS/2 mode to suit style of driver */
 		ecr = lptbase[i-1] + 0x402;
 		if ((inb(ecr) & 3) == 1) {
 			outb(ecr, 0x34);

+ 24 - 22
sys/src/9/pc/devpccard.c

@@ -39,10 +39,10 @@ enum {
 	LegacyAddr = 0x3e0,
 	NUMEVENTS = 10,
 
-	TI1131xSC = 0x80,		// system control
-		TI122X_SC_INTRTIE	= 1 << 29,
-	TI12xxIM = 0x8c,		//
-	TI1131xCC = 0x91,		// card control
+	TI1131xSC = 0x80,		/* system control */
+		TI122X_SC_INTRTIE = 1 << 29,
+	TI12xxIM = 0x8c,		/*  */
+	TI1131xCC = 0x91,		/* card control */
 		TI113X_CC_RIENB = 1 << 7,
 		TI113X_CC_ZVENABLE = 1 << 6,
 		TI113X_CC_PCI_IRQ_ENA = 1 << 5,
@@ -50,7 +50,7 @@ enum {
 		TI113X_CC_PCI_CSC = 1 << 3,
 		TI113X_CC_SPKROUTEN = 1 << 1,
 		TI113X_CC_IFG = 1 << 0,
-	TI1131xDC = 0x92,		// device control
+	TI1131xDC = 0x92,		/* device control */
 };
 
 typedef struct Variant Variant;
@@ -559,8 +559,10 @@ devpccardlink(void)
 		cb->variant = &variant[i];
 
 		if (pci->vid != TI_vid) {
-			// Gross hack, needs a fix.  Inherit the mappings from 9load
-			// for the TIs (pb)
+			/*
+			 * Gross hack, needs a fix.  Inherit the mappings from
+			 * 9load for the TIs (pb)
+			 */
 			pcicfgw32(pci, PciCBMBR0, 0xffffffff);
 			pcicfgw32(pci, PciCBMLR0, 0);
 			pcicfgw32(pci, PciCBMBR1, 0xffffffff);
@@ -571,7 +573,7 @@ devpccardlink(void)
 			pcicfgw32(pci, PciCBILR1, 0);
 		}
 
-		// Set up PCI bus numbers if needed.
+		/* Set up PCI bus numbers if needed. */
 		if (pcicfgr8(pci, PciSBN) == 0) {
 			static int busbase = 0x20;
 
@@ -580,7 +582,7 @@ devpccardlink(void)
 			busbase += 3;
 		}
 
-		// Patch up intl if needed.
+		/* Patch up intl if needed. */
 		if ((pin = pcicfgr8(pci, PciINTP)) != 0 &&
 		    (pci->intl == 0xff || pci->intl == 0)) {
 			pci->intl = pciipin(nil, pin);
@@ -590,33 +592,33 @@ devpccardlink(void)
 				print("#Y%ld: No interrupt?\n", cb - cbslots);
 		}
 
-		// Don't you love standards!
+		/* Don't you love standards! */
 		if (pci->vid == TI_vid) {
 			if (pci->did <= TI_1131_did) {
 				uchar cc;
 
 				cc = pcicfgr8(pci, TI1131xCC);
 				cc &= ~(TI113X_CC_PCI_IRQ_ENA |
-						TI113X_CC_PCI_IREQ |
-						TI113X_CC_PCI_CSC |
-						TI113X_CC_ZVENABLE);
+					TI113X_CC_PCI_IREQ |
+					TI113X_CC_PCI_CSC |
+					TI113X_CC_ZVENABLE);
 				cc |= TI113X_CC_PCI_IRQ_ENA |
-						TI113X_CC_PCI_IREQ |
-						TI113X_CC_SPKROUTEN;
+					TI113X_CC_PCI_IREQ |
+					TI113X_CC_SPKROUTEN;
 				pcicfgw8(pci, TI1131xCC, cc);
 
-				// PCI interrupts only
+				/* PCI interrupts only */
 				pcicfgw8(pci, TI1131xDC,
-						pcicfgr8(pci, TI1131xDC) & ~6);
+					pcicfgr8(pci, TI1131xDC) & ~6);
 
-				// CSC ints to PCI bus.
+				/* CSC ints to PCI bus. */
 				wrreg(cb, Rigc, rdreg(cb, Rigc) | 0x10);
 			}
 			else if (pci->did == TI_1250_did) {
 				print("No support yet for the TI_1250_did, prod pb\n");
 			}
 			else if (pci->did == TI_1420_did) {
-				// Disable Vcc protection
+				/* Disable Vcc protection */
 				pcicfgw32(cb->pci, 0x80,
 					pcicfgr32(cb->pci, 0x80) | (1 << 21));
 			}
@@ -677,7 +679,7 @@ devpccardlink(void)
 			engine(cb, CardPowered);
 
 		/* Ack and enable interrupts on all events */
-		//cb->regs[SocketEvent] = cb->regs[SocketEvent];
+		// cb->regs[SocketEvent] = cb->regs[SocketEvent];
 		cb->regs[SocketMask] |= 0xF;
 		wrreg(cb, Rcscic, 0xC);
 	}
@@ -1017,8 +1019,8 @@ pccard_pcmspecial(char *idstr, ISAConf *isa)
 	}
 
 	if (i == nslots) {
-		//if(DEBUG)
-		//	print("#Y: %s not found\n", idstr);
+		if(0 && DEBUG)
+			print("#Y: %s not found\n", idstr);
 		return -1;
 	}
 

File diff suppressed because it is too large
+ 271 - 273
sys/src/9/pc/devtv.c


+ 4 - 4
sys/src/9/pc/ether2114x.c

@@ -975,8 +975,8 @@ typephymode(Ctlr* ctlr, uchar* block, int wait)
 	phyx = block[2];
 	ctlr->curphyad = ctlr->phy[phyx];
 
-	ctlr->csr6 = 0;//Sc|Mbo|Hbd|Ps|Ca|TrMODE|Sb;
-	//csr32w(ctlr, 6, ctlr->csr6);
+	ctlr->csr6 = 0;		/* Sc|Mbo|Hbd|Ps|Ca|TrMODE|Sb; */
+	// csr32w(ctlr, 6, ctlr->csr6);
 	if(typephylink(ctlr, block))
 		return 0;
 
@@ -997,8 +997,8 @@ typephymode(Ctlr* ctlr, uchar* block, int wait)
 	type5block(ctlr, &block[3]);
 	debug("\n");
 
-	ctlr->csr6 = 0;//Sc|Mbo|Hbd|Ps|Ca|TrMODE|Sb;
-	//csr32w(ctlr, 6, ctlr->csr6);
+	ctlr->csr6 = 0;		/* Sc|Mbo|Hbd|Ps|Ca|TrMODE|Sb; */
+	// csr32w(ctlr, 6, ctlr->csr6);
 	if(typephylink(ctlr, block))
 		return 0;
 

+ 12 - 12
sys/src/9/pc/etherdp83820.c

@@ -841,13 +841,13 @@ dp83820interrupt(Ureg*, void* arg)
 					bp->wp += cmdsts & SizeMASK;
 					etheriq(edev, bp, 1);
 				}
-				//else if(!(cmdsts & Ok)){
-				//	iprint("dp83820: rx %8.8uX:", cmdsts);
-				//	bp = desc->bp;
-				//	for(i = 0; i < 20; i++)
-				//		iprint(" %2.2uX", bp->rp[i]);
-				//	iprint("\n");
-				//}
+				else if(0 && !(cmdsts & Ok)){
+					iprint("dp83820: rx %8.8uX:", cmdsts);
+					bp = desc->bp;
+					for(i = 0; i < 20; i++)
+						iprint(" %2.2uX", bp->rp[i]);
+					iprint("\n");
+				}
 				dp83820rballoc(desc);
 
 				x = NEXT(x, ctlr->nrd);
@@ -1124,11 +1124,11 @@ dp83820reset(Ctlr* ctlr)
 	 * it hasn't?
 	 */
 #else
-	//r = csr32r(ctlr, Cfg);
-	//r &= ~(Mode1000|T64addren|Data64en|M64addren);
-	//csr32w(ctlr, Cfg, r);
-	//csr32w(ctlr, Cfg, 0x2000);
-#endif /* notdef */
+	// r = csr32r(ctlr, Cfg);
+	// r &= ~(Mode1000|T64addren|Data64en|M64addren);
+	// csr32w(ctlr, Cfg, r);
+	// csr32w(ctlr, Cfg, 0x2000);
+#endif						/* notdef */
 	ctlr->cfg = csr32r(ctlr, Cfg);
 print("cfg %8.8uX pcicfg %8.8uX\n", ctlr->cfg, pcicfgr32(ctlr->pcidev, PciPCR));
 	ctlr->cfg &= ~(T64addren|Data64en|M64addren);

+ 3 - 2
sys/src/9/pc/etherigbe.c

@@ -1763,8 +1763,9 @@ igbereset(Ctlr* ctlr)
 	 * There are 16 addresses. The first should be the MAC address.
 	 * The others are cleared and not marked valid (MS bit of Rah).
 	 */
-	if ((ctlr->id == i82546gb || ctlr->id == i82546eb) && BUSFNO(ctlr->pcidev->tbdf) == 1)
-		ctlr->eeprom[Ea+2] += 0x100;	// second interface
+	if ((ctlr->id == i82546gb || ctlr->id == i82546eb) &&
+	    BUSFNO(ctlr->pcidev->tbdf) == 1)
+		ctlr->eeprom[Ea+2] += 0x100;		/* second interface */
 	for(i = Ea; i < Eaddrlen/2; i++){
 if(i == Ea && ctlr->id == i82541gi && ctlr->eeprom[i] == 0xFFFF)
     ctlr->eeprom[i] = 0xD000;

+ 77 - 76
sys/src/9/pc/pci.c

@@ -107,7 +107,7 @@ tbdffmt(Fmt* fmt)
 
 	if((p = malloc(READSTR)) == nil)
 		return fmtstrcpy(fmt, "(tbdfconv)");
-		
+
 	switch(fmt->r){
 	case 'T':
 		tbdf = va_arg(fmt->args, int);
@@ -188,7 +188,7 @@ pcibusmap(Pcidev *root, ulong *pmema, ulong *pioa, int wrreg)
 	ioa = *pioa;
 	mema = *pmema;
 
-	DBG("pcibusmap wr=%d %T mem=%luX io=%luX\n", 
+	DBG("pcibusmap wr=%d %T mem=%luX io=%luX\n",
 		wrreg, root->tbdf, mema, ioa);
 
 	ntb = 0;
@@ -513,7 +513,7 @@ pciscan(int bno, Pcidev **list)
 	return ubn;
 }
 
-static uchar 
+static uchar
 pIIxget(Pcidev *router, uchar link)
 {
 	uchar pirq;
@@ -523,13 +523,13 @@ pIIxget(Pcidev *router, uchar link)
 	return (pirq < 16)? pirq: 0;
 }
 
-static void 
+static void
 pIIxset(Pcidev *router, uchar link, uchar irq)
 {
 	pcicfgw8(router, link, irq);
 }
 
-static uchar 
+static uchar
 viaget(Pcidev *router, uchar link)
 {
 	uchar pirq;
@@ -540,7 +540,7 @@ viaget(Pcidev *router, uchar link)
 	return (link & 1)? (pirq >> 4): (pirq & 15);
 }
 
-static void 
+static void
 viaset(Pcidev *router, uchar link, uchar irq)
 {
 	uchar pirq;
@@ -551,7 +551,7 @@ viaset(Pcidev *router, uchar link, uchar irq)
 	pcicfgw8(router, 0x55 + (link>>1), pirq);
 }
 
-static uchar 
+static uchar
 optiget(Pcidev *router, uchar link)
 {
 	uchar pirq = 0;
@@ -562,7 +562,7 @@ optiget(Pcidev *router, uchar link)
 	return (link & 0x10)? (pirq >> 4): (pirq & 15);
 }
 
-static void 
+static void
 optiset(Pcidev *router, uchar link, uchar irq)
 {
 	uchar pirq;
@@ -573,7 +573,7 @@ optiset(Pcidev *router, uchar link, uchar irq)
 	pcicfgw8(router, 0xb8 + (link >> 5), pirq);
 }
 
-static uchar 
+static uchar
 aliget(Pcidev *router, uchar link)
 {
 	/* No, you're not dreaming */
@@ -585,7 +585,7 @@ aliget(Pcidev *router, uchar link)
 	return (link & 1)? map[pirq&15]: map[pirq>>4];
 }
 
-static void 
+static void
 aliset(Pcidev *router, uchar link, uchar irq)
 {
 	/* Inverse of map in aliget */
@@ -598,7 +598,7 @@ aliset(Pcidev *router, uchar link, uchar irq)
 	pcicfgw8(router, 0x48 + ((link-1)>>1), pirq);
 }
 
-static uchar 
+static uchar
 cyrixget(Pcidev *router, uchar link)
 {
 	uchar pirq;
@@ -608,7 +608,7 @@ cyrixget(Pcidev *router, uchar link)
 	return ((link & 1)? pirq >> 4: pirq & 15);
 }
 
-static void 
+static void
 cyrixset(Pcidev *router, uchar link, uchar irq)
 {
 	uchar pirq;
@@ -625,69 +625,69 @@ struct Bridge
 	ushort	vid;
 	ushort	did;
 	uchar	(*get)(Pcidev *, uchar);
-	void	(*set)(Pcidev *, uchar, uchar);	
+	void	(*set)(Pcidev *, uchar, uchar);
 };
 
 static Bridge southbridges[] = {
-	{ 0x8086, 0x122e, pIIxget, pIIxset },	// Intel 82371FB
-	{ 0x8086, 0x1234, pIIxget, pIIxset },	// Intel 82371MX
-	{ 0x8086, 0x7000, pIIxget, pIIxset },	// Intel 82371SB
-	{ 0x8086, 0x7110, pIIxget, pIIxset },	// Intel 82371AB
-	{ 0x8086, 0x7198, pIIxget, pIIxset },	// Intel 82443MX (fn 1)
-	{ 0x8086, 0x2410, pIIxget, pIIxset },	// Intel 82801AA
-	{ 0x8086, 0x2420, pIIxget, pIIxset },	// Intel 82801AB
-	{ 0x8086, 0x2440, pIIxget, pIIxset },	// Intel 82801BA
-	{ 0x8086, 0x244c, pIIxget, pIIxset },	// Intel 82801BAM
-	{ 0x8086, 0x2480, pIIxget, pIIxset },	// Intel 82801CA
-	{ 0x8086, 0x248c, pIIxget, pIIxset },	// Intel 82801CAM
-	{ 0x8086, 0x24c0, pIIxget, pIIxset },	// Intel 82801DBL
-	{ 0x8086, 0x24cc, pIIxget, pIIxset },	// Intel 82801DBM
-	{ 0x8086, 0x24d0, pIIxget, pIIxset },	// Intel 82801EB
-	{ 0x8086, 0x2640, pIIxget, pIIxset },	// Intel 82801FB
-	{ 0x8086, 0x27b8, pIIxget, pIIxset },	// Intel 82801GB
-	{ 0x8086, 0x27b9, pIIxget, pIIxset },	// Intel 82801GBM
-	{ 0x1106, 0x0586, viaget, viaset },	// Viatech 82C586
-	{ 0x1106, 0x0596, viaget, viaset },	// Viatech 82C596
-	{ 0x1106, 0x0686, viaget, viaset },	// Viatech 82C686
-	{ 0x1106, 0x3227, viaget, viaset },	// Viatech VT8237
-	{ 0x1045, 0xc700, optiget, optiset },	// Opti 82C700
-	{ 0x10b9, 0x1533, aliget, aliset },	// Al M1533
-	{ 0x1039, 0x0008, pIIxget, pIIxset },	// SI 503
-	{ 0x1039, 0x0496, pIIxget, pIIxset },	// SI 496
-	{ 0x1078, 0x0100, cyrixget, cyrixset },	// Cyrix 5530 Legacy
-
-	{ 0x1022, 0x746B, nil, nil },		// AMD 8111
-	{ 0x10DE, 0x00D1, nil, nil },		// NVIDIA nForce 3
-	{ 0x1166, 0x0200, nil, nil },		// ServerWorks ServerSet III LE
-	{ 0x1002, 0x4377, nil, nil },		// ATI Radeon Xpress 200M
-	{ 0x1002, 0x4372, nil, nil },		// ATI SB400
+	{ 0x8086, 0x122e, pIIxget, pIIxset },	/* Intel 82371FB */
+	{ 0x8086, 0x1234, pIIxget, pIIxset },	/* Intel 82371MX */
+	{ 0x8086, 0x7000, pIIxget, pIIxset },	/* Intel 82371SB */
+	{ 0x8086, 0x7110, pIIxget, pIIxset },	/* Intel 82371AB */
+	{ 0x8086, 0x7198, pIIxget, pIIxset },	/* Intel 82443MX (fn 1) */
+	{ 0x8086, 0x2410, pIIxget, pIIxset },	/* Intel 82801AA */
+	{ 0x8086, 0x2420, pIIxget, pIIxset },	/* Intel 82801AB */
+	{ 0x8086, 0x2440, pIIxget, pIIxset },	/* Intel 82801BA */
+	{ 0x8086, 0x244c, pIIxget, pIIxset },	/* Intel 82801BAM */
+	{ 0x8086, 0x2480, pIIxget, pIIxset },	/* Intel 82801CA */
+	{ 0x8086, 0x248c, pIIxget, pIIxset },	/* Intel 82801CAM */
+	{ 0x8086, 0x24c0, pIIxget, pIIxset },	/* Intel 82801DBL */
+	{ 0x8086, 0x24cc, pIIxget, pIIxset },	/* Intel 82801DBM */
+	{ 0x8086, 0x24d0, pIIxget, pIIxset },	/* Intel 82801EB */
+	{ 0x8086, 0x2640, pIIxget, pIIxset },	/* Intel 82801FB */
+	{ 0x8086, 0x27b8, pIIxget, pIIxset },	/* Intel 82801GB */
+	{ 0x8086, 0x27b9, pIIxget, pIIxset },	/* Intel 82801GBM */
+	{ 0x1106, 0x0586, viaget, viaset },	/* Viatech 82C586 */
+	{ 0x1106, 0x0596, viaget, viaset },	/* Viatech 82C596 */
+	{ 0x1106, 0x0686, viaget, viaset },	/* Viatech 82C686 */
+	{ 0x1106, 0x3227, viaget, viaset },	/* Viatech VT8237 */
+	{ 0x1045, 0xc700, optiget, optiset },	/* Opti 82C700 */
+	{ 0x10b9, 0x1533, aliget, aliset },	/* Al M1533 */
+	{ 0x1039, 0x0008, pIIxget, pIIxset },	/* SI 503 */
+	{ 0x1039, 0x0496, pIIxget, pIIxset },	/* SI 496 */
+	{ 0x1078, 0x0100, cyrixget, cyrixset },	/* Cyrix 5530 Legacy */
+
+	{ 0x1022, 0x746B, nil, nil },		/* AMD 8111 */
+	{ 0x10DE, 0x00D1, nil, nil },		/* NVIDIA nForce 3 */
+	{ 0x1166, 0x0200, nil, nil },		/* ServerWorks ServerSet III LE */
+	{ 0x1002, 0x4377, nil, nil },		/* ATI Radeon Xpress 200M */
+	{ 0x1002, 0x4372, nil, nil },		/* ATI SB400 */
 };
 
 typedef struct Slot Slot;
 struct Slot {
-	uchar	bus;			// Pci bus number
-	uchar	dev;			// Pci device number
-	uchar	maps[12];		// Avoid structs!  Link and mask.
-	uchar	slot;			// Add-in/built-in slot
+	uchar	bus;		/* Pci bus number */
+	uchar	dev;		/* Pci device number */
+	uchar	maps[12];	/* Avoid structs!  Link and mask. */
+	uchar	slot;		/* Add-in/built-in slot */
 	uchar	reserved;
 };
 
 typedef struct Router Router;
 struct Router {
-	uchar	signature[4];		// Routing table signature
-	uchar	version[2];		// Version number
-	uchar	size[2];		// Total table size
-	uchar	bus;			// Interrupt router bus number
-	uchar	devfn;			// Router's devfunc
-	uchar	pciirqs[2];		// Exclusive PCI irqs
-	uchar	compat[4];		// Compatible PCI interrupt router
-	uchar	miniport[4];		// Miniport data
+	uchar	signature[4];	/* Routing table signature */
+	uchar	version[2];	/* Version number */
+	uchar	size[2];	/* Total table size */
+	uchar	bus;		/* Interrupt router bus number */
+	uchar	devfn;		/* Router's devfunc */
+	uchar	pciirqs[2];	/* Exclusive PCI irqs */
+	uchar	compat[4];	/* Compatible PCI interrupt router */
+	uchar	miniport[4];	/* Miniport data */
 	uchar	reserved[11];
 	uchar	checksum;
 };
 
-static ushort pciirqs;			// Exclusive PCI irqs
-static Bridge *southbridge;		// Which southbridge to use.
+static ushort pciirqs;		/* Exclusive PCI irqs */
+static Bridge *southbridge;	/* Which southbridge to use. */
 
 static void
 pcirouting(void)
@@ -698,7 +698,7 @@ pcirouting(void)
 	Pcidev *sbpci, *pci;
 	uchar *p, pin, irq, link, *map;
 
-	// Search for PCI interrupt routing table in BIOS
+	/* Search for PCI interrupt routing table in BIOS */
 	for(p = (uchar *)KADDR(0xf0000); p < (uchar *)KADDR(0xfffff); p += 16)
 		if(p[0] == '$' && p[1] == 'P' && p[2] == 'I' && p[3] == 'R')
 			break;
@@ -709,7 +709,7 @@ pcirouting(void)
 	r = (Router *)p;
 
 	// print("PCI interrupt routing table version %d.%d at %.6uX\n",
-	// 	r->version[0], r->version[1], (ulong)r & 0xfffff);
+	//	r->version[0], r->version[1], (ulong)r & 0xfffff);
 
 	tbdf = (BusPCI << 24)|(r->bus << 16)|(r->devfn << 8);
 	sbpci = pcimatchtbdf(tbdf);
@@ -734,21 +734,22 @@ pcirouting(void)
 
 	size = (r->size[1] << 8)|r->size[0];
 	for(e = (Slot *)&r[1]; (uchar *)e < p + size; e++) {
-		// print("%.2uX/%.2uX %.2uX: ", e->bus, e->dev, e->slot);
-		// for (i = 0; i != 4; i++) {
-		// 	uchar *m = &e->maps[i * 3];
-		// 	print("[%d] %.2uX %.4uX ",
-		// 		i, m[0], (m[2] << 8)|m[1]);
-		// }
-		// print("\n");
-
+		if (0) {
+			print("%.2uX/%.2uX %.2uX: ", e->bus, e->dev, e->slot);
+			for (i = 0; i != 4; i++) {
+				uchar *m = &e->maps[i * 3];
+				print("[%d] %.2uX %.4uX ",
+					i, m[0], (m[2] << 8)|m[1]);
+			}
+			print("\n");
+		}
 		for(fn = 0; fn != 8; fn++) {
 			tbdf = (BusPCI << 24)|(e->bus << 16)|((e->dev | fn) << 8);
 			pci = pcimatchtbdf(tbdf);
 			if(pci == nil)
 				continue;
 			pin = pcicfgr8(pci, PciINTP);
-			if(pin == 0 || pin == 0xff) 
+			if(pin == 0 || pin == 0xff)
 				continue;
 
 			map = &e->maps[(pin - 1) * 3];
@@ -940,7 +941,7 @@ pcicfginit(void)
 			outb(PciCSE, n);
 		}
 	}
-	
+
 	if(pcicfgmode < 0 || pcibios) {
 		if((pcibiossi = pcibiosinit()) == nil)
 			goto out;
@@ -976,7 +977,7 @@ pcicfginit(void)
 
 			/*
 			  * If we have found a PCI-to-Cardbus bridge, make sure
-			  * it has no valid mappings anymore.  
+			  * it has no valid mappings anymore.
 			  */
 			for(pci = pciroot; pci != nil; pci = pci->link){
 				if (pci->ccrb == 6 && pci->ccru == 7) {
@@ -999,7 +1000,7 @@ pcicfginit(void)
 		 * Work out how big the top bus is
 		 */
 		pcibussize(pciroot, &mema, &ioa);
-	
+
 		/*
 		 * Align the windows and map it
 		 */
@@ -1010,7 +1011,7 @@ pcicfginit(void)
 
 		pcibusmap(pciroot, &mema, &ioa, 1);
 		DBG("Sizes2: mem=%lux io=%lux\n", mema, ioa);
-	
+
 		unlock(&pcicfginitlock);
 		return;
 	}
@@ -1031,7 +1032,7 @@ pcireservemem(void)
 {
 	int i;
 	Pcidev *p;
-	
+
 	/*
 	 * mark all the physical address space claimed by pci devices
 	 * as in use, so that upaalloc doesn't give it out.
@@ -1301,7 +1302,7 @@ pcilhinv(Pcidev* p)
 		if(p->bridge != nil)
 			pcilhinv(p->bridge);
 		p = p->link;
-	}	
+	}
 }
 
 void

+ 52 - 52
sys/src/9/pc/piix4smbus.c

@@ -5,56 +5,56 @@
 #include	"fns.h"
 #include	"io.h"
 
-//
-//	SMBus support for the PIIX4
-//
+/*
+ *	SMBus support for the PIIX4
+ */
 enum
 {
 	IntelVendID=	0x8086,
 	Piix4PMID=	0x7113,		/* PIIX4 power management function */
 
-	// SMBus configuration registers (function 3)
-	SMBbase=	0x90,		// 4 byte base address (bit 0 == 1, bit 3:1 == 0)
+	/* SMBus configuration registers (function 3) */
+	SMBbase=	0x90, /* 4 byte base address (bit 0 == 1, bit 3:1 == 0) */
 	SMBconfig=	0xd2,
 	SMBintrselect=	(7<<1),
-	SMIenable=	(0<<1),		//  interrupts sent to SMI#
-	IRQ9enable=	(4<<1),		//  intettupts sent to IRQ9
-	SMBenable=	(1<<0),		//  1 enables
-
-	// SMBus IO space registers
-	Hoststatus=	0x0,		//  (writing 1 bits reset the interrupt bits)
-	Failed=		(1<<4),	 	//  transaction terminated by KILL
-	Bus_error=	(1<<3),		//  transactio collision
-	Dev_error=	(1<<2),		//  device error interrupt
-	Host_complete=	(1<<1),		//  host command completion interrupt 
-	Host_busy=	(1<<0),		//
-	Slavestatus=	0x1,		//  (writing 1 bits reset)
-	Alert_sts=	(1<<5),		//  someone asserted SMBALERT#
-	Shdw2_sts=	(1<<4),		//  slave accessed shadow 2 port
-	Shdw1_sts=	(1<<3),		//  slave accessed shadow 1 port
-	Slv_sts=	(1<<2),		//  slave accessed shadow 1 port
+	SMIenable=	(0<<1),		/* interrupts sent to SMI# */
+	IRQ9enable=	(4<<1),		/* interrupts sent to IRQ9 */
+	SMBenable=	(1<<0),		/* 1 enables */
+
+	/* SMBus IO space registers */
+	Hoststatus=	0x0,	/* (writing 1 bits reset the interrupt bits) */
+	Failed=		(1<<4),		/* transaction terminated by KILL */
+	Bus_error=	(1<<3),		/* transaction collision */
+	Dev_error=	(1<<2),		/* device error interrupt */
+	Host_complete=	(1<<1),		/* host command completion interrupt */
+	Host_busy=	(1<<0),		/*  */
+	Slavestatus=	0x1,	/* (writing 1 bits reset) */
+	Alert_sts=	(1<<5),		/* someone asserted SMBALERT# */
+	Shdw2_sts=	(1<<4),		/* slave accessed shadow 2 port */
+	Shdw1_sts=	(1<<3),		/* slave accessed shadow 1 port */
+	Slv_sts=	(1<<2),		/* slave accessed shadow 1 port */
 	Slv_bsy=	(1<<0),
 	Hostcontrol=	0x2,
-	Start=		(1<<6),		//  start execution
-	Cmd_prot=	(7<<2),		//  command protocol mask
-	Quick=		(0<<2),		//   address only
-	Byte=		(1<<2),		//   address + cmd
-	ByteData=	(2<<2),		//   address + cmd + data
-	WordData=	(3<<2),		//   address + cmd + data + data
-	Kill=		(1<<1),		//  abort in progress command
-	Ienable=	(1<<0),		//  enable completion interrupts
+	Start=		(1<<6),		/* start execution */
+	Cmd_prot=	(7<<2),		/* command protocol mask */
+	Quick=		(0<<2),		/*  address only */
+	Byte=		(1<<2),		/*  address + cmd */
+	ByteData=	(2<<2),		/*  address + cmd + data */
+	WordData=	(3<<2),		/*  address + cmd + data + data */
+	Kill=		(1<<1),		/* abort in progress command */
+	Ienable=	(1<<0),		/* enable completion interrupts */
 	Hostcommand=	0x3,
 	Hostaddress=	0x4,
-	AddressMask=	(0x7f<<1),	//  target address
-	Read=		(1<<0),		//  1 == read, 0 == write
+	AddressMask=	(0x7f<<1),	/* target address */
+	Read=		(1<<0),		/* 1 == read, 0 == write */
 	Hostdata0=	0x5,
 	Hostdata1=	0x6,
 	Blockdata=	0x7,
 	Slavecontrol=	0x8,
-	Alert_en=	(1<<3),		//  enable inter on SMBALERT#
-	Shdw2_en=	(1<<2),		//  enable inter on external shadow 2 access
-	Shdw1_en=	(1<<1),		//  enable inter on external shadow 1 access
-	Slv_en=		(1<<0),		//  enable inter on access of host ctlr slave port
+	Alert_en=	(1<<3),	/* enable inter on SMBALERT# */
+	Shdw2_en=	(1<<2),	/* enable inter on external shadow 2 access */
+	Shdw1_en=	(1<<1),	/* enable inter on external shadow 1 access */
+	Slv_en=		(1<<0),	/* enable inter on access of host ctlr slave port */
 	Shadowcommand=	0x9,
 	Slaveevent=	0xa,
 	Slavedata=	0xc,
@@ -92,14 +92,14 @@ transact(SMBus *s, int type, int addr, int cmd, uchar *data)
 	}
 	qlock(s);
 
-	// wait a while for the host interface to be available
+	/* wait a while for the host interface to be available */
 	for(tries = 0; tries < 1000000; tries++){
 		if((inb(s->base+Hoststatus) & Host_busy) == 0)
 			break;
 		sched();
 	}
 	if(tries >= 1000000){
-		// try aborting current transaction
+		/* try aborting current transaction */
 		outb(s->base+Hostcontrol, Kill);
 		for(tries = 0; tries < 1000000; tries++){
 			if((inb(s->base+Hoststatus) & Host_busy) == 0)
@@ -112,7 +112,7 @@ transact(SMBus *s, int type, int addr, int cmd, uchar *data)
 		}
 	}
 
-	// set up for transaction
+	/* set up for transaction */
 	outb(s->base+Hostaddress, (addr<<1)|proto[type].rw);
 	if(proto[type].cmd)
 		outb(s->base+Hostcommand, cmd);
@@ -120,19 +120,19 @@ transact(SMBus *s, int type, int addr, int cmd, uchar *data)
 		switch(proto[type].len){
 		case 2:
 			outb(s->base+Hostdata1, data[1]);
-			// fall through
+			/* fall through */
 		case 1:
 			outb(s->base+Hostdata0, data[0]);
 			break;
 		}
 	}
-	 
 
-	// reset the completion/error bits and start transaction
+
+	/* reset the completion/error bits and start transaction */
 	outb(s->base+Hoststatus, Failed|Bus_error|Dev_error|Host_complete);
 	outb(s->base+Hostcontrol, Start|proto[type].proto);
 
-	// wait for completion
+	/* wait for completion */
 	status = 0;
 	for(tries = 0; tries < 1000000; tries++){
 		status = inb(s->base+Hoststatus);
@@ -145,12 +145,12 @@ transact(SMBus *s, int type, int addr, int cmd, uchar *data)
 		error(err);
 	}
 
-	// get results
+	/* get results */
 	if(proto[type].rw == Read){
 		switch(proto[type].len){
 		case 2:
 			data[1] = inb(s->base+Hostdata1);
-			// fall through
+			/* fall through */
 		case 1:
 			data[0] = inb(s->base+Hostdata0);
 			break;
@@ -165,9 +165,9 @@ static SMBus smbusproto =
 	.transact = transact,
 };
 
-//
-//  return 0 if this is a piix4 with an smbus interface
-//
+/*
+ *  return 0 if this is a piix4 with an smbus interface
+ */
 SMBus*
 piix4smbus(void)
 {
@@ -181,14 +181,14 @@ piix4smbus(void)
 	if(p == nil)
 		return nil;
 
-	s = smalloc(sizeof(*s));	
+	s = smalloc(sizeof(*s));
 	memmove(s, &smbusproto, sizeof(*s));
 	s->arg = p;
 
-	// disable the smbus
+	/* disable the smbus */
 	pcicfgw8(p, SMBconfig, IRQ9enable|0);
 
-	// see if bios gave us a viable port space
+	/* see if bios gave us a viable port space */
 	s->base = pcicfgr32(p, SMBbase) & ~1;
 print("SMB base from bios is 0x%lux\n", s->base);
 	if(ioalloc(s->base, 0xd, 0, "piix4smbus") < 0){
@@ -202,11 +202,11 @@ print("SMB base ialloc is 0x%lux\n", s->base);
 		pcicfgw32(p, SMBbase, s->base|1);
 	}
 
-	// disable SMBus interrupts, abort any transaction in progress
+	/* disable SMBus interrupts, abort any transaction in progress */
 	outb(s->base+Hostcontrol, Kill);
 	outb(s->base+Slavecontrol, 0);
 
-	// enable the smbus
+	/* enable the smbus */
 	pcicfgw8(p, SMBconfig, IRQ9enable|SMBenable);
 
 	return s;

+ 3 - 3
sys/src/9/pc/sd63xxesb.c

@@ -936,9 +936,9 @@ updatedrive(Drive *d)
 		}
 		pr = 0;
 	}
-//	if(p->task & 1 && last != cause)
-//		dprint("err ca %ux serr %ux task %ux sstat %ux\n",
-//			cause, serr, p->task, p->sstatus);
+	if(0 && p->task & 1 && last != cause)
+		dprint("err ca %ux serr %ux task %ux sstat %ux\n",
+			cause, serr, p->task, p->sstatus);
 
 	if(pr)
 		dprint("%s: upd %ux ta %ux\n", name, cause, p->task);

+ 53 - 49
sys/src/9/pc/sdmv50xx.c

@@ -8,7 +8,7 @@
  * version (from The Labs) of a driver written by Coraid, Inc.
  * The original copyright notice appears at the end of this file.
  */
- 
+
 #include "u.h"
 #include "../port/lib.h"
 #include "mem.h"
@@ -25,7 +25,7 @@
 
 enum{
 	NCtlr		= 4,
-	NCtlrdrv		= 8,
+	NCtlrdrv	= 8,
 	NDrive		= NCtlr*NCtlrdrv,
 
 	Read 		= 0,
@@ -53,13 +53,13 @@ enum {
 	ATAbusy 	= (1<<7),
 	ATAabort	= (1<<2),
 	ATAobs		= (1<<1 | 1<<2 | 1<<4),
-	ATAeIEN	= (1<<1),
+	ATAeIEN		= (1<<1),
 	ATAsrst		= (1<<2),
 	ATAhob		= (1<<7),
 	ATAbad		= (ATAbusy|ATAdf|ATAdrq|ATAerr),
 
 	SFdone 		= (1<<0),
-	SFerror 		= (1<<1),
+	SFerror 	= (1<<1),
 
 	SRBident 	= 0,
 	SRBread,
@@ -70,7 +70,7 @@ enum {
 	SRBdatain,
 	SRBdataout,
 
-	RQread		= 1,			/* data coming IN from device */
+	RQread		= 1,		/* data coming IN from device */
 
 	PRDeot		= (1<<15),
 
@@ -79,17 +79,17 @@ enum {
 	ePrtDataErr	= (1<<0),
 	ePrtPRDErr	= (1<<1),
 	eDevErr		= (1<<2),
-	eDevDis		= (1<<3),	
-	eDevCon	= (1<<4),
+	eDevDis		= (1<<3),
+	eDevCon		= (1<<4),
 	eOverrun	= (1<<5),
 	eUnderrun	= (1<<6),
-	eSelfDis		= (1<<8),
+	eSelfDis	= (1<<8),
 	ePrtCRQBErr	= (1<<9),
 	ePrtCRPBErr	= (1<<10),
 	ePrtIntErr	= (1<<11),
 	eIORdyErr	= (1<<12),
 
-	// flags for sata 2 version
+	/* flags for sata 2 version */
 	eSelfDis2	= (1<<7),
 	SerrInt		= (1<<5),
 
@@ -97,7 +97,7 @@ enum {
 
 	eEnEDMA	= (1<<0),
 	eDsEDMA 	= (1<<1),
-	eAtaRst 		= (1<<2),
+	eAtaRst 	= (1<<2),
 
 	/* Interrupt mask for errors we care about */
 	IEM		= (eDevDis | eDevCon | eSelfDis),
@@ -119,7 +119,7 @@ enum {
 	Dedma		= (1<<3),	/* device in edma mode */
 	Dpiowant	= (1<<4),	/* some wants to use the pio mode */
 
-	// phyerrata magic crap
+	/* phyerrata magic crap */
 	Mpreamp	= 0x7e0,
 	Dpreamp	= 0x720,
 
@@ -150,8 +150,10 @@ typedef struct Rx Rx;
 typedef struct Srb Srb;
 typedef struct Tx Tx;
 
-// there are 4 drives per chip.  thus an 8-port
-// card has two chips.
+/*
+ * there are 4 drives per chip.  thus an 8-port
+ * card has two chips.
+ */
 struct Chip
 {
 	Arb	*arb;
@@ -182,10 +184,10 @@ struct Drive
 	int	state;
 	int	flag;
 	uvlong	sectors;
-	ulong	pm2;		// phymode 2 init state
-	ulong	intick;		// check for hung westerdigital drives.
+	ulong	pm2;		/* phymode 2 init state */
+	ulong	intick;		/* check for hung western digital drives. */
 	int	wait;
-	int	mode;		// DMautoneg, satai or sataii.
+	int	mode;		/* DMautoneg, satai or sataii. */
 
 	char	serial[20+1];
 	char	firmware[8+1];
@@ -201,7 +203,7 @@ struct Drive
 
 	Srb	*srbhead;
 	Srb	*srbtail;
-	int	driveno;		// ctlr*NCtlrdrv + unit
+	int	driveno;	/* ctlr*NCtlrdrv + unit */
 };
 
 struct Ctlr
@@ -264,7 +266,7 @@ struct Bridge			/* memory-mapped per-Drive registers */
 	char	fill2[0x34];
 	ulong	phymode;
 	char	fill3[0x88];
-};				// most be 0x100 hex in length
+};				/* length must be 0x100 */
 
 struct Arb			/* memory-mapped per-Chip registers */
 {
@@ -385,7 +387,7 @@ idmove(char *p, ushort *a, int n)
 {
 	char *op;
 	int i;
-	
+
 	op = p;
 	for(i=0; i<n/2; i++){
 		*p++ = a[i]>>8;
@@ -398,7 +400,7 @@ idmove(char *p, ushort *a, int n)
 /*
  * Request buffers.
  */
-struct 
+struct
 {
 	Lock;
 	Srb *freechain;
@@ -409,7 +411,7 @@ static Srb*
 allocsrb(void)
 {
 	Srb *p;
-	
+
 	ilock(&srblist);
 	if((p = srblist.freechain) == nil){
 		srblist.nalloc++;
@@ -447,7 +449,7 @@ satawait(uchar *p, uchar mask, uchar v, int ms)
 /*
  * Drive initialization
  */
-// unmask in the pci registers err done
+/* unmask in the pci registers err done */
 static void
 unmask(ulong *mmio, int port, int coal)
 {
@@ -556,13 +558,15 @@ resetdisk(Drive *d)
 	d->sectors = 0;
 	d->unit->sectors = 0;
 	if (d->ctlr->type == 2) {
-		// without bit 8 we can boot without disks, but
-		// inserted disks will never appear.  :-X
+		/*
+		 * without bit 8 we can boot without disks, but
+		 * inserted disks will never appear.  :-X
+		 */
 		n = d->edma->sataconfig;
 		n &= 0xff;
 		n |= 0x9b1100;
 		d->edma->sataconfig = n;
-		n = d->edma->sataconfig;	//flush
+		n = d->edma->sataconfig;	/* flush */
 		USED(n);
 	}
 	d->edma->ctl = eDsEDMA;
@@ -840,7 +844,7 @@ iecdecode(ulong cause)
 }
 
 enum{
-	Cerror	= ePrtDataErr|ePrtPRDErr|eDevErr|eSelfDis2|ePrtCRPBErr|ePrtIntErr,
+	Cerror = ePrtDataErr|ePrtPRDErr|eDevErr|eSelfDis2|ePrtCRPBErr|ePrtIntErr,
 };
 
 static void
@@ -853,7 +857,7 @@ updatedrive(Drive *d)
 
 	edma = d->edma;
 	if((edma->ctl&eEnEDMA) == 0){
-		// FEr SATA#4 40xx
+		/* FEr SATA#4 40xx */
 		x = d->edma->cmdstat;
 		USED(x);
 	}
@@ -1016,7 +1020,7 @@ completesrb(Drive *d)
 		}
 	}
 }
-			
+
 static int
 srbdone(void *v)
 {
@@ -1045,7 +1049,7 @@ mv50interrupt(Ureg*, void *a)
 		if(cause & (3<<(i*2+i/4))){
 			drive = &ctlr->drive[i];
 			if(drive->edma == 0)
-				continue;	// not ready yet.
+				continue;	/* not ready yet. */
 			ilock(drive);
 			updatedrive(drive);
 			while(ctlr->chip[i/4].arb->ic & (0x0101 << (i%4))){
@@ -1090,7 +1094,7 @@ checkdrive(Drive *d, int i)
 		dprint("%s: status: %08lx -> %08lx: %s\n", name, olds[i], s, diskstates[d->state]);
 		olds[i] = s;
 	}
-	// westerndigitalhung(d);
+	/* westerndigitalhung(d); */
 	switch(d->state){
 	case Dnew:
 	case Dmissing:
@@ -1119,7 +1123,7 @@ checkdrive(Drive *d, int i)
 	case Dready:
 		if(s != 0)
 			break;
-		iprint("%s: pulled: st=%08ulx\n", name, s); // never happens
+		iprint("%s: pulled: st=%08ulx\n", name, s);	/* never happens */
 	case Dreset:
 	case Derror:
 		dprint("%s reset: mode %d\n", name, d->mode);
@@ -1207,7 +1211,7 @@ mv50pnp(void)
 		}
 		ctlr->rid = p->rid;
 
-		// avert thine eyes!  (what does this do?)
+		/* avert thine eyes!  (what does this do?) */
 		mem[0x104f0/4] = 0;
 		ctlr->type = (p->did >> 12) & 3;
 		if(ctlr->type == 1){
@@ -1348,12 +1352,12 @@ mv50verify(SDunit *unit)
 
 	/*
 	 * If ctlr->type == 1, then the drives spin up whenever
-	 * the controller feels like it; if ctlr->type != 1, then 
+	 * the controller feels like it; if ctlr->type != 1, then
 	 * they spin up as a result of configdrive.
-	 * 
+	 *
 	 * If there is a drive in the slot, give it 1.5s to spin up
 	 * before returning.  There is a noticeable drag on the
-	 * power supply when spinning up fifteen drives 
+	 * power supply when spinning up fifteen drives
 	 * all at once (like in the Coraid enclosures).
 	 */
 	if(ctlr->type != 1 && i == 0){
@@ -1476,9 +1480,9 @@ static char*
 rdregs(char *p, char *e, void *base, Regs *r, int n, char *prefix)
 {
 	int i;
-	
+
 	for(i=0; i<n; i++)
-		p = seprint(p, e, "%s%s%-19s %.8ux\n", 
+		p = seprint(p, e, "%s%s%-19s %.8ux\n",
 			prefix ? prefix : "", prefix ? ": " : "",
 			r[i].name, *(u32int*)((uchar*)base+r[i].offset));
 	return p;
@@ -1505,11 +1509,11 @@ mv50rctl(SDunit *unit, char *p, int l)
 	char *e, *op;
 	Ctlr *ctlr;
 	Drive *drive;
-	
+
 	if((ctlr = unit->dev->ctlr) == nil)
 		return 0;
 	drive = &ctlr->drive[unit->subno];
-	
+
 	e = p+l;
 	op = p;
 	if(drive->state == Dready){
@@ -1520,7 +1524,7 @@ mv50rctl(SDunit *unit, char *p, int l)
 		p = seprint(p, e, "no disk present\n");
 	p = seprint(p, e, "geometry %llud 512\n", drive->sectors);
 	p = rdinfo(p, e, drive->info);
-	
+
 	p = rdregs(p, e, drive->chip->arb, regsarb, nelem(regsarb), nil);
 	p = rdregs(p, e, drive->bridge, regsbridge, nelem(regsbridge), nil);
 	p = rdregs(p, e, drive->edma, regsedma, nelem(regsedma), nil);
@@ -1533,7 +1537,7 @@ mv50wctl(SDunit *unit, Cmdbuf *cb)
 {
 	Ctlr *ctlr;
 	Drive *drive;
-	
+
 	USED(unit);
 	if(strcmp(cb->f[0], "reset") == 0){
 		ctlr = unit->dev->ctlr;
@@ -1552,7 +1556,7 @@ mv50rtopctl(SDev *sdev, char *p, char *e)
 {
 	char name[10];
 	Ctlr *ctlr;
-	
+
 	ctlr = sdev->ctlr;
 	if(ctlr == nil)
 		return p;
@@ -1563,7 +1567,7 @@ mv50rtopctl(SDev *sdev, char *p, char *e)
 	p = rdregs(p, e, ctlr->chip[0].arb, regsarb, nelem(regsarb), name);
 	p = rdregs(p, e, &ctlr->chip[0].arb->bridge[0], regsbridge, nelem(regsbridge), name);
 	p = rdregs(p, e, &ctlr->chip[0].edma[0], regsedma, nelem(regsedma), name);
-	
+
 	return p;
 }
 
@@ -1680,7 +1684,7 @@ retry:
 		freesrb(srb);
 		if(flag == 0){
 	tryagain:		if(++try == 10){
-				print("%s: bad disk\n", drive->unit->name); 
+				print("%s: bad disk\n", drive->unit->name);
 				return SDeio;
 			}
 			dprint("%s: retry\n", drive->unit->name);
@@ -1723,7 +1727,7 @@ SDifc sdmv50xxifc = {
 };
 
 /*
- * The original driver on which this one is based came with the 
+ * The original driver on which this one is based came with the
  * following notice:
  *
  * Copyright 2005
@@ -1732,19 +1736,19 @@ SDifc sdmv50xxifc = {
  * This software is provided `as-is,' without any express or implied
  * warranty.  In no event will the author be held liable for any damages
  * arising from the use of this software.
- * 
+ *
  * Permission is granted to anyone to use this software for any purpose,
  * including commercial applications, and to alter it and redistribute it
  * freely, subject to the following restrictions:
- * 
+ *
  * 1.  The origin of this software must not be misrepresented; you must
  * not claim that you wrote the original software.  If you use this
  * software in a product, an acknowledgment in the product documentation
  * would be appreciated but is not required.
- * 
+ *
  * 2.  Altered source versions must be plainly marked as such, and must
  * not be misrepresented as being the original software.
- * 
+ *
  * 3.  This notice may not be removed or altered from any source
  * distribution.
  */

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

@@ -282,7 +282,7 @@ intrtime(Mach*, int vno)
 	if(up == nil && m->perf.inidle > diff)
 		m->perf.inidle -= diff;
 
-	diff /= m->cpumhz*100;	// quantum = 100µsec
+	diff /= m->cpumhz*100;		/* quantum = 100µsec */
 	if(diff >= Ntimevec)
 		diff = Ntimevec-1;
 	intrtimes[vno][diff]++;

+ 6 - 5
sys/src/9/pc/usbuhci.c

<
@@ -51,7 +51,7 @@ enum
 	StatusChange =	1<<1,	/* write 1 to clear */
 	DevicePresent =	1<<0,