Browse Source

Plan 9 from Bell Labs 2005-02-24

David du Colombier 16 years ago
parent
commit
7209a4f3aa

+ 27 - 53
dist/replica/_plan9.db

@@ -3,19 +3,19 @@
 386/9loaddebug - 775 sys sys 1108268393 306473
 386/9loadlite - 775 sys sys 1100269949 132260
 386/9loadlitedebug - 775 sys sys 1108268393 195556
-386/9pc - 775 sys sys 1108563823 1833118
+386/9pc - 775 sys sys 1109132016 1833270
 386/9pc.gz - 664 sys sys 1077049336 635727
-386/9pccpu - 775 sys sys 1108563827 1487669
+386/9pccpu - 775 sys sys 1109132020 1487821
 386/9pccpu.gz - 664 sys sys 1077049387 519909
-386/9pcdisk - 775 sys sys 1108563831 2038820
+386/9pcdisk - 775 sys sys 1109132025 2038972
 386/9pcdisk.gz - 664 sys sys 1040006345 703136
-386/9pcf - 775 sys sys 1108563837 2381652
+386/9pcf - 775 sys sys 1109132030 2381804
 386/9pcf.gz - 664 sys sys 1077049490 872650
 386/9pxeload - 775 sys sys 1108397372 213184
 386/_9pcdisk.gz - 664 sys sys 1039764191 695837
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1108285260 115096
-386/bin/8c - 775 sys sys 1108440451 357989
+386/bin/8c - 775 sys sys 1109202878 358000
 386/bin/8l - 775 sys sys 1107835553 115728
 386/bin/9660srv - 775 sys sys 1108354539 103973
 386/bin/aan - 775 sys sys 1108354539 130710
@@ -260,7 +260,7 @@
 386/bin/gview - 775 sys sys 1106799175 237200
 386/bin/gzip - 775 sys sys 1104122017 84762
 386/bin/hayes - 775 sys sys 1104122017 64556
-386/bin/hget - 775 sys sys 1104122018 232415
+386/bin/hget - 775 sys sys 1109132002 231848
 386/bin/history - 775 sys sys 1104122018 74931
 386/bin/hoc - 775 sys sys 1104122018 99875
 386/bin/html2ms - 775 sys sys 1104122018 66095
@@ -279,7 +279,7 @@
 386/bin/ip/gping - 775 sys sys 1106799176 182010
 386/bin/ip/hogports - 775 sys sys 1104122022 42883
 386/bin/ip/httpd - 20000000775 sys sys 1016920846 0
-386/bin/ip/httpd/httpd - 775 sys sys 1108960007 290886
+386/bin/ip/httpd/httpd - 775 sys sys 1109132003 290319
 386/bin/ip/httpd/imagemap - 775 sys sys 1104122023 114785
 386/bin/ip/httpd/man2html - 775 sys sys 1104122024 123072
 386/bin/ip/httpd/netlib_find - 775 sys sys 1104122024 115630
@@ -415,8 +415,8 @@
 386/bin/telnet - 775 sys sys 1104122062 81952
 386/bin/test - 775 sys sys 1104122062 69853
 386/bin/time - 775 sys sys 1104122063 61386
-386/bin/tlsclient - 775 sys sys 1104122063 197754
-386/bin/tlssrv - 775 sys sys 1104122064 198001
+386/bin/tlsclient - 775 sys sys 1109132004 197187
+386/bin/tlssrv - 775 sys sys 1109132004 197434
 386/bin/togif - 775 sys sys 1108960015 189521
 386/bin/toico - 775 sys sys 1104122065 123524
 386/bin/topng - 775 sys sys 1108872012 138083
@@ -440,7 +440,7 @@
 386/bin/upas/bayes - 775 sys sys 1064598344 70530
 386/bin/upas/deliver - 775 sys sys 1104122069 99781
 386/bin/upas/filter - 775 sys sys 1104122070 147311
-386/bin/upas/fs - 775 sys sys 1108354565 332823
+386/bin/upas/fs - 775 sys sys 1109132005 332256
 386/bin/upas/isspam - 775 sys sys 1064598349 38
 386/bin/upas/list - 775 sys sys 1104122071 82776
 386/bin/upas/marshal - 775 sys sys 1107490159 132595
@@ -450,14 +450,14 @@
 386/bin/upas/msgcat - 775 sys sys 1064598353 38
 386/bin/upas/msgtok - 775 sys sys 1064598354 75149
 386/bin/upas/nedmail - 775 sys sys 1104122073 156258
-386/bin/upas/pop3 - 775 sys sys 1108960017 260349
+386/bin/upas/pop3 - 775 sys sys 1109132006 259782
 386/bin/upas/qer - 775 sys sys 1104122073 99840
 386/bin/upas/ratfs - 775 sys sys 1108354565 111342
 386/bin/upas/runq - 775 sys sys 1104122074 113086
 386/bin/upas/scanmail - 775 sys sys 1104122075 128749
 386/bin/upas/send - 775 sys sys 1104122075 191536
-386/bin/upas/smtp - 775 sys sys 1108913524 274131
-386/bin/upas/smtpd - 775 sys sys 1108268391 329286
+386/bin/upas/smtp - 775 sys sys 1109132007 273564
+386/bin/upas/smtpd - 775 sys sys 1109132008 328719
 386/bin/upas/spam - 775 sys sys 1064598366 36
 386/bin/upas/testscan - 775 sys sys 1104122077 83668
 386/bin/upas/token - 775 sys sys 1104122077 77554
@@ -490,13 +490,13 @@
 386/bin/venti/verifyarena - 775 sys sys 1104122086 104270
 386/bin/venti/wrarena - 775 sys sys 1104122086 176179
 386/bin/venti/write - 775 sys sys 1104122087 102499
-386/bin/vncs - 775 sys sys 1108960018 471461
-386/bin/vncv - 775 sys sys 1104122089 518584
+386/bin/vncs - 775 sys sys 1109132009 470894
+386/bin/vncv - 775 sys sys 1109132010 518017
 386/bin/vt - 775 sys sys 1106799182 172859
 386/bin/vtdump - 775 sys sys 1104122090 159451
 386/bin/wc - 775 sys sys 1104122090 41156
 386/bin/webcookies - 775 sys sys 1108354568 161505
-386/bin/webfs - 775 sys sys 1108354568 349730
+386/bin/webfs - 775 sys sys 1109132011 349163
 386/bin/webfsget - 775 sys sys 1104122092 39143
 386/bin/wikifs - 775 sys sys 1108354569 201169
 386/bin/winwatch - 775 sys sys 1106799182 143376
@@ -554,7 +554,7 @@
 386/lib/libplumb.a - 664 sys sys 1108699740 18876
 386/lib/libregexp.a - 664 sys sys 1108268401 37464
 386/lib/libscribble.a - 664 sys sys 1108699740 107280
-386/lib/libsec.a - 664 sys sys 1108268403 643958
+386/lib/libsec.a - 664 sys sys 1109132031 643998
 386/lib/libstdio.a - 664 sys sys 1108268403 126382
 386/lib/libsunrpc.a - 664 sys sys 1108268404 355994
 386/lib/libthread.a - 664 sys sys 1108268404 71162
@@ -4657,7 +4657,7 @@ sys/man - 20000000775 sys sys 1012278794 0
 sys/man/1 - 20000000775 sys sys 1018897631 0
 sys/man/1/0intro - 664 sys sys 1101668050 9625
 sys/man/1/2a - 664 sys sys 1101668050 1188
-sys/man/1/2c - 664 sys sys 1107365037 8034
+sys/man/1/2c - 664 sys sys 1109196896 8237
 sys/man/1/2l - 664 sys sys 1101668051 4365
 sys/man/1/INDEX - 664 sys sys 1104811679 3004
 sys/man/1/INDEX.html - 664 sys sys 1104736360 16403
@@ -5176,11 +5176,8 @@ sys/src/9/alphapc/clock.c - 664 sys sys 1032052963 1472
 sys/src/9/alphapc/cycintr.c - 664 sys sys 1018721238 230
 sys/src/9/alphapc/dat.h - 664 sys sys 1071245535 5215
 sys/src/9/alphapc/devarch.c - 664 sys sys 1039753422 9760
-sys/src/9/alphapc/devether.c - 664 sys sys 1055701009 28
-sys/src/9/alphapc/devfloppy.c - 664 sys sys 1015012784 29
 sys/src/9/alphapc/devvga.c - 664 sys sys 1015012784 7513
 sys/src/9/alphapc/dma.c - 664 sys sys 1015012784 6112
-sys/src/9/alphapc/ether2114x.c - 664 sys sys 1015012784 30
 sys/src/9/alphapc/etherif.h - 664 sys sys 1045063621 1025
 sys/src/9/alphapc/faultalpha.c - 664 sys sys 1015012784 1257
 sys/src/9/alphapc/fdc37c93x.c - 664 sys sys 1015012785 1110
@@ -5196,25 +5193,13 @@ sys/src/9/alphapc/main.c - 664 sys sys 1039753420 13626
 sys/src/9/alphapc/mem.h - 664 sys sys 1077408326 3131
 sys/src/9/alphapc/memmove.s - 664 sys sys 1015012786 2936
 sys/src/9/alphapc/memset.s - 664 sys sys 1015012786 844
-sys/src/9/alphapc/mkfile - 664 sys sys 1071320227 2030
+sys/src/9/alphapc/mkfile - 664 sys sys 1109202445 1813
 sys/src/9/alphapc/mmu.c - 664 sys sys 1015012786 4872
-sys/src/9/alphapc/mouse.c - 664 sys sys 1015012786 25
 sys/src/9/alphapc/pci.c - 664 sys sys 1039753420 7868
-sys/src/9/alphapc/random.c - 664 sys sys 1039753421 26
-sys/src/9/alphapc/screen.c - 664 sys sys 1039753422 26
 sys/src/9/alphapc/screen.h - 664 sys sys 1060267151 3584
 sys/src/9/alphapc/sd53c8xx.c - 664 sys sys 1015012787 51009
-sys/src/9/alphapc/sdata.c - 664 sys sys 1015012787 25
-sys/src/9/alphapc/sdscsi.c - 664 sys sys 1015012787 26
 sys/src/9/alphapc/sio.c - 664 sys sys 1015012787 293
 sys/src/9/alphapc/trap.c - 664 sys sys 1105030177 18099
-sys/src/9/alphapc/uarti8250.c - 664 sys sys 1015012788 29
-sys/src/9/alphapc/vga.c - 664 sys sys 1015012788 23
-sys/src/9/alphapc/vgargb524.c - 664 sys sys 1015012788 29
-sys/src/9/alphapc/vgas3.c - 664 sys sys 1015012788 25
-sys/src/9/alphapc/vgasavage.c - 664 sys sys 1015012788 29
-sys/src/9/alphapc/vgatvp3026.c - 664 sys sys 1015012788 30
-sys/src/9/alphapc/vgax.c - 664 sys sys 1015012788 24
 sys/src/9/bitsy - 20000000775 sys sys 1018721429 0
 sys/src/9/bitsy/Booting101 - 664 sys sys 1054798506 8841
 sys/src/9/bitsy/bitsy - 664 sys sys 1067722592 424
@@ -5395,6 +5380,7 @@ sys/src/9/pc/ethermii.h - 664 sys sys 1086873891 3258
 sys/src/9/pc/etherrhine.c - 664 sys sys 1081706478 13799
 sys/src/9/pc/ethersink.c - 664 sys sys 1048644103 1076
 sys/src/9/pc/ethersmc.c - 664 sys sys 1071245461 15103
+sys/src/9/pc/ethervt6102.c - 664 sys sys 1109202304 22569
 sys/src/9/pc/etherwavelan.c - 664 sys sys 1107448246 3723
 sys/src/9/pc/floppy.h - 664 sys sys 1055700609 3835
 sys/src/9/pc/fns.h - 664 sys sys 1089046996 4372
@@ -5426,6 +5412,7 @@ sys/src/9/pc/pcfl - 664 sys sys 1042004821 1563
 sys/src/9/pc/pcflop - 664 sys sys 1104430611 1438
 sys/src/9/pc/pci.c - 664 sys sys 1107436009 25850
 sys/src/9/pc/pcmciamodem.c - 664 sys sys 1099761153 1586
+sys/src/9/pc/pcmkfile - 664 sys sys 1109202191 101
 sys/src/9/pc/piix4smbus.c - 664 sys sys 1091129037 5230
 sys/src/9/pc/plan9l.s - 664 sys sys 1015014521 910
 sys/src/9/pc/psaux.c - 664 sys sys 1026847650 915
@@ -5521,11 +5508,12 @@ sys/src/9/port/log.c - 664 sys sys 1014931175 2860
 sys/src/9/port/master - 664 sys sys 1104430269 505
 sys/src/9/port/master.local - 664 sys sys 1063856961 130
 sys/src/9/port/mkbootrules - 775 sys sys 1055700518 923
-sys/src/9/port/mkdevc - 775 sys sys 1068466668 3849
+sys/src/9/port/mkdevc - 775 sys sys 1109202243 3889
 sys/src/9/port/mkdevlist - 775 sys sys 1055700519 510
 sys/src/9/port/mkerrstr - 775 sys sys 1015278340 75
 sys/src/9/port/mkextract - 775 sys sys 1039753334 435
 sys/src/9/port/mkfile - 664 sys sys 1063856960 350
+sys/src/9/port/mkfilelist - 775 sys sys 1109202242 203
 sys/src/9/port/mkroot - 775 sys sys 1039753334 235
 sys/src/9/port/mkrootall - 775 sys sys 1055954696 386
 sys/src/9/port/mkrootc - 775 sys sys 1055954695 717
@@ -5539,7 +5527,7 @@ sys/src/9/port/pgrp.c - 664 sys sys 1072704671 3940
 sys/src/9/port/portclock.c - 664 sys sys 1102093397 4556
 sys/src/9/port/portdat.h - 664 sys sys 1102093399 22207
 sys/src/9/port/portfns.h - 664 sys sys 1102093388 11474
-sys/src/9/port/portmkfile - 664 sys sys 1091733856 2087
+sys/src/9/port/portmkfile - 664 sys sys 1109202242 2043
 sys/src/9/port/print.c - 664 sys sys 1014931178 227
 sys/src/9/port/proc.c - 664 sys sys 1099760501 28207
 sys/src/9/port/qio.c - 664 sys sys 1070287837 23562
@@ -7249,7 +7237,7 @@ sys/src/cmd/cc/compat.c - 664 sys sys 1084472048 417
 sys/src/cmd/cc/dcl.c - 664 sys sys 1089299183 26723
 sys/src/cmd/cc/dpchk.c - 664 sys sys 1107365037 7152
 sys/src/cmd/cc/funct.c - 664 sys sys 984718510 6167
-sys/src/cmd/cc/lex.c - 664 sys sys 1108397267 23807
+sys/src/cmd/cc/lex.c - 664 sys sys 1109187034 23826
 sys/src/cmd/cc/lexbody - 664 sys sys 1098499731 9014
 sys/src/cmd/cc/mac.c - 664 sys sys 944960808 36
 sys/src/cmd/cc/macbody - 664 sys sys 1108281581 11703
@@ -12471,19 +12459,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/9pc - 775 sys sys 1109132016 1833270
-386/9pccpu - 775 sys sys 1109132020 1487821
-386/9pcdisk - 775 sys sys 1109132025 2038972
-386/9pcf - 775 sys sys 1109132030 2381804
-386/bin/hget - 775 sys sys 1109132002 231848
-386/bin/vncs - 775 sys sys 1109132009 470894
-386/bin/vncv - 775 sys sys 1109132010 518017
-386/bin/webfs - 775 sys sys 1109132011 349163
-386/bin/ip/httpd/httpd - 775 sys sys 1109132003 290319
-386/bin/tlsclient - 775 sys sys 1109132004 197187
-386/bin/tlssrv - 775 sys sys 1109132004 197434
-386/bin/upas/fs - 775 sys sys 1109132005 332256
-386/bin/upas/pop3 - 775 sys sys 1109132006 259782
-386/bin/upas/smtp - 775 sys sys 1109132007 273564
-386/bin/upas/smtpd - 775 sys sys 1109132008 328719
-386/lib/libsec.a - 664 sys sys 1109132031 643998
+386/bin/8c - 775 sys sys 1109217972 358000
+sys/src/9/alphapc/mkfile - 664 sys sys 1109218102 1682

+ 9 - 21
dist/replica/plan9.db

@@ -15,7 +15,7 @@
 386/_9pcdisk.gz - 664 sys sys 1039764191 695837
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1108285260 115096
-386/bin/8c - 775 sys sys 1108440451 357989
+386/bin/8c - 775 sys sys 1109217972 358000
 386/bin/8l - 775 sys sys 1107835553 115728
 386/bin/9660srv - 775 sys sys 1108354539 103973
 386/bin/aan - 775 sys sys 1108354539 130710
@@ -4657,7 +4657,7 @@ sys/man - 20000000775 sys sys 1012278794 0
 sys/man/1 - 20000000775 sys sys 1018897631 0
 sys/man/1/0intro - 664 sys sys 1101668050 9625
 sys/man/1/2a - 664 sys sys 1101668050 1188
-sys/man/1/2c - 664 sys sys 1107365037 8034
+sys/man/1/2c - 664 sys sys 1109196896 8237
 sys/man/1/2l - 664 sys sys 1101668051 4365
 sys/man/1/INDEX - 664 sys sys 1104811679 3004
 sys/man/1/INDEX.html - 664 sys sys 1104736360 16403
@@ -5176,11 +5176,8 @@ sys/src/9/alphapc/clock.c - 664 sys sys 1032052963 1472
 sys/src/9/alphapc/cycintr.c - 664 sys sys 1018721238 230
 sys/src/9/alphapc/dat.h - 664 sys sys 1071245535 5215
 sys/src/9/alphapc/devarch.c - 664 sys sys 1039753422 9760
-sys/src/9/alphapc/devether.c - 664 sys sys 1055701009 28
-sys/src/9/alphapc/devfloppy.c - 664 sys sys 1015012784 29
 sys/src/9/alphapc/devvga.c - 664 sys sys 1015012784 7513
 sys/src/9/alphapc/dma.c - 664 sys sys 1015012784 6112
-sys/src/9/alphapc/ether2114x.c - 664 sys sys 1015012784 30
 sys/src/9/alphapc/etherif.h - 664 sys sys 1045063621 1025
 sys/src/9/alphapc/faultalpha.c - 664 sys sys 1015012784 1257
 sys/src/9/alphapc/fdc37c93x.c - 664 sys sys 1015012785 1110
@@ -5196,25 +5193,13 @@ sys/src/9/alphapc/main.c - 664 sys sys 1039753420 13626
 sys/src/9/alphapc/mem.h - 664 sys sys 1077408326 3131
 sys/src/9/alphapc/memmove.s - 664 sys sys 1015012786 2936
 sys/src/9/alphapc/memset.s - 664 sys sys 1015012786 844
-sys/src/9/alphapc/mkfile - 664 sys sys 1071320227 2030
+sys/src/9/alphapc/mkfile - 664 sys sys 1109218102 1682
 sys/src/9/alphapc/mmu.c - 664 sys sys 1015012786 4872
-sys/src/9/alphapc/mouse.c - 664 sys sys 1015012786 25
 sys/src/9/alphapc/pci.c - 664 sys sys 1039753420 7868
-sys/src/9/alphapc/random.c - 664 sys sys 1039753421 26
-sys/src/9/alphapc/screen.c - 664 sys sys 1039753422 26
 sys/src/9/alphapc/screen.h - 664 sys sys 1060267151 3584
 sys/src/9/alphapc/sd53c8xx.c - 664 sys sys 1015012787 51009
-sys/src/9/alphapc/sdata.c - 664 sys sys 1015012787 25
-sys/src/9/alphapc/sdscsi.c - 664 sys sys 1015012787 26
 sys/src/9/alphapc/sio.c - 664 sys sys 1015012787 293
 sys/src/9/alphapc/trap.c - 664 sys sys 1105030177 18099
-sys/src/9/alphapc/uarti8250.c - 664 sys sys 1015012788 29
-sys/src/9/alphapc/vga.c - 664 sys sys 1015012788 23
-sys/src/9/alphapc/vgargb524.c - 664 sys sys 1015012788 29
-sys/src/9/alphapc/vgas3.c - 664 sys sys 1015012788 25
-sys/src/9/alphapc/vgasavage.c - 664 sys sys 1015012788 29
-sys/src/9/alphapc/vgatvp3026.c - 664 sys sys 1015012788 30
-sys/src/9/alphapc/vgax.c - 664 sys sys 1015012788 24
 sys/src/9/bitsy - 20000000775 sys sys 1018721429 0
 sys/src/9/bitsy/Booting101 - 664 sys sys 1054798506 8841
 sys/src/9/bitsy/bitsy - 664 sys sys 1067722592 424
@@ -5395,6 +5380,7 @@ sys/src/9/pc/ethermii.h - 664 sys sys 1086873891 3258
 sys/src/9/pc/etherrhine.c - 664 sys sys 1081706478 13799
 sys/src/9/pc/ethersink.c - 664 sys sys 1048644103 1076
 sys/src/9/pc/ethersmc.c - 664 sys sys 1071245461 15103
+sys/src/9/pc/ethervt6102.c - 664 sys sys 1109202304 22569
 sys/src/9/pc/etherwavelan.c - 664 sys sys 1107448246 3723
 sys/src/9/pc/floppy.h - 664 sys sys 1055700609 3835
 sys/src/9/pc/fns.h - 664 sys sys 1089046996 4372
@@ -5426,6 +5412,7 @@ sys/src/9/pc/pcfl - 664 sys sys 1042004821 1563
 sys/src/9/pc/pcflop - 664 sys sys 1104430611 1438
 sys/src/9/pc/pci.c - 664 sys sys 1107436009 25850
 sys/src/9/pc/pcmciamodem.c - 664 sys sys 1099761153 1586
+sys/src/9/pc/pcmkfile - 664 sys sys 1109202191 101
 sys/src/9/pc/piix4smbus.c - 664 sys sys 1091129037 5230
 sys/src/9/pc/plan9l.s - 664 sys sys 1015014521 910
 sys/src/9/pc/psaux.c - 664 sys sys 1026847650 915
@@ -5521,11 +5508,12 @@ sys/src/9/port/log.c - 664 sys sys 1014931175 2860
 sys/src/9/port/master - 664 sys sys 1104430269 505
 sys/src/9/port/master.local - 664 sys sys 1063856961 130
 sys/src/9/port/mkbootrules - 775 sys sys 1055700518 923
-sys/src/9/port/mkdevc - 775 sys sys 1068466668 3849
+sys/src/9/port/mkdevc - 775 sys sys 1109202243 3889
 sys/src/9/port/mkdevlist - 775 sys sys 1055700519 510
 sys/src/9/port/mkerrstr - 775 sys sys 1015278340 75
 sys/src/9/port/mkextract - 775 sys sys 1039753334 435
 sys/src/9/port/mkfile - 664 sys sys 1063856960 350
+sys/src/9/port/mkfilelist - 775 sys sys 1109202242 203
 sys/src/9/port/mkroot - 775 sys sys 1039753334 235
 sys/src/9/port/mkrootall - 775 sys sys 1055954696 386
 sys/src/9/port/mkrootc - 775 sys sys 1055954695 717
@@ -5539,7 +5527,7 @@ sys/src/9/port/pgrp.c - 664 sys sys 1072704671 3940
 sys/src/9/port/portclock.c - 664 sys sys 1102093397 4556
 sys/src/9/port/portdat.h - 664 sys sys 1102093399 22207
 sys/src/9/port/portfns.h - 664 sys sys 1102093388 11474
-sys/src/9/port/portmkfile - 664 sys sys 1091733856 2087
+sys/src/9/port/portmkfile - 664 sys sys 1109202242 2043
 sys/src/9/port/print.c - 664 sys sys 1014931178 227
 sys/src/9/port/proc.c - 664 sys sys 1099760501 28207
 sys/src/9/port/qio.c - 664 sys sys 1070287837 23562
@@ -7249,7 +7237,7 @@ sys/src/cmd/cc/compat.c - 664 sys sys 1084472048 417
 sys/src/cmd/cc/dcl.c - 664 sys sys 1089299183 26723
 sys/src/cmd/cc/dpchk.c - 664 sys sys 1107365037 7152
 sys/src/cmd/cc/funct.c - 664 sys sys 984718510 6167
-sys/src/cmd/cc/lex.c - 664 sys sys 1108397267 23807
+sys/src/cmd/cc/lex.c - 664 sys sys 1109187034 23826
 sys/src/cmd/cc/lexbody - 664 sys sys 1098499731 9014
 sys/src/cmd/cc/mac.c - 664 sys sys 944960808 36
 sys/src/cmd/cc/macbody - 664 sys sys 1108281581 11703

+ 26 - 0
dist/replica/plan9.log

@@ -13778,3 +13778,29 @@
 1109133086 13 c 386/bin/upas/smtp - 775 sys sys 1109132007 273564
 1109133086 14 c 386/bin/upas/smtpd - 775 sys sys 1109132008 328719
 1109133086 15 c 386/lib/libsec.a - 664 sys sys 1109132031 643998
+1109187098 0 c sys/src/cmd/cc/lex.c - 664 sys sys 1109187034 23826
+1109197900 0 c sys/man/1/2c - 664 sys sys 1109196896 8237
+1109203301 0 c 386/bin/8c - 775 sys sys 1109202878 358000
+1109203301 1 c sys/src/9/alphapc/mkfile - 664 sys sys 1109202445 1813
+1109203301 2 a sys/src/9/pc/ethervt6102.c - 664 sys sys 1109202304 22569
+1109203301 3 a sys/src/9/pc/pcmkfile - 664 sys sys 1109202191 101
+1109203301 4 c sys/src/9/port/mkdevc - 775 sys sys 1109202243 3889
+1109203301 5 a sys/src/9/port/mkfilelist - 775 sys sys 1109202242 203
+1109203301 6 c sys/src/9/port/portmkfile - 664 sys sys 1109202242 2043
+1109203301 7 d sys/src/9/alphapc/vgax.c - 664 sys sys 1015012788 0
+1109203301 8 d sys/src/9/alphapc/vgatvp3026.c - 664 sys sys 1015012788 0
+1109203301 9 d sys/src/9/alphapc/vgasavage.c - 664 sys sys 1015012788 0
+1109203301 10 d sys/src/9/alphapc/vgas3.c - 664 sys sys 1015012788 0
+1109203301 11 d sys/src/9/alphapc/vgargb524.c - 664 sys sys 1015012788 0
+1109203301 12 d sys/src/9/alphapc/vga.c - 664 sys sys 1015012788 0
+1109203301 13 d sys/src/9/alphapc/uarti8250.c - 664 sys sys 1015012788 0
+1109203301 14 d sys/src/9/alphapc/sdscsi.c - 664 sys sys 1015012787 0
+1109203301 15 d sys/src/9/alphapc/sdata.c - 664 sys sys 1015012787 0
+1109203301 16 d sys/src/9/alphapc/screen.c - 664 sys sys 1039753422 0
+1109203301 17 d sys/src/9/alphapc/random.c - 664 sys sys 1039753421 0
+1109203301 18 d sys/src/9/alphapc/mouse.c - 664 sys sys 1015012786 0
+1109203301 19 d sys/src/9/alphapc/ether2114x.c - 664 sys sys 1015012784 0
+1109203301 20 d sys/src/9/alphapc/devfloppy.c - 664 sys sys 1015012784 0
+1109203301 21 d sys/src/9/alphapc/devether.c - 664 sys sys 1055701009 0
+1109219505 0 c 386/bin/8c - 775 sys sys 1109217972 358000
+1109219505 1 c sys/src/9/alphapc/mkfile - 664 sys sys 1109218102 1682

+ 12 - 1
sys/man/1/2c

@@ -136,7 +136,10 @@ is always
 sought first in the directory 
 of the
 .I file
-argument.  If this fails, or the name is enclosed in
+argument.  If this fails,
+the
+.I -O
+flag is given or the name is enclosed in
 .BR <> ,
 it is then sought
 in directories named in 
@@ -147,6 +150,10 @@ then in
 and finally in
 .BR /$objtype/include .
 .TP
+.B -O
+Suppress the automatic searching for include files in
+the directory of the file argument.
+.TP
 .B -N
 Suppress automatic registerization and optimization.
 .TP
@@ -414,3 +421,7 @@ For a full ANSI preprocessor, use
 the
 .B p
 option.
+.PP
+The default search order for include files
+differs to that of
+.IR cpp (1).

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

@@ -1 +0,0 @@
-#include "../pc/devether.c"

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

@@ -1 +0,0 @@
-#include "../pc/devfloppy.c"

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

@@ -1 +0,0 @@
-#include "../pc/ether2114x.c"

+ 1 - 14
sys/src/9/alphapc/mkfile

@@ -80,6 +80,7 @@ install:V: $p$CONF
 <../boot/bootmkfile
 <../port/portmkfile
 <|../port/mkbootrules $CONF
+<../pc/pcmkfile
 
 init.h:	initcode /sys/src/libc/9syscall/sys.h
 	$AS initcode
@@ -96,19 +97,5 @@ sd53c8xx.$O:	sd53c8xx.i
 sd53c8xx.i:	../pc/sd53c8xx.n
 	aux/na $prereq > $target
 
-devfloppy.$O:	../pc/devfloppy.c
-ether2114x.$O:	../pc/ether2114x.c
-mouse.$O:	../pc/mouse.c
-screen.$O:	../pc/screen.c
-sdata.$O:	../pc/sdata.c
-sdscsi.$O:	../pc/sdscsi.c
-uarti8250.$O:	../pc/uarti8250.c
-vga.$O:		../pc/vga.c
-vgargb524.$O:	../pc/vgargb524.c
-vgas3.$O:	../pc/vgas3.c
-vgasavage.$O:	../pc/vgasavage.c
-vgatvp3026.$O:	../pc/vgatvp3026.c
-vgax.$O:	../pc/vgax.c
-
 acid:V:
 	$CC -a -w -I. ../port/qio.c>acid

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

@@ -1 +0,0 @@
-#include "../pc/mouse.c"

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

@@ -1 +0,0 @@
-#include "../pc/random.c"

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

@@ -1 +0,0 @@
-#include "../pc/screen.c"

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

@@ -1 +0,0 @@
-#include "../pc/sdata.c"

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

@@ -1 +0,0 @@
-#include "../pc/sdscsi.c"

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

@@ -1 +0,0 @@
-#include "../pc/uarti8250.c"

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

@@ -1 +0,0 @@
-#include "../pc/vga.c"

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

@@ -1 +0,0 @@
-#include "../pc/vgargb524.c"

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

@@ -1 +0,0 @@
-#include "../pc/vgas3.c"

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

@@ -1 +0,0 @@
-#include "../pc/vgasavage.c"

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

@@ -1 +0,0 @@
-#include "../pc/vgatvp3026.c"

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

@@ -1 +0,0 @@
-#include "../pc/vgax.c"

+ 1038 - 0
sys/src/9/pc/ethervt6102.c

@@ -0,0 +1,1038 @@
+/*
+ * VIA VT6102 Fast Ethernet Controller (Rhine II).
+ * To do:
+ *	cache-line size alignments - done
+ *	reduce tx interrupts
+ *	use 2 descriptors on tx for alignment - done
+ *	reorganise initialisation/shutdown/reset
+ *	adjust Tx FIFO threshold on underflow - untested
+ *	why does the link status never cause an interrupt?
+ *	use the lproc as a periodic timer for stalls, etc.
+ */
+#include "u.h"
+#include "../port/lib.h"
+#include "mem.h"
+#include "dat.h"
+#include "fns.h"
+#include "io.h"
+#include "../port/error.h"
+#include "../port/netif.h"
+
+#include "etherif.h"
+#include "ethermii.h"
+
+enum {
+	Par0		= 0x00,		/* Ethernet Address */
+	Rcr		= 0x06,		/* Receive Configuration */
+	Tcr		= 0x07,		/* Transmit Configuration */
+	Cr		= 0x08,		/* Control */
+	Isr		= 0x0C,		/* Interrupt Status */
+	Imr		= 0x0E,		/* Interrupt Mask */
+	Rxdaddr		= 0x18,		/* Current Rx Descriptor Address */
+	Txdaddr		= 0x1C,		/* Current Tx Descriptor Address */
+	Phyadr		= 0x6C,		/* Phy Address */
+	Miisr		= 0x6D,		/* MII Status */
+	Bcr0		= 0x6E,		/* Bus Control */
+	Bcr1		= 0x6F,
+	Miicr		= 0x70,		/* MII Control */
+	Miiadr		= 0x71,		/* MII Address */
+	Miidata		= 0x72,		/* MII Data */
+	Eecsr		= 0x74,		/* EEPROM Control and Status */
+};
+
+enum {					/* Rcr */
+	Sep		= 0x01,		/* Accept Error Packets */
+	Ar		= 0x02,		/* Accept Small Packets */
+	Am		= 0x04,		/* Accept Multicast */
+	Ab		= 0x08,		/* Accept Broadcast */
+	Prom		= 0x10,		/* Accept Physical Address Packets */
+	RrftMASK	= 0xE0,		/* Receive FIFO Threshold */
+	RrftSHIFT	= 5,
+	Rrft64		= 0<<RrftSHIFT,
+	Rrft32		= 1<<RrftSHIFT,
+	Rrft128		= 2<<RrftSHIFT,
+	Rrft256		= 3<<RrftSHIFT,
+	Rrft512		= 4<<RrftSHIFT,
+	Rrft768		= 5<<RrftSHIFT,
+	Rrft1024	= 6<<RrftSHIFT,
+	RrftSAF		= 7<<RrftSHIFT,
+};
+
+enum {					/* Tcr */
+	Lb0		= 0x02,		/* Loopback Mode */
+	Lb1		= 0x04,
+	Ofset		= 0x08,		/* Back-off Priority Selection */
+	RtsfMASK	= 0xE0,		/* Transmit FIFO Threshold */
+	RtsfSHIFT	= 5,
+	Rtsf128		= 0<<RtsfSHIFT,
+	Rtsf256		= 1<<RtsfSHIFT,
+	Rtsf512		= 2<<RtsfSHIFT,
+	Rtsf1024	= 3<<RtsfSHIFT,
+	RtsfSAF		= 7<<RtsfSHIFT,
+};
+
+enum {					/* Cr */
+	Init		= 0x0001,	/* INIT Process Begin */
+	Strt		= 0x0002,	/* Start NIC */
+	Stop		= 0x0004,	/* Stop NIC */
+	Rxon		= 0x0008,	/* Turn on Receive Process */
+	Txon		= 0x0010,	/* Turn on Transmit Process */
+	Tdmd		= 0x0020,	/* Transmit Poll Demand */
+	Rdmd		= 0x0040,	/* Receive Poll Demand */
+	Eren		= 0x0100,	/* Early Receive Enable */
+	Fdx		= 0x0400,	/* Set MAC to Full Duplex Mode */
+	Dpoll		= 0x0800,	/* Disable Td/Rd Auto Polling */
+	Tdmd1		= 0x2000,	/* Transmit Poll Demand 1 */
+	Rdmd1		= 0x4000,	/* Receive Poll Demand 1 */
+	Sfrst		= 0x8000,	/* Software Reset */
+};
+
+enum {					/* Isr/Imr */
+	Prx		= 0x0001,	/* Received Packet Successfully */
+	Ptx		= 0x0002,	/* Transmitted Packet Successfully */
+	Rxe		= 0x0004,	/* Receive Error */
+	Txe		= 0x0008,	/* Transmit Error */
+	Tu		= 0x0010,	/* Transmit Buffer Underflow */
+	Ru		= 0x0020,	/* Receive Buffer Link Error */
+	Be		= 0x0040,	/* PCI Bus Error */
+	Cnt		= 0x0080,	/* Counter Overflow */
+	Eri		= 0x0100,	/* Early Receive Interrupt */
+	Udfi		= 0x0200,	/* Tx FIFO Underflow */
+	Ovfi		= 0x0400,	/* Receive FIFO Overflow */
+	Pktrace		= 0x0800,	/* Hmmm... */
+	Norbf		= 0x1000,	/* No Receive Buffers */
+	Abti		= 0x2000,	/* Transmission Abort */
+	Srci		= 0x4000,	/* Port State Change */
+	Geni		= 0x8000,	/* General Purpose Interrupt */
+};
+
+enum {					/* Phyadr */
+	PhyadMASK	= 0x1F,		/* PHY Address */
+	PhyadSHIFT	= 0,
+	Mfdc		= 0x20,		/* Accelerate MDC Speed */
+	Mpo0		= 0x40,		/* MII Polling Timer Interval */
+	Mpo1		= 0x80,
+};
+
+enum {					/* Bcr0 */
+	DmaMASK		= 0x07,		/* DMA Length */
+	DmaSHIFT	= 0,
+	Dma32		= 0<<DmaSHIFT,
+	Dma64		= 1<<DmaSHIFT,
+	Dma128		= 2<<DmaSHIFT,
+	Dma256		= 3<<DmaSHIFT,
+	Dma512		= 4<<DmaSHIFT,
+	Dma1024		= 5<<DmaSHIFT,
+	DmaSAF		= 7<<DmaSHIFT,
+	CrftMASK	= 0x38,		/* Rx FIFO Threshold */
+	CrftSHIFT	= 3,
+	Crft64		= 1<<CrftSHIFT,
+	Crft128		= 2<<CrftSHIFT,
+	Crft256		= 3<<CrftSHIFT,
+	Crft512		= 4<<CrftSHIFT,
+	Crft1024	= 5<<CrftSHIFT,
+	CrftSAF		= 7<<CrftSHIFT,
+	Extled		= 0x40,		/* Extra LED Support Control */
+	Med2		= 0x80,		/* Medium Select Control */
+};
+
+enum {					/* Bcr1 */
+	PotMASK		= 0x07,		/* Polling Timer Interval */
+	PotSHIFT	= 0,
+	CtftMASK	= 0x38,		/* Tx FIFO Threshold */
+	CtftSHIFT	= 3,
+	Ctft64		= 1<<CtftSHIFT,
+	Ctft128		= 2<<CtftSHIFT,
+	Ctft256		= 3<<CtftSHIFT,
+	Ctft512		= 4<<CtftSHIFT,
+	Ctft1024	= 5<<CtftSHIFT,
+	CtftSAF		= 7<<CtftSHIFT,
+};
+
+enum {					/* Miicr */
+	Mdc		= 0x01,		/* Clock */
+	Mdi		= 0x02,		/* Data In */
+	Mdo		= 0x04,		/* Data Out */
+	Mout		= 0x08,		/* Output Enable */
+	Mdpm		= 0x10,		/* Direct Program Mode Enable */
+	Wcmd		= 0x20,		/* Write Enable */
+	Rcmd		= 0x40,		/* Read Enable */
+	Mauto		= 0x80,		/* Auto Polling Enable */
+};
+
+enum {					/* Miiadr */
+	MadMASK		= 0x1F,		/* MII Port Address */
+	MadSHIFT	= 0,
+	Mdone		= 0x20,		/* Accelerate MDC Speed */
+	Msrcen		= 0x40,		/* MII Polling Timer Interval */
+	Midle		= 0x80,
+};
+
+enum {					/* Eecsr */
+	Edo		= 0x01,		/* Data Out */
+	Edi		= 0x02,		/* Data In */
+	Eck		= 0x04,		/* Clock */
+	Ecs		= 0x08,		/* Chip Select */
+	Dpm		= 0x10,		/* Direct Program Mode Enable */
+	Autold		= 0x20,		/* Dynamic Reload */
+	Embp		= 0x40,		/* Embedded Program Enable */
+	Eepr		= 0x80,		/* Programmed */
+};
+
+/*
+ * Ring descriptor. The space allocated for each
+ * of these will be rounded up to a cache-line boundary.
+ * The first 4 elements are known to the hardware.
+ */
+typedef struct Ds Ds;
+typedef struct Ds {
+	uint	status;
+	uint	control;
+	uint	addr;
+	uint	branch;
+
+	Block*	bp;
+	void*	bounce;
+	Ds*	next;
+	Ds*	prev;
+} Ds;
+
+enum {					/* Rx Ds status */
+	Rerr		= 0x00000001,	/* Receiver Error */
+	Crc		= 0x00000002,	/* CRC Error */
+	Fae		= 0x00000004,	/* Frame Alignment Error */
+	Fov		= 0x00000008,	/* FIFO Overflow */
+	Long		= 0x00000010,	/* A Long Packet */
+	Runt		= 0x00000020,	/* A Runt Packet */
+	Rxserr		= 0x00000040,	/* System Error */
+	Buff		= 0x00000080,	/* Buffer Underflow Error */
+	Rxedp		= 0x00000100,	/* End of Packet Buffer */
+	Rxstp		= 0x00000200,	/* Packet Start */
+	Chn		= 0x00000400,	/* Chain Buffer */
+	Phy		= 0x00000800,	/* Physical Address Packet */
+	Bar		= 0x00001000,	/* Broadcast Packet */
+	Mar		= 0x00002000,	/* Multicast Packet */
+	Rxok		= 0x00008000,	/* Packet Received Successfully */
+	LengthMASK	= 0x07FF0000,	/* Received Packet Length */
+	LengthSHIFT	= 16,
+
+	Own		= 0x80000000,	/* Descriptor Owned by NIC */
+};
+
+enum {					/* Tx Ds status */
+	NcrMASK		= 0x0000000F,	/* Collision Retry Count */
+	NcrSHIFT	= 0,
+	Cols		= 0x00000010,	/* Experienced Collisions */
+	Cdh		= 0x00000080,	/* CD Heartbeat */
+	Abt		= 0x00000100,	/* Aborted after Excessive Collisions */
+	Owc		= 0x00000200,	/* Out of Window Collision Seen */
+	Crs		= 0x00000400,	/* Carrier Sense Lost */
+	Udf		= 0x00000800,	/* FIFO Underflow */
+	Tbuff		= 0x00001000,	/* Invalid Td */
+	Txserr		= 0x00002000,	/* System Error */
+	Terr		= 0x00008000,	/* Excessive Collisions */
+};
+
+enum {					/* Tx Ds control */
+	TbsMASK		= 0x000007FF,	/* Tx Buffer Size */
+	TbsSHIFT	= 0,
+	Chain		= 0x00008000,	/* Chain Buffer */
+	Crcdisable	= 0x00010000,	/* Disable CRC generation */
+	Stp		= 0x00200000,	/* Start of Packet */
+	Edp		= 0x00400000,	/* End of Packet */
+	Ic		= 0x00800000,	/* Assert Interrupt Immediately */
+};
+
+enum {
+	Nrd		= 64,
+	Ntd		= 64,
+	Rdbsz		= ROUNDUP(ETHERMAXTU+4, 4),
+
+	Nrxstats	= 8,
+	Ntxstats	= 9,
+
+	Txcopy		= 128,
+};
+
+typedef struct Ctlr Ctlr;
+typedef struct Ctlr {
+	int	port;
+	Pcidev*	pcidev;
+	Ctlr*	next;
+	int	active;
+	int	id;
+	uchar	par[Eaddrlen];
+
+	QLock	alock;			/* attach */
+	void*	alloc;			/* receive/transmit descriptors */
+	int	cls;			/* alignment */
+	int	nrd;
+	int	ntd;
+
+	Ds*	rd;
+	Ds*	rdh;
+
+	Lock	tlock;
+	Ds*	td;
+	Ds*	tdh;
+	Ds*	tdt;
+	int	tdused;
+
+	Lock	clock;			/*  */
+	int	cr;
+	int	imr;
+	int	tft;			/* Tx threshold */
+
+	Mii*	mii;
+	Rendez	lrendez;
+	int	lwakeup;
+
+	uint	rxstats[Nrxstats];	/* statistics */
+	uint	txstats[Ntxstats];
+	uint	intr;
+	uint	lintr;			
+	uint	lsleep;
+	uint	rintr;
+	uint	tintr;
+	uint	taligned;
+	uint	tsplit;
+	uint	tcopied;
+	uint	txdw;
+} Ctlr;
+
+static Ctlr* vt6102ctlrhead;
+static Ctlr* vt6102ctlrtail;
+
+#define csr8r(c, r)	(inb((c)->port+(r)))
+#define csr16r(c, r)	(ins((c)->port+(r)))
+#define csr32r(c, r)	(inl((c)->port+(r)))
+#define csr8w(c, r, b)	(outb((c)->port+(r), (int)(b)))
+#define csr16w(c, r, w)	(outs((c)->port+(r), (ushort)(w)))
+#define csr32w(c, r, w)	(outl((c)->port+(r), (ulong)(w)))
+
+static char* rxstats[Nrxstats] = {
+	"Receiver Error",
+	"CRC Error",
+	"Frame Alignment Error",
+	"FIFO Overflow",
+	"Long Packet",
+	"Runt Packet",
+	"System Error",
+	"Buffer Underflow Error",
+};
+static char* txstats[Ntxstats] = {
+	"Aborted after Excessive Collisions",
+	"Out of Window Collision Seen",
+	"Carrier Sense Lost",
+	"FIFO Underflow",
+	"Invalid Td",
+	"System Error",
+	nil,
+	"Excessive Collisions",
+};
+
+//extern void cgapost(char[2]);
+//extern char* cgapostlo;
+//extern char* cgaposthi;
+
+static long
+vt6102ifstat(Ether* edev, void* a, long n, ulong offset)
+{
+	char *p;
+	Ctlr *ctlr;
+	int i, l, r;
+
+	ctlr = edev->ctlr;
+
+	p = malloc(2*READSTR);
+	l = 0;
+	for(i = 0; i < Nrxstats; i++){
+		l += snprint(p+l, 2*READSTR-l, "%s: %ud\n",
+			rxstats[i], ctlr->rxstats[i]);
+	}
+	for(i = 0; i < Ntxstats; i++){
+		if(txstats[i] == nil)
+			continue;
+		l += snprint(p+l, 2*READSTR-l, "%s: %ud\n",
+			txstats[i], ctlr->txstats[i]);
+	}
+	l += snprint(p+l, 2*READSTR-l, "cls: %ud\n", ctlr->cls);
+	l += snprint(p+l, 2*READSTR-l, "intr: %ud\n", ctlr->intr);
+	l += snprint(p+l, 2*READSTR-l, "lintr: %ud\n", ctlr->lintr);
+	l += snprint(p+l, 2*READSTR-l, "lsleep: %ud\n", ctlr->lsleep);
+	l += snprint(p+l, 2*READSTR-l, "rintr: %ud\n", ctlr->rintr);
+	l += snprint(p+l, 2*READSTR-l, "tintr: %ud\n", ctlr->tintr);
+	l += snprint(p+l, 2*READSTR-l, "taligned: %ud\n", ctlr->taligned);
+	l += snprint(p+l, 2*READSTR-l, "tsplit: %ud\n", ctlr->tsplit);
+	l += snprint(p+l, 2*READSTR-l, "tcopied: %ud\n", ctlr->tcopied);
+	l += snprint(p+l, 2*READSTR-l, "txdw: %ud\n", ctlr->txdw);
+	l += snprint(p+l, 2*READSTR-l, "tft: %ud\n", ctlr->tft);
+
+	if(ctlr->mii != nil && ctlr->mii->curphy != nil){
+		l += snprint(p+l, 2*READSTR, "phy:   ");
+		for(i = 0; i < NMiiPhyr; i++){
+			if(i && ((i & 0x07) == 0))
+				l += snprint(p+l, 2*READSTR-l, "\n       ");
+			r = miimir(ctlr->mii, i);
+			l += snprint(p+l, 2*READSTR-l, " %4.4uX", r);
+		}
+		snprint(p+l, 2*READSTR-l, "\n");
+	}
+	snprint(p+l, 2*READSTR-l, "\n");
+
+	n = readstr(offset, a, n, p);
+	free(p);
+
+	return n;
+}
+
+static void
+vt6102promiscuous(void* arg, int on)
+{
+	int rcr;
+	Ctlr *ctlr;
+	Ether *edev;
+
+	edev = arg;
+	ctlr = edev->ctlr;
+	rcr = csr8r(ctlr, Rcr);
+	if(on)
+		rcr |= Prom;
+	else
+		rcr &= ~Prom;
+	csr8w(ctlr, Rcr, rcr);
+}
+
+static void
+vt6102multicast(void* arg, uchar* addr, int on)
+{
+	/*
+	 * For now Am is set in Rcr.
+	 * Will need to interlock with promiscuous
+	 * when this gets filled in.
+	 */
+	USED(arg, addr, on);
+}
+
+static int
+vt6102wakeup(void* v)
+{
+	return *((int*)v) != 0;
+}
+
+static void
+vt6102imr(Ctlr* ctlr, int imr)
+{
+	ilock(&ctlr->clock);
+	ctlr->imr |= imr;
+	csr16w(ctlr, Imr, ctlr->imr);
+	iunlock(&ctlr->clock);
+}
+
+static void
+vt6102lproc(void* arg)
+{
+	Ctlr *ctlr;
+	Ether *edev;
+	MiiPhy *phy;
+
+	edev = arg;
+	ctlr = edev->ctlr;
+	for(;;){
+		if(ctlr->mii == nil || ctlr->mii->curphy == nil)
+			break;
+		if(miistatus(ctlr->mii) < 0)
+			goto enable;
+
+		phy = ctlr->mii->curphy;
+		ilock(&ctlr->clock);
+		if(phy->fd)
+			ctlr->cr |= Fdx;
+		else
+			ctlr->cr &= ~Fdx;
+		csr16w(ctlr, Cr, ctlr->cr);
+		iunlock(&ctlr->clock);
+enable:
+		ctlr->lwakeup = 0;
+		vt6102imr(ctlr, Srci);
+
+		ctlr->lsleep++;
+		sleep(&ctlr->lrendez, vt6102wakeup, &ctlr->lwakeup);
+
+	}
+	pexit("vt6102lproc: done", 1);
+}
+
+static void
+vt6102attach(Ether* edev)
+{
+	int i;
+	Ctlr *ctlr;
+	Ds *ds, *prev;
+	uchar *alloc, *bounce;
+	char name[KNAMELEN];
+
+	ctlr = edev->ctlr;
+	qlock(&ctlr->alock);
+	if(ctlr->alloc != nil){
+		qunlock(&ctlr->alock);
+		return;
+	}
+
+	/*
+	 * Descriptor and bounce-buffer space.
+	 * Must all be aligned on a 4-byte boundary,
+	 * but try to align on cache-lines.
+	 */
+	ctlr->nrd = Nrd;
+	ctlr->ntd = Ntd;
+	alloc = malloc((ctlr->nrd+ctlr->ntd)*ctlr->cls + ctlr->ntd*Txcopy + ctlr->cls-1);
+	if(alloc == nil){
+		qunlock(&ctlr->alock);
+		return;
+	}
+	ctlr->alloc = alloc;
+	alloc = (uchar*)ROUNDUP((ulong)alloc, ctlr->cls);
+
+	ctlr->rd = (Ds*)alloc;
+
+	if(waserror()){
+		ds = ctlr->rd;
+		for(i = 0; i < ctlr->nrd; i++){
+			if(ds->bp != nil){
+				freeb(ds->bp);
+				ds->bp = nil;
+			}
+			if((ds = ds->next) == nil)
+				break;
+		}
+		free(ctlr->alloc);
+		ctlr->alloc = nil;
+		qunlock(&ctlr->alock);
+		nexterror();
+	}
+
+	prev = ctlr->rd + ctlr->nrd-1;
+	for(i = 0; i < ctlr->nrd; i++){
+		ds = (Ds*)alloc;
+		alloc += ctlr->cls;
+
+		ds->control = Rdbsz;
+		ds->branch = PCIWADDR(alloc);
+
+		ds->bp = iallocb(Rdbsz+3);
+		if(ds->bp == nil)
+			error("vt6102: can't allocate receive ring\n");
+		ds->bp->rp = (uchar*)ROUNDUP((ulong)ds->bp->rp, 4);
+		ds->addr = PCIWADDR(ds->bp->rp);
+
+		ds->next = (Ds*)alloc;
+		ds->prev = prev;
+		prev = ds;
+
+		ds->status = Own;
+	}
+	prev->branch = 0;
+	prev->next = ctlr->rd;
+	prev->status = 0;
+	ctlr->rdh = ctlr->rd;
+
+	ctlr->td = (Ds*)alloc;
+	prev = ctlr->td + ctlr->ntd-1;
+	bounce = alloc + ctlr->ntd*ctlr->cls;
+	for(i = 0; i < ctlr->ntd; i++){
+		ds = (Ds*)alloc;
+		alloc += ctlr->cls;
+
+		ds->bounce = bounce;
+		bounce += Txcopy;
+		ds->next = (Ds*)alloc;
+		ds->prev = prev;
+		prev = ds;
+	}
+	prev->next = ctlr->td;
+	ctlr->tdh = ctlr->tdt = ctlr->td;
+	ctlr->tdused = 0;
+
+	ctlr->cr = Dpoll|Rdmd|Txon|Rxon|Strt;
+	/*Srci|Abti|Norbf|Pktrace|Ovfi|Udfi|Be|Ru|Tu|Txe|Rxe|Ptx|Prx*/
+	ctlr->imr = Abti|Norbf|Pktrace|Ovfi|Udfi|Be|Ru|Tu|Txe|Rxe|Ptx|Prx;
+
+	ilock(&ctlr->clock);
+	csr32w(ctlr, Rxdaddr, PCIWADDR(ctlr->rd));
+	csr32w(ctlr, Txdaddr, PCIWADDR(ctlr->td));
+	csr16w(ctlr, Isr, ~0);
+	csr16w(ctlr, Imr, ctlr->imr);
+	csr16w(ctlr, Cr, ctlr->cr);
+	iunlock(&ctlr->clock);
+
+	snprint(name, KNAMELEN, "#l%dlproc", edev->ctlrno);
+	kproc(name, vt6102lproc, edev);
+
+	qunlock(&ctlr->alock);
+	poperror();
+}
+
+static void
+vt6102transmit(Ether* edev)
+{
+	Block *bp;
+	Ctlr *ctlr;
+	Ds *ds, *next;
+	int control, i, o, prefix, size, tdused, timeo;
+
+	ctlr = edev->ctlr;
+
+	ilock(&ctlr->tlock);
+
+	/*
+	 * Free any completed packets
+	 */
+	ds = ctlr->tdh;
+	for(tdused = ctlr->tdused; tdused > 0; tdused--){
+		/*
+		 * For some errors the chip will turn the Tx engine
+		 * off. Wait for that to happen.
+		 * Could reset and re-init the chip here if it doesn't
+		 * play fair.
+		 * To do: adjust Tx FIFO threshold on underflow.
+		 */
+		if(ds->status & (Abt|Tbuff|Udf)){
+//*cgaposthi = 'A';
+			for(timeo = 0; timeo < 1000; timeo++){
+				if(!(csr16r(ctlr, Cr) & Txon))
+					break;
+				microdelay(1);
+			}
+//			if(timeo >= 1000)
+//				*cgaposthi = 'T';
+			ds->status = Own;
+			csr32w(ctlr, Txdaddr, PCIWADDR(ds));
+//*cgaposthi = 'B';
+		}
+
+		if(ds->status & Own)
+			break;
+		ds->addr = 0;
+		ds->branch = 0;
+
+		if(ds->bp != nil){
+			freeb(ds->bp);
+			ds->bp = nil;
+		}
+		for(i = 0; i < Ntxstats-1; i++){
+			if(ds->status & (1<<i))
+				ctlr->txstats[i]++;
+		}
+		ctlr->txstats[i] += (ds->status & NcrMASK)>>NcrSHIFT;
+
+		ds = ds->next;
+	}
+	ctlr->tdh = ds;
+
+	/*
+	 * Try to fill the ring back up.
+	 */
+	ds = ctlr->tdt;
+	while(tdused < ctlr->ntd-2){
+		if((bp = qget(edev->oq)) == nil)
+			break;
+		tdused++;
+
+		size = BLEN(bp);
+		prefix = 0;
+
+		if(o = (((int)bp->rp) & 0x03)){
+			prefix = Txcopy-o;
+			if(prefix > size)
+				prefix = size;
+			memmove(ds->bounce, bp->rp, prefix);
+			ds->addr = PCIWADDR(ds->bounce);
+			bp->rp += prefix;
+			size -= prefix;
+		}
+
+		next = ds->next;
+		ds->branch = PCIWADDR(ds->next);
+
+		if(size){
+			if(prefix){
+				next->bp = bp;
+				next->addr = PCIWADDR(bp->rp);
+				next->branch = PCIWADDR(next->next);
+				next->control = Edp|Chain|((size<<TbsSHIFT) & TbsMASK);
+
+				control = Stp|Chain|((prefix<<TbsSHIFT) & TbsMASK);
+
+				next = next->next;
+				tdused++;
+				ctlr->tsplit++;
+			}
+			else{
+				ds->bp = bp;
+				ds->addr = PCIWADDR(bp->rp);
+				control = Edp|Stp|((size<<TbsSHIFT) & TbsMASK);
+				ctlr->taligned++;
+			}
+		}
+		else{
+			freeb(bp);
+			control = Edp|Stp|((prefix<<TbsSHIFT) & TbsMASK);
+			ctlr->tcopied++;
+		}
+
+		ds->control = control;
+		if(tdused >= ctlr->ntd-2){
+			ds->control |= Ic;
+			ctlr->txdw++;
+		}
+		coherence();
+		ds->status = Own;
+
+		ds = next;
+	}
+	ctlr->tdt = ds;
+	ctlr->tdused = tdused;
+	if(ctlr->tdused)
+		csr16w(ctlr, Cr, Tdmd|ctlr->cr);
+
+	iunlock(&ctlr->tlock);
+}
+
+static void
+vt6102receive(Ether* edev)
+{
+	Ds *ds;
+	Block *bp;
+	Ctlr *ctlr;
+	int i, len;
+
+	ctlr = edev->ctlr;
+
+	ds = ctlr->rdh;
+	while(!(ds->status & Own) && ds->status != 0){
+		if(ds->status & Rerr){
+//*cgaposthi = 'R';
+			for(i = 0; i < Nrxstats; i++){
+				if(ds->status & (1<<i))
+					ctlr->rxstats[i]++;
+			}
+//*cgaposthi = 'r';
+		}
+		else if(bp = iallocb(Rdbsz+3)){
+			len = ((ds->status & LengthMASK)>>LengthSHIFT)-4;
+			ds->bp->wp = ds->bp->rp+len;
+			etheriq(edev, ds->bp, 1);
+			bp->rp = (uchar*)ROUNDUP((ulong)bp->rp, 4);
+			ds->addr = PCIWADDR(bp->rp);
+			ds->bp = bp;
+		}
+		ds->control = Rdbsz;
+		ds->branch = 0;
+		ds->status = 0;
+
+		ds->prev->branch = PCIWADDR(ds);
+		coherence();
+		ds->prev->status = Own;
+
+		ds = ds->next;
+	}
+	ctlr->rdh = ds;
+
+	csr16w(ctlr, Cr, ctlr->cr);
+}
+
+static void
+vt6102interrupt(Ureg*, void* arg)
+{
+	Ctlr *ctlr;
+	Ether *edev;
+	int imr, isr, r, timeo;
+
+	edev = arg;
+	ctlr = edev->ctlr;
+
+	ilock(&ctlr->clock);
+	csr16w(ctlr, Imr, 0);
+	imr = ctlr->imr;
+	ctlr->intr++;
+	for(;;){
+		if((isr = csr16r(ctlr, Isr)) != 0)
+			csr16w(ctlr, Isr, isr);
+		if((isr & ctlr->imr) == 0)
+			break;
+			
+		if(isr & Srci){
+			imr &= ~Srci;
+			ctlr->lwakeup = isr & Srci;
+			wakeup(&ctlr->lrendez);
+			isr &= ~Srci;
+			ctlr->lintr++;
+		}
+		if(isr & (Norbf|Pktrace|Ovfi|Ru|Rxe|Prx)){
+			vt6102receive(edev);
+			isr &= ~(Norbf|Pktrace|Ovfi|Ru|Rxe|Prx);
+			ctlr->rintr++;
+		}
+		if(isr & (Abti|Udfi|Tu|Txe|Ptx)){
+			if(isr & (Abti|Udfi|Tu)){
+//*cgaposthi = 'a';
+				for(timeo = 0; timeo < 1000; timeo++){
+					if(!(csr16r(ctlr, Cr) & Txon))
+						break;
+					microdelay(1);
+				}
+//				if(timeo >= 1000)
+//					*cgapostlo = 't';
+//				else
+//					*cgapostlo = 'b';
+
+				if((isr & Udfi) && ctlr->tft < CtftSAF){
+					ctlr->tft += 1<<CtftSHIFT;
+					r = csr8r(ctlr, Bcr1) & ~CtftMASK;
+					csr8w(ctlr, Bcr1, r|ctlr->tft);
+				}
+			}
+			vt6102transmit(edev);
+			isr &= ~(Abti|Udfi|Tu|Txe|Ptx);
+			ctlr->tintr++;
+		}
+		if(isr){
+//*cgaposthi = 'X';
+			panic("vt6102: isr %4.4uX\n", isr);
+		}
+	}
+	ctlr->imr = imr;
+	csr16w(ctlr, Imr, ctlr->imr);
+	iunlock(&ctlr->clock);
+}
+
+static int
+vt6102miimicmd(Mii* mii, int pa, int ra, int cmd, int data)
+{
+	Ctlr *ctlr;
+	int r, timeo;
+
+	ctlr = mii->ctlr;
+
+	csr8w(ctlr, Miicr, 0);
+	r = csr8r(ctlr, Phyadr);
+	csr8w(ctlr, Phyadr, (r & ~PhyadMASK)|pa);
+	csr8w(ctlr, Phyadr, pa);
+	csr8w(ctlr, Miiadr, ra);
+	if(cmd == Wcmd)
+		csr16w(ctlr, Miidata, data);
+	csr8w(ctlr, Miicr, cmd);
+
+	for(timeo = 0; timeo < 10000; timeo++){
+		if(!(csr8r(ctlr, Miicr) & cmd))
+			break;
+		microdelay(1);
+	}
+	if(timeo >= 10000)
+		return -1;
+
+	if(cmd == Wcmd)
+		return 0;
+	return csr16r(ctlr, Miidata);
+}
+
+static int
+vt6102miimir(Mii* mii, int pa, int ra)
+{
+	return vt6102miimicmd(mii, pa, ra, Rcmd, 0);
+}
+
+static int
+vt6102miimiw(Mii* mii, int pa, int ra, int data)
+{
+	return vt6102miimicmd(mii, pa, ra, Wcmd, data);
+}
+
+static int
+vt6102detach(Ctlr* ctlr)
+{
+	int timeo;
+
+	/*
+	 * Soft reset the controller.
+	 */
+	csr16w(ctlr, Cr, Sfrst);
+	for(timeo = 0; timeo < 10000; timeo++){
+		if(!(csr16r(ctlr, Cr) & Sfrst))
+			break;
+		microdelay(1);
+	}
+	if(timeo >= 1000)
+		return -1;
+
+	return 0;
+}
+
+static int
+vt6102reset(Ctlr* ctlr)
+{
+	MiiPhy *phy;
+	int i, r, timeo;
+
+	if(vt6102detach(ctlr) < 0)
+		return -1;
+
+	/*
+	 * Load the MAC address into the PAR[01]
+	 * registers.
+	 */
+	r = csr8r(ctlr, Eecsr);
+	csr8w(ctlr, Eecsr, Autold|r);
+	for(timeo = 0; timeo < 100; timeo++){
+		if(!(csr8r(ctlr, Cr) & Autold))
+			break;
+		microdelay(1);
+	}
+	if(timeo >= 100)
+		return -1;
+
+	for(i = 0; i < Eaddrlen; i++)
+		ctlr->par[i] = csr8r(ctlr, Par0+i);
+
+	/*
+	 * Configure DMA and Rx/Tx thresholds.
+	 * If the Rx/Tx threshold bits in Bcr[01] are 0 then
+	 * the thresholds are determined by Rcr/Tcr.
+	 */
+	r = csr8r(ctlr, Bcr0) & ~(CrftMASK|DmaMASK);
+	csr8w(ctlr, Bcr0, r|Crft64|Dma64);
+	r = csr8r(ctlr, Bcr1) & ~CtftMASK;
+	csr8w(ctlr, Bcr1, r|ctlr->tft);
+
+	r = csr8r(ctlr, Rcr) & ~(RrftMASK|Prom|Ar|Sep);
+	csr8w(ctlr, Rcr, r|Ab|Am);
+
+	r = csr8r(ctlr, Tcr) & ~(RtsfMASK|Ofset|Lb1|Lb0);
+	csr8w(ctlr, Tcr, r);
+
+	/*
+	 * Link management.
+	 */
+	if((ctlr->mii = malloc(sizeof(Mii))) == nil)
+		return -1;
+	ctlr->mii->mir = vt6102miimir;
+	ctlr->mii->miw = vt6102miimiw;
+	ctlr->mii->ctlr = ctlr;
+
+	if(mii(ctlr->mii, ~0) == 0 || (phy = ctlr->mii->curphy) == nil){
+		free(ctlr->mii);
+		ctlr->mii = nil;
+		return -1;
+	}
+	print("oui %X phyno %d\n", phy->oui, phy->phyno);
+
+	//miiane(ctlr->mii, ~0, ~0, ~0);
+
+	return 0;
+}
+
+static void
+vt6102pci(void)
+{
+	Pcidev *p;
+	Ctlr *ctlr;
+	int cls, port;
+
+	p = nil;
+	while(p = pcimatch(p, 0, 0)){
+		if(p->ccrb != 0x02 || p->ccru != 0)
+			continue;
+
+		switch((p->did<<16)|p->vid){
+		default:
+			continue;
+		case (0x3065<<16)|0x1106:	/* Rhine II */
+			break;
+		}
+
+		port = p->mem[0].bar & ~0x01;
+		if(ioalloc(port, p->mem[0].size, 0, "vt6102") < 0){
+			print("vt6102: port 0x%uX in use\n", port);
+			continue;
+		}
+		ctlr = malloc(sizeof(Ctlr));
+		ctlr->port = port;
+		ctlr->pcidev = p;
+		ctlr->id = (p->did<<16)|p->vid;
+		if((cls = pcicfgr8(p, PciCLS)) == 0 || cls == 0xFF)
+			cls = 0x10;
+		ctlr->cls = cls*4;
+		if(ctlr->cls < sizeof(Ds)){
+			print("vt6102: cls %d < sizeof(Ds)\n", ctlr->cls);
+			free(ctlr);
+			continue;
+		}
+		ctlr->tft = Ctft64;
+
+		if(vt6102reset(ctlr)){
+			free(ctlr);
+			continue;
+		}
+		pcisetbme(p);
+
+		if(vt6102ctlrhead != nil)
+			vt6102ctlrtail->next = ctlr;
+		else
+			vt6102ctlrhead = ctlr;
+		vt6102ctlrtail = ctlr;
+	}
+}
+
+static int
+vt6102pnp(Ether* edev)
+{
+	Ctlr *ctlr;
+
+	if(vt6102ctlrhead == nil)
+		vt6102pci();
+
+	/*
+	 * Any adapter matches if no edev->port is supplied,
+	 * otherwise the ports must match.
+	 */
+	for(ctlr = vt6102ctlrhead; ctlr != nil; ctlr = ctlr->next){
+		if(ctlr->active)
+			continue;
+		if(edev->port == 0 || edev->port == ctlr->port){
+			ctlr->active = 1;
+			break;
+		}
+	}
+	if(ctlr == nil)
+		return -1;
+
+	edev->ctlr = ctlr;
+	edev->port = ctlr->port;
+	edev->irq = ctlr->pcidev->intl;
+	edev->tbdf = ctlr->pcidev->tbdf;
+	edev->mbps = 100;
+	memmove(edev->ea, ctlr->par, Eaddrlen);
+
+	/*
+	 * Linkage to the generic ethernet driver.
+	 */
+	edev->attach = vt6102attach;
+	edev->transmit = vt6102transmit;
+	edev->interrupt = vt6102interrupt;
+	edev->ifstat = vt6102ifstat;
+	edev->ctl = nil;
+
+	edev->arg = edev;
+	edev->promiscuous = vt6102promiscuous;
+	edev->multicast = vt6102multicast;
+
+	return 0;
+}
+
+void
+ethervt6102link(void)
+{
+	addethercard("vt6102", vt6102pnp);
+	addethercard("rhine", vt6102pnp);
+}

+ 3 - 0
sys/src/9/pc/pcmkfile

@@ -0,0 +1,3 @@
+PCFILES=`{../port/mkfilelist ../pc}
+^($PCFILES)\.$O:R:	'../pc/\1.c'
+	$CC $CFLAGS -OI. ../pc/$stem1.c

+ 16 - 16
sys/src/9/port/mkdevc

@@ -19,11 +19,11 @@ collect && section ~ "dev"{
 		dev[ndev++] = $1;
 		if($1 ~ "ad")
 			devad = 1;
-		if($1 ~ "sd")
+		else if($1 ~ "sd")
 			devsd = 1;
-		if($1 ~ "uart")
+		else if($1 ~ "uart")
 			devuart = 1;
-		if($1 ~ "vga")
+		else if($1 ~ "vga")
 			devvga = 1;
 }
 collect && section ~ "ip"{
@@ -36,11 +36,11 @@ collect && section ~ "misc"{
 		misc[nmisc++] = $1;
 		if($1 ~ "^arch.*")
 			arch[narch++] = $1;
-		if($1 ~ "^ad.*")
+		else if($1 ~ "^ad.*")
 			adifc[nadifc++] = $1;
-		if($1 ~ "^sd.*")
+		else if($1 ~ "^sd.*")
 			sdifc[nsdifc++] = $1;
-		if($1 ~ "^uart.*")
+		else if($1 ~ "^uart.*")
 			physuart[nphysuart++] = substr($1, 5, length($1)-4) "physuart";
 		else if($1 ~ "^vga.*"){
 			if(NF == 1)
@@ -69,17 +69,17 @@ END{
 		if(ARGC < 2)
 			exit "usage"
 
-		printf "#include \"u.h\"\n"
-		printf "#include \"../port/lib.h\"\n"
-		printf "#include \"mem.h\"\n"
-		printf "#include \"dat.h\"\n"
-		printf "#include \"fns.h\"\n"
-		printf "#include \"io.h\"\n"
-		printf "#include \"../port/error.h\"\n\n"
+		printf "#include \"u.h\"\n";
+		printf "#include \"../port/lib.h\"\n";
+		printf "#include \"mem.h\"\n";
+		printf "#include \"dat.h\"\n";
+		printf "#include \"fns.h\"\n";
+		printf "#include \"io.h\"\n";
+		printf "#include \"../port/error.h\"\n\n";
 
 		for(i = 0; i < ndev; i++)
 			printf "extern Dev %sdevtab;\n", dev[i];
-		printf "Dev* devtab[]={\n"
+		printf "Dev* devtab[]={\n";
 		for(i = 0; i < ndev; i++)
 			printf "\t&%sdevtab,\n", dev[i];
 		printf "\tnil,\n};\n\n";
@@ -135,8 +135,8 @@ END{
 			printf "#define	Image	IMAGE\n";
 			printf "#include <draw.h>\n";
 			printf "#include <memdraw.h>\n";
-			printf "#include <cursor.h>\n"
-			printf "#include \"screen.h\"\n"
+			printf "#include <cursor.h>\n";
+			printf "#include \"screen.h\"\n";
 
 			for(i = 0; i < nvgadev; i++)
 				printf "extern VGAdev %sdev;\n", vgadev[i];

+ 12 - 0
sys/src/9/port/mkfilelist

@@ -0,0 +1,12 @@
+#!/bin/rc
+
+rfork e
+switch($#*){
+case 1
+	RE=`{echo *.c | sed 's/ /|/g; s/.*/^(&)$/'}
+	LIST=`{builtin cd $1; ls *.c | grep -v ''$RE''}
+	echo $LIST | sed 's/\.c//g; s/ +/|/g'
+case *
+	exit 'usage'
+}
+exit ''

+ 4 - 4
sys/src/9/port/portmkfile

@@ -1,8 +1,8 @@
-PFILES=`{builtin cd ../port;echo *.c | sed 's/ /|/g; s/\.c//g'}
-^($PFILES)\.$O:R:	'../port/\1.c'
+PORTFILES=`{../port/mkfilelist ../port}
+^($PORTFILES)\.$O:R:	'../port/\1.c'
 	$CC $CFLAGS -I. ../port/$stem1.c
 
-IPFILES=`{builtin cd ../ip;echo *.c | sed 's/ /|/g; s/\.c//g'}
+IPFILES=`{../port/mkfilelist ../ip}
 ^($IPFILES)\.$O:R:	'../ip/\1.c' ../ip/ip.h
 	$CC $CFLAGS -I. ../ip/$stem1.c
 
@@ -30,7 +30,7 @@ all:V:
 		mk 'CONF='$i
 
 clean:V:
-	rm -f *.[$OS] *.root.s *.rootc.c cfs.h fs.h init.h conf.h *.out
+	rm -f *.[$OS] *.root.s *.rootc.c cfs.h fs.h init.h conf.h *.out *.m
 	for(i in $CONFLIST)
 		mk $i.clean
 

+ 2 - 1
sys/src/cmd/cc/lex.c

@@ -142,7 +142,8 @@ compile(char *file, char **defs, int ndef)
 	p = utfrrune(ofile, pathchar());
 	if(p) {
 		*p++ = 0;
-		include[0] = strdup(ofile);
+		if(!debug['O'])
+			include[0] = strdup(ofile);
 	} else
 		p = ofile;
 	if(outfile == 0) {