Browse Source

Plan 9 from Bell Labs 2008-01-10

David du Colombier 16 years ago
parent
commit
74a1c61f80

+ 29 - 29
dist/replica/_plan9.db

@@ -1,17 +1,17 @@
 386 - 20000000775 sys sys 1010957353 0
-386/9load - 775 sys sys 1194656609 337588
-386/9loaddebug - 775 sys sys 1194656621 451256
-386/9loadlite - 775 sys sys 1194656625 161052
-386/9loadlitedebug - 775 sys sys 1194656629 237051
-386/9pc - 775 sys sys 1192646200 2054406
-386/9pc.gz - 664 sys sys 1192646200 873537
-386/9pccpu - 775 sys sys 1191889923 1749481
-386/9pccpu.gz - 664 sys sys 1191889923 755214
-386/9pcdisk - 775 sys sys 1192741561 2286983
-386/9pcdisk.gz - 664 sys sys 1192741561 973813
-386/9pcf - 775 sys sys 1191889940 2874011
-386/9pcf.gz - 664 sys sys 1191889940 1230163
-386/9pxeload - 775 sys sys 1194656635 337592
+386/9load - 775 sys sys 1199773340 338424
+386/9loaddebug - 775 sys sys 1199773344 452196
+386/9loadlite - 775 sys sys 1199773342 161880
+386/9loadlitedebug - 775 sys sys 1199773345 237979
+386/9pc - 775 sys sys 1199915489 2057282
+386/9pc.gz - 664 sys sys 1199915503 874495
+386/9pccpu - 775 sys sys 1199915538 2140826
+386/9pccpu.gz - 664 sys sys 1199915553 880179
+386/9pcdisk - 775 sys sys 1199915609 2289664
+386/9pcdisk.gz - 664 sys sys 1199915627 974761
+386/9pcf - 775 sys sys 1199915834 2959354
+386/9pcf.gz - 664 sys sys 1199915855 1259122
+386/9pxeload - 775 sys sys 1199773341 338432
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1168402260 116604
 386/bin/8c - 775 sys sys 1190520740 367214
@@ -6233,7 +6233,7 @@ sys/lib/dist/pc/glenda/tmp - 20000000775 sys sys 1020895855 0
 sys/lib/dist/pc/inst - 20000000775 sys sys 1112535189 0
 sys/lib/dist/pc/inst/bootfloppy - 775 sys sys 1112361036 903
 sys/lib/dist/pc/inst/bootplan9 - 775 sys sys 1113252317 1574
-sys/lib/dist/pc/inst/bootsetup - 775 sys sys 1116595009 3542
+sys/lib/dist/pc/inst/bootsetup - 775 sys sys 1199896403 3638
 sys/lib/dist/pc/inst/bootwin9x - 775 sys sys 1112361037 2527
 sys/lib/dist/pc/inst/bootwinnt - 775 sys sys 1019240165 1041
 sys/lib/dist/pc/inst/configarch - 775 sys sys 1018640312 636
@@ -6281,9 +6281,9 @@ sys/lib/dist/pc/inst/watchfd - 775 sys sys 1127670125 362
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
 sys/lib/dist/pc/mkfile - 664 sys sys 1168307754 2210
 sys/lib/dist/pc/multi - 20000000775 sys sys 1147022870 0
-sys/lib/dist/pc/plan9.ini - 664 sys sys 1194032589 585
+sys/lib/dist/pc/plan9.ini - 664 sys sys 1199896362 585
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
-sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1194032364 562
+sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1199896391 564
 sys/lib/dist/pc/plan9.ini.vmware - 664 sys sys 1045500078 168
 sys/lib/dist/pc/proto - 664 sys sys 1169484200 5564
 sys/lib/dist/pc/sub - 20000000775 sys sys 1063856127 0
@@ -8068,7 +8068,7 @@ sys/src/9/mtx/trap.c - 664 sys sys 1197062170 15881
 sys/src/9/mtx/uarti8250.c - 664 sys sys 1018721288 11590
 sys/src/9/pc - 20000000775 sys sys 1161233143 0
 sys/src/9/pc/a100p.cp - 444 sys sys 1159735144 21984
-sys/src/9/pc/ahci.h - 664 sys sys 1191538081 6316
+sys/src/9/pc/ahci.h - 664 sys sys 1199910642 6281
 sys/src/9/pc/apbootstrap.s - 664 sys sys 1131293655 3037
 sys/src/9/pc/apic.c - 664 sys sys 1174415344 8991
 sys/src/9/pc/apm.c - 664 sys sys 1131290210 3723
@@ -8101,7 +8101,7 @@ sys/src/9/pc/ether8139.c - 664 sys sys 1185650567 19974
 sys/src/9/pc/ether8169.c - 664 sys sys 1185812348 26931
 sys/src/9/pc/ether82543gc.c - 664 sys sys 1131290377 32294
 sys/src/9/pc/ether82557.c - 664 sys sys 1191886292 30411
-sys/src/9/pc/ether82563.c - 664 sys sys 1198011483 34697
+sys/src/9/pc/ether82563.c - 664 sys sys 1199920348 36758
 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
@@ -8112,7 +8112,7 @@ sys/src/9/pc/etherga620.c - 664 sys sys 1185652495 29895
 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 1194796690 45327
-sys/src/9/pc/etherm10g.c - 664 sys sys 1196312384 28472
+sys/src/9/pc/etherm10g.c - 664 sys sys 1199912528 28463
 sys/src/9/pc/etherm10g2k.i - 664 sys sys 1174590360 957485
 sys/src/9/pc/etherm10g4k.i - 664 sys sys 1174590362 926959
 sys/src/9/pc/ethermii.c - 664 sys sys 1181160689 4668
@@ -8166,8 +8166,8 @@ sys/src/9/pc/sd53c8xx.c - 664 sys sys 1170456695 55276
 sys/src/9/pc/sd53c8xx.i - 664 sys sys 1128547230 28453
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
 sys/src/9/pc/sdata.c - 664 sys sys 1186361525 52991
-sys/src/9/pc/sdiahci.c - 664 sys sys 1199838426 38374
-sys/src/9/pc/sdmv50xx.c - 664 sys sys 1184467229 33837
+sys/src/9/pc/sdiahci.c - 664 sys sys 1199915722 38422
+sys/src/9/pc/sdmv50xx.c - 664 sys sys 1199910989 33838
 sys/src/9/pc/sdmylex.c - 664 sys sys 1189229947 28395
 sys/src/9/pc/sdscsi.c - 664 sys sys 1186618532 7957
 sys/src/9/pc/trap.c - 664 sys sys 1197062171 21897
@@ -8216,7 +8216,7 @@ sys/src/9/port/chan.c - 664 sys sys 1195585806 34962
 sys/src/9/port/cis.c - 664 sys sys 1099761153 9248
 sys/src/9/port/debugalloc.c - 664 sys sys 1014931171 10402
 sys/src/9/port/dev.c - 664 sys sys 1146151714 8177
-sys/src/9/port/devaoe.c - 664 sys sys 1196312093 42085
+sys/src/9/port/devaoe.c - 664 sys sys 1199910511 42083
 sys/src/9/port/devaudio.c - 664 sys sys 1170456648 21199
 sys/src/9/port/devbridge.c - 664 sys sys 1187735844 24076
 sys/src/9/port/devcap.c - 664 sys sys 1178886040 4141
@@ -8283,7 +8283,7 @@ sys/src/9/port/qlock.c - 664 sys sys 1178057654 3300
 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 1186618553 2499
-sys/src/9/port/sdaoe.c - 664 sys sys 1194752512 9922
+sys/src/9/port/sdaoe.c - 664 sys sys 1199910517 9920
 sys/src/9/port/segment.c - 664 sys sys 1170456581 14052
 sys/src/9/port/semaphore.p - 664 sys sys 1143129797 2424
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
@@ -9145,7 +9145,7 @@ sys/src/boot/bitsy/uart.c - 664 sys sys 1173299930 1495
 sys/src/boot/mkfile - 664 sys sys 1173300033 192
 sys/src/boot/pc - 20000000775 sys sys 1144961189 0
 sys/src/boot/pc/8250.c - 664 sys sys 1015007947 5727
-sys/src/boot/pc/ahci.h - 664 sys sys 1186366104 6318
+sys/src/boot/pc/ahci.h - 664 sys sys 1199911245 6283
 sys/src/boot/pc/alarm.c - 664 sys sys 1015007947 1668
 sys/src/boot/pc/aoe.h - 664 sys sys 1193336543 826
 sys/src/boot/pc/apm.c - 664 sys sys 1015007947 289
@@ -9191,10 +9191,10 @@ sys/src/boot/pc/etherelnk3x.c - 664 sys sys 1015007951 24989
 sys/src/boot/pc/etherga620.c - 664 sys sys 1175289484 27168
 sys/src/boot/pc/etherga620fw.h - 664 sys sys 1174080072 222295
 sys/src/boot/pc/etherif.h - 664 sys sys 1174077279 1338
-sys/src/boot/pc/etherigbe.c - 664 sys sys 1194796683 41188
+sys/src/boot/pc/etherigbe.c - 664 sys sys 1199911516 41407
 sys/src/boot/pc/ethermii.c - 664 sys sys 1103641771 4413
 sys/src/boot/pc/ethermii.h - 664 sys sys 1071175087 3259
-sys/src/boot/pc/etherrhine.c - 664 sys sys 1194655423 12729
+sys/src/boot/pc/etherrhine.c - 664 sys sys 1199911576 12759
 sys/src/boot/pc/fns.h - 664 sys sys 1193171343 4880
 sys/src/boot/pc/fs.c - 664 sys sys 1094674483 1509
 sys/src/boot/pc/fs.h - 664 sys sys 1094674488 653
@@ -9226,10 +9226,10 @@ sys/src/boot/pc/queue.c - 664 sys sys 1015007954 566
 sys/src/boot/pc/sd.h - 664 sys sys 1153333456 2244
 sys/src/boot/pc/sd53c8xx.c - 664 sys sys 1186031515 52082
 sys/src/boot/pc/sd53c8xx.i - 664 sys sys 1015007955 27245
-sys/src/boot/pc/sdaoe.c - 664 sys sys 1193341405 11270
-sys/src/boot/pc/sdata.c - 664 sys sys 1175564193 38846
+sys/src/boot/pc/sdaoe.c - 664 sys sys 1199911246 11268
+sys/src/boot/pc/sdata.c - 664 sys sys 1199911580 38891
 sys/src/boot/pc/sdbios.c - 664 sys sys 1194145651 3282
-sys/src/boot/pc/sdiahci.c - 664 sys sys 1199773527 28014
+sys/src/boot/pc/sdiahci.c - 664 sys sys 1199911456 28029
 sys/src/boot/pc/sdmylex.c - 664 sys sys 1171783051 28694
 sys/src/boot/pc/sdscsi.c - 664 sys sys 1144961224 7006
 sys/src/boot/pc/trap.c - 664 sys sys 1193167011 7497

+ 29 - 29
dist/replica/plan9.db

@@ -1,17 +1,17 @@
 386 - 20000000775 sys sys 1010957353 0
-386/9load - 775 sys sys 1194656609 337588
-386/9loaddebug - 775 sys sys 1194656621 451256
-386/9loadlite - 775 sys sys 1194656625 161052
-386/9loadlitedebug - 775 sys sys 1194656629 237051
-386/9pc - 775 sys sys 1192646200 2054406
-386/9pc.gz - 664 sys sys 1192646200 873537
-386/9pccpu - 775 sys sys 1191889923 1749481
-386/9pccpu.gz - 664 sys sys 1191889923 755214
-386/9pcdisk - 775 sys sys 1192741561 2286983
-386/9pcdisk.gz - 664 sys sys 1192741561 973813
-386/9pcf - 775 sys sys 1191889940 2874011
-386/9pcf.gz - 664 sys sys 1191889940 1230163
-386/9pxeload - 775 sys sys 1194656635 337592
+386/9load - 775 sys sys 1199773340 338424
+386/9loaddebug - 775 sys sys 1199773344 452196
+386/9loadlite - 775 sys sys 1199773342 161880
+386/9loadlitedebug - 775 sys sys 1199773345 237979
+386/9pc - 775 sys sys 1199915489 2057282
+386/9pc.gz - 664 sys sys 1199915503 874495
+386/9pccpu - 775 sys sys 1199915538 2140826
+386/9pccpu.gz - 664 sys sys 1199915553 880179
+386/9pcdisk - 775 sys sys 1199915609 2289664
+386/9pcdisk.gz - 664 sys sys 1199915627 974761
+386/9pcf - 775 sys sys 1199915834 2959354
+386/9pcf.gz - 664 sys sys 1199915855 1259122
+386/9pxeload - 775 sys sys 1199773341 338432
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1168402260 116604
 386/bin/8c - 775 sys sys 1190520740 367214
@@ -6233,7 +6233,7 @@ sys/lib/dist/pc/glenda/tmp - 20000000775 sys sys 1020895855 0
 sys/lib/dist/pc/inst - 20000000775 sys sys 1112535189 0
 sys/lib/dist/pc/inst/bootfloppy - 775 sys sys 1112361036 903
 sys/lib/dist/pc/inst/bootplan9 - 775 sys sys 1113252317 1574
-sys/lib/dist/pc/inst/bootsetup - 775 sys sys 1116595009 3542
+sys/lib/dist/pc/inst/bootsetup - 775 sys sys 1199896403 3638
 sys/lib/dist/pc/inst/bootwin9x - 775 sys sys 1112361037 2527
 sys/lib/dist/pc/inst/bootwinnt - 775 sys sys 1019240165 1041
 sys/lib/dist/pc/inst/configarch - 775 sys sys 1018640312 636
@@ -6281,9 +6281,9 @@ sys/lib/dist/pc/inst/watchfd - 775 sys sys 1127670125 362
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
 sys/lib/dist/pc/mkfile - 664 sys sys 1168307754 2210
 sys/lib/dist/pc/multi - 20000000775 sys sys 1147022870 0
-sys/lib/dist/pc/plan9.ini - 664 sys sys 1194032589 585
+sys/lib/dist/pc/plan9.ini - 664 sys sys 1199896362 585
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
-sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1194032364 562
+sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1199896391 564
 sys/lib/dist/pc/plan9.ini.vmware - 664 sys sys 1045500078 168
 sys/lib/dist/pc/proto - 664 sys sys 1169484200 5564
 sys/lib/dist/pc/sub - 20000000775 sys sys 1063856127 0
@@ -8068,7 +8068,7 @@ sys/src/9/mtx/trap.c - 664 sys sys 1197062170 15881
 sys/src/9/mtx/uarti8250.c - 664 sys sys 1018721288 11590
 sys/src/9/pc - 20000000775 sys sys 1161233143 0
 sys/src/9/pc/a100p.cp - 444 sys sys 1159735144 21984
-sys/src/9/pc/ahci.h - 664 sys sys 1191538081 6316
+sys/src/9/pc/ahci.h - 664 sys sys 1199910642 6281
 sys/src/9/pc/apbootstrap.s - 664 sys sys 1131293655 3037
 sys/src/9/pc/apic.c - 664 sys sys 1174415344 8991
 sys/src/9/pc/apm.c - 664 sys sys 1131290210 3723
@@ -8101,7 +8101,7 @@ sys/src/9/pc/ether8139.c - 664 sys sys 1185650567 19974
 sys/src/9/pc/ether8169.c - 664 sys sys 1185812348 26931
 sys/src/9/pc/ether82543gc.c - 664 sys sys 1131290377 32294
 sys/src/9/pc/ether82557.c - 664 sys sys 1191886292 30411
-sys/src/9/pc/ether82563.c - 664 sys sys 1198011483 34697
+sys/src/9/pc/ether82563.c - 664 sys sys 1199920348 36758
 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
@@ -8112,7 +8112,7 @@ sys/src/9/pc/etherga620.c - 664 sys sys 1185652495 29895
 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 1194796690 45327
-sys/src/9/pc/etherm10g.c - 664 sys sys 1196312384 28472
+sys/src/9/pc/etherm10g.c - 664 sys sys 1199912528 28463
 sys/src/9/pc/etherm10g2k.i - 664 sys sys 1174590360 957485
 sys/src/9/pc/etherm10g4k.i - 664 sys sys 1174590362 926959
 sys/src/9/pc/ethermii.c - 664 sys sys 1181160689 4668
@@ -8166,8 +8166,8 @@ sys/src/9/pc/sd53c8xx.c - 664 sys sys 1170456695 55276
 sys/src/9/pc/sd53c8xx.i - 664 sys sys 1128547230 28453
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
 sys/src/9/pc/sdata.c - 664 sys sys 1186361525 52991
-sys/src/9/pc/sdiahci.c - 664 sys sys 1199838426 38374
-sys/src/9/pc/sdmv50xx.c - 664 sys sys 1184467229 33837
+sys/src/9/pc/sdiahci.c - 664 sys sys 1199915722 38422
+sys/src/9/pc/sdmv50xx.c - 664 sys sys 1199910989 33838
 sys/src/9/pc/sdmylex.c - 664 sys sys 1189229947 28395
 sys/src/9/pc/sdscsi.c - 664 sys sys 1186618532 7957
 sys/src/9/pc/trap.c - 664 sys sys 1197062171 21897
@@ -8216,7 +8216,7 @@ sys/src/9/port/chan.c - 664 sys sys 1195585806 34962
 sys/src/9/port/cis.c - 664 sys sys 1099761153 9248
 sys/src/9/port/debugalloc.c - 664 sys sys 1014931171 10402
 sys/src/9/port/dev.c - 664 sys sys 1146151714 8177
-sys/src/9/port/devaoe.c - 664 sys sys 1196312093 42085
+sys/src/9/port/devaoe.c - 664 sys sys 1199910511 42083
 sys/src/9/port/devaudio.c - 664 sys sys 1170456648 21199
 sys/src/9/port/devbridge.c - 664 sys sys 1187735844 24076
 sys/src/9/port/devcap.c - 664 sys sys 1178886040 4141
@@ -8283,7 +8283,7 @@ sys/src/9/port/qlock.c - 664 sys sys 1178057654 3300
 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 1186618553 2499
-sys/src/9/port/sdaoe.c - 664 sys sys 1194752512 9922
+sys/src/9/port/sdaoe.c - 664 sys sys 1199910517 9920
 sys/src/9/port/segment.c - 664 sys sys 1170456581 14052
 sys/src/9/port/semaphore.p - 664 sys sys 1143129797 2424
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
@@ -9145,7 +9145,7 @@ sys/src/boot/bitsy/uart.c - 664 sys sys 1173299930 1495
 sys/src/boot/mkfile - 664 sys sys 1173300033 192
 sys/src/boot/pc - 20000000775 sys sys 1144961189 0
 sys/src/boot/pc/8250.c - 664 sys sys 1015007947 5727
-sys/src/boot/pc/ahci.h - 664 sys sys 1186366104 6318
+sys/src/boot/pc/ahci.h - 664 sys sys 1199911245 6283
 sys/src/boot/pc/alarm.c - 664 sys sys 1015007947 1668
 sys/src/boot/pc/aoe.h - 664 sys sys 1193336543 826
 sys/src/boot/pc/apm.c - 664 sys sys 1015007947 289
@@ -9191,10 +9191,10 @@ sys/src/boot/pc/etherelnk3x.c - 664 sys sys 1015007951 24989
 sys/src/boot/pc/etherga620.c - 664 sys sys 1175289484 27168
 sys/src/boot/pc/etherga620fw.h - 664 sys sys 1174080072 222295
 sys/src/boot/pc/etherif.h - 664 sys sys 1174077279 1338
-sys/src/boot/pc/etherigbe.c - 664 sys sys 1194796683 41188
+sys/src/boot/pc/etherigbe.c - 664 sys sys 1199911516 41407
 sys/src/boot/pc/ethermii.c - 664 sys sys 1103641771 4413
 sys/src/boot/pc/ethermii.h - 664 sys sys 1071175087 3259
-sys/src/boot/pc/etherrhine.c - 664 sys sys 1194655423 12729
+sys/src/boot/pc/etherrhine.c - 664 sys sys 1199911576 12759
 sys/src/boot/pc/fns.h - 664 sys sys 1193171343 4880
 sys/src/boot/pc/fs.c - 664 sys sys 1094674483 1509
 sys/src/boot/pc/fs.h - 664 sys sys 1094674488 653
@@ -9226,10 +9226,10 @@ sys/src/boot/pc/queue.c - 664 sys sys 1015007954 566
 sys/src/boot/pc/sd.h - 664 sys sys 1153333456 2244
 sys/src/boot/pc/sd53c8xx.c - 664 sys sys 1186031515 52082
 sys/src/boot/pc/sd53c8xx.i - 664 sys sys 1015007955 27245
-sys/src/boot/pc/sdaoe.c - 664 sys sys 1193341405 11270
-sys/src/boot/pc/sdata.c - 664 sys sys 1175564193 38846
+sys/src/boot/pc/sdaoe.c - 664 sys sys 1199911246 11268
+sys/src/boot/pc/sdata.c - 664 sys sys 1199911580 38891
 sys/src/boot/pc/sdbios.c - 664 sys sys 1194145651 3282
-sys/src/boot/pc/sdiahci.c - 664 sys sys 1199773527 28014
+sys/src/boot/pc/sdiahci.c - 664 sys sys 1199911456 28029
 sys/src/boot/pc/sdmylex.c - 664 sys sys 1171783051 28694
 sys/src/boot/pc/sdscsi.c - 664 sys sys 1144961224 7006
 sys/src/boot/pc/trap.c - 664 sys sys 1193167011 7497

+ 32 - 0
dist/replica/plan9.log

@@ -18240,3 +18240,35 @@
 1199772005 0 c sys/src/boot/pc/ether82563.c - 664 sys sys 1199772483 25481
 1199773804 0 c sys/src/boot/pc/sdiahci.c - 664 sys sys 1199773527 28014
 1199838604 0 c sys/src/9/pc/sdiahci.c - 664 sys sys 1199838426 38374
+1199896204 0 c 386/9load - 775 sys sys 1199773340 338424
+1199896204 1 c 386/9loaddebug - 775 sys sys 1199773344 452196
+1199896204 2 c 386/9loadlite - 775 sys sys 1199773342 161880
+1199896204 3 c 386/9loadlitedebug - 775 sys sys 1199773345 237979
+1199896204 4 c 386/9pxeload - 775 sys sys 1199773341 338432
+1199898015 0 c sys/lib/dist/pc/inst/bootsetup - 775 sys sys 1199896403 3638
+1199898015 1 c sys/lib/dist/pc/plan9.ini - 664 sys sys 1199896362 585
+1199898015 2 c sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1199896391 564
+1199910603 0 c sys/src/9/pc/ahci.h - 664 sys sys 1199910642 6281
+1199910603 1 c sys/src/9/pc/etherm10g.c - 664 sys sys 1199910709 28432
+1199910603 2 c sys/src/9/port/devaoe.c - 664 sys sys 1199910511 42083
+1199910603 3 c sys/src/9/port/sdaoe.c - 664 sys sys 1199910517 9920
+1199912403 0 c sys/src/9/pc/etherm10g.c - 664 sys sys 1199912528 28463
+1199912403 1 c sys/src/9/pc/sdiahci.c - 664 sys sys 1199912186 38408
+1199912403 2 c sys/src/9/pc/sdmv50xx.c - 664 sys sys 1199910989 33838
+1199912403 3 c sys/src/boot/pc/etherigbe.c - 664 sys sys 1199911516 41407
+1199912403 4 c sys/src/boot/pc/etherrhine.c - 664 sys sys 1199911576 12759
+1199912403 5 c sys/src/boot/pc/sdata.c - 664 sys sys 1199911580 38891
+1199912403 6 c sys/src/boot/pc/ahci.h - 664 sys sys 1199911245 6283
+1199912403 7 c sys/src/boot/pc/sdaoe.c - 664 sys sys 1199911246 11268
+1199912403 8 c sys/src/boot/pc/sdiahci.c - 664 sys sys 1199911456 28029
+1199916004 0 c 386/9pc - 775 sys sys 1199915489 2057282
+1199916004 1 c 386/9pc.gz - 664 sys sys 1199915503 874495
+1199916004 2 c 386/9pccpu - 775 sys sys 1199915538 2140826
+1199916004 3 c 386/9pccpu.gz - 664 sys sys 1199915553 880179
+1199916004 4 c 386/9pcdisk - 775 sys sys 1199915609 2289664
+1199916004 5 c 386/9pcdisk.gz - 664 sys sys 1199915627 974761
+1199916004 6 c 386/9pcf - 775 sys sys 1199915834 2959354
+1199916004 7 c 386/9pcf.gz - 664 sys sys 1199915855 1259122
+1199916004 8 c sys/src/9/pc/ether82563.c - 664 sys sys 1199915298 36798
+1199916004 9 c sys/src/9/pc/sdiahci.c - 664 sys sys 1199915722 38422
+1199921403 0 c sys/src/9/pc/ether82563.c - 664 sys sys 1199920348 36758

+ 4 - 1
sys/lib/dist/pc/inst/bootsetup

@@ -35,7 +35,10 @@ case go
 				venti=`{echo $ventiarena | sed 's;/dev;#S;'}
 				echo venti'='^$venti
 			}
-			grep -v '(^\[)|menuitem|adisk|bootfile|bootdisk|bootargs|nobootprompt|mouseport|vgasize|monitor|cdboot' /tmp/plan9.orig
+			# sort -u avoids dups which could otherwise trigger
+			# pointless boot menus.
+			grep -v '(^\[)|menuitem|adisk|bootfile|bootdisk|bootargs|nobootprompt|mouseport|vgasize|monitor|cdboot' |
+				sort -u /tmp/plan9.orig
 			echo 'mouseport='^$mouseport
 			echo 'monitor='^$monitor
 			echo 'vgasize='^$vgasize

+ 2 - 2
sys/lib/dist/pc/plan9.ini

@@ -1,7 +1,7 @@
 [menu]
 menuitem=boot, Boot Plan 9
 menuitem=debug, Boot Plan 9 and debug 9load
-menudefault=debug, 10
+menudefault=boot, 10
 
 [common]
 *nomp=1
@@ -24,7 +24,7 @@ installurl=http://plan9.bell-labs.com/plan9/download/plan9.iso.bz2
 bootargs=local!#S/sdD0/data
 bootfile=sdD0!cdboot!9pccd.gz
 *nobiosload=1
-*noahciload=1
+#*noahciload=1
 
 [debug]
 bootargs=local!#S/sdD0/data

+ 2 - 2
sys/lib/dist/pc/plan9.ini.cd

@@ -18,13 +18,13 @@ cdboot=yes
 nobootprompt=local!/boot/bzroot
 bootfile=sdD0!cdboot!9pcflop.gz
 *nobiosload=1
-*noahciload=1
+#*noahciload=1
 
 [cdboot]
 bootargs=local!#S/sdD0/data
 bootfile=sdD0!cdboot!9pccd.gz
 *nobiosload=1
-*noahciload=1
+#*noahciload=1
 
 [debug]
 bootargs=local!#S/sdD0/data

+ 35 - 35
sys/src/9/pc/ahci.h

@@ -78,15 +78,15 @@ enum {
 };
 
 typedef struct {
-	u32int	cap;
-	u32int	ghc;
-	u32int	isr;
-	u32int	pi;		/* ports implemented */
-	u32int	ver;
-	u32int	ccc;		/* coaleasing control */
-	u32int	cccports;
-	u32int	emloc;
-	u32int	emctl;
+	ulong	cap;
+	ulong	ghc;
+	ulong	isr;
+	ulong	pi;		/* ports implemented */
+	ulong	ver;
+	ulong	ccc;		/* coaleasing control */
+	ulong	cccports;
+	ulong	emloc;
+	ulong	emctl;
 } Ahba;
 
 enum {
@@ -179,24 +179,24 @@ enum {
 #define	sactive	scr3
 
 typedef struct {
-	u32int	list;		/* PxCLB must be 1kb aligned. */
-	u32int	listhi;
-	u32int	fis;		/* 256-byte aligned */
-	u32int	fishi;
-	u32int	isr;
-	u32int	ie;		/* interrupt enable */
-	u32int	cmd;
-	u32int	res1;
-	u32int	task;
-	u32int	sig;
-	u32int	scr0;
-	u32int	scr2;
-	u32int	scr1;
-	u32int	scr3;
-	u32int	ci;		/* command issue */
-	u32int	ntf;
+	ulong	list;		/* PxCLB must be 1kb aligned. */
+	ulong	listhi;
+	ulong	fis;		/* 256-byte aligned */
+	ulong	fishi;
+	ulong	isr;
+	ulong	ie;		/* interrupt enable */
+	ulong	cmd;
+	ulong	res1;
+	ulong	task;
+	ulong	sig;
+	ulong	scr0;
+	ulong	scr2;
+	ulong	scr1;
+	ulong	scr3;
+	ulong	ci;		/* command issue */
+	ulong	ntf;
 	uchar	res2[8];
-	u32int	vendor;
+	ulong	vendor;
 } Aport;
 
 /* in host's memory; not memory mapped */
@@ -206,7 +206,7 @@ typedef struct {
 	uchar	*p;
 	uchar	*r;
 	uchar	*u;
-	u32int	*devicebits;
+	ulong	*devicebits;
 } Afis;
 
 enum {
@@ -223,18 +223,18 @@ enum {
 
 /* in hosts memory; memory mapped */
 typedef struct {
-	u32int	flags;
-	u32int	len;
-	u32int	ctab;
-	u32int	ctabhi;
+	ulong	flags;
+	ulong	len;
+	ulong	ctab;
+	ulong	ctabhi;
 	uchar	reserved[16];
 } Alist;
 
 typedef struct {
-	u32int	dba;
-	u32int	dbahi;
-	u32int	pad;
-	u32int	count;
+	ulong	dba;
+	ulong	dbahi;
+	ulong	pad;
+	ulong	count;
 } Aprdt;
 
 typedef struct {

+ 119 - 11
sys/src/9/pc/ether82563.c

@@ -357,6 +357,33 @@ enum {					/* Tdesc status */
 	CssSHIFT	= 8,
 };
 
+typedef struct {
+	ushort	*reg;
+	ulong	*reg32;
+	int	sz;
+} Flash;
+
+enum {
+	/* 16 and 32-bit flash registers for ich flash parts */
+	Bfpr	= 0x00/4,		/* flash base 0:12; lim 16:28 */
+	Fsts	= 0x04/2,		/* flash status; Hsfs */
+	Fctl	= 0x06/2,		/* flash control */
+	Faddr	= 0x08/4,		/* flash address to r/w */
+	Fdata	= 0x10/4,		/* data @ address */
+
+	/* status register */
+	Fdone	= 1<<0,			/* flash cycle done */
+	Fcerr	= 1<<1,			/* cycle error; write 1 to clear */
+	Ael	= 1<<2,			/* direct access error log; 1 to clear */
+	Scip	= 1<<5,			/* spi cycle in progress */
+	Fvalid	= 1<<14,		/* flash descriptor valid */
+
+	/* control register */
+	Fgo	= 1<<0,			/* start cycle */
+	Flcycle	= 1<<1,			/* two bits: r=0; w=2 */
+	Fdbc	= 1<<8,			/* bytes to read; 5 bits */
+};
+
 enum {
 	Nrd		= 256,		/* power of two */
 	Ntd		= 128,		/* power of two */
@@ -364,6 +391,7 @@ enum {
 };
 
 enum {
+	Iany,
 	i82563,
 	i82566,
 	i82571,
@@ -372,6 +400,7 @@ enum {
 };
 
 static int rbtab[] = {
+	0,
 	9014,
 	1514,
 	9234,
@@ -380,13 +409,13 @@ static int rbtab[] = {
 };
 
 static char *tname[] = {
+	"any",
 	"i82563",
 	"i82566",
 	"i82571",
 	"i82572",
 	"i82573",
 };
-#define Type	tname[ctlr->type]
 
 typedef struct Ctlr Ctlr;
 struct Ctlr {
@@ -441,7 +470,6 @@ struct Ctlr {
 	Rendez	trendez;
 	QLock	tlock;
 	int	tbusy;
-	int	tdfree;
 	Td	*tdba;			/* transmit descriptor base address */
 	Block	**tb;			/* transmit buffers */
 	int	tdh;			/* transmit descriptor head */
@@ -598,7 +626,7 @@ i82563ifstat(Ether* edev, void* a, long n, ulong offset)
 
 	p = seprint(p, e, "speeds: 10:%ud 100:%ud 1000:%ud ?:%ud\n",
 		ctlr->speeds[0], ctlr->speeds[1], ctlr->speeds[2], ctlr->speeds[3]);
-	p = seprint(p, e, "type: %s\n", Type);
+	p = seprint(p, e, "type: %s\n", tname[ctlr->type]);
 
 //	p = seprint(p, e, "eeprom:");
 //	for(i = 0; i < 0x40; i++){
@@ -763,7 +791,6 @@ i82563txinit(Ctlr* ctlr)
 		}
 		memset(&ctlr->tdba[i], 0, sizeof(Td));
 	}
-	ctlr->tdfree = ctlr->ntd;
 	csr32w(ctlr, Tidv, 128);
 	r = csr32r(ctlr, Txdctl);
 	r &= ~WthreshMASK;
@@ -1292,7 +1319,7 @@ i82563shutdown(Ether* ether)
 }
 
 static ushort
-eeread(Ctlr* ctlr, int adr)
+eeread(Ctlr *ctlr, int adr)
 {
 	csr32w(ctlr, Eerd, EEstart | adr << 2);
 	while ((csr32r(ctlr, Eerd) & EEdone) == 0)
@@ -1301,7 +1328,7 @@ eeread(Ctlr* ctlr, int adr)
 }
 
 static int
-eeload(Ctlr* ctlr)
+eeload(Ctlr *ctlr)
 {
 	ushort sum;
 	int data, adr;
@@ -1315,6 +1342,80 @@ eeload(Ctlr* ctlr)
 	return sum;
 }
 
+static int
+fcycle(Ctlr *, Flash *f)
+{
+	ushort s, i;
+
+	s = f->reg[Fsts];
+	if((s&Fvalid) == 0)
+		return -1;
+	f->reg[Fsts] |= Fcerr | Ael;
+	for(i = 0; i < 10; i++){
+		if((s&Scip) == 0)
+			return 0;
+		delay(1);
+		s = f->reg[Fsts];
+	}
+	return -1;
+}
+
+static int
+fread(Ctlr *c, Flash *f, int ladr)
+{
+	ushort s;
+
+	delay(1);
+	if(fcycle(c, f) == -1)
+		return -1;
+	f->reg[Fsts] |= Fdone;
+	f->reg32[Faddr] = ladr;
+
+	/* setup flash control register */
+	s = f->reg[Fctl];
+	s &= ~(0x1f << 8);
+	s |= (2-1) << 8;		/* 2 bytes */
+	s &= ~(2*Flcycle);		/* read */
+	f->reg[Fctl] = s | Fgo;
+
+	while((f->reg[Fsts] & Fdone) == 0)
+		;
+	if(f->reg[Fsts] & (Fcerr|Ael))
+		return -1;
+	return f->reg32[Fdata] & 0xffff;
+}
+
+static int
+fload(Ctlr *c)
+{
+	ulong data, io, r, adr;
+	ushort sum;
+	Flash f;
+
+	io = c->pcidev->mem[1].bar & ~0x0f;
+	f.reg = vmap(io, c->pcidev->mem[1].size);
+	if(f.reg == nil)
+		return -1;
+	f.reg32 = (ulong*)f.reg;
+	f.sz = f.reg32[Bfpr];
+	if(csr32r(c, Eec) & (1<<22)){
+		r = (f.sz >> 16) & 0x1fff;
+		r = (r+1) << 12;
+	}else
+		r = (f.sz & 0x1fff) << 12;
+
+	sum = 0;
+	for (adr = 0; adr < 0x40; adr++) {
+		data = fread(c, &f, r + adr*2);
+		if(data == -1)
+			break;
+		c->eeprom[adr] = data;
+		sum += data;
+	}
+	vunmap(f.reg, c->pcidev->mem[1].size);
+	return sum;
+}
+
 static int
 i82563reset(Ctlr *ctlr)
 {
@@ -1322,9 +1423,13 @@ i82563reset(Ctlr *ctlr)
 
 	if(i82563detach(ctlr))
 		return -1;
-	r = eeload(ctlr);
+	if(ctlr->type == i82566)
+		r = fload(ctlr);
+	else
+		r = eeload(ctlr);
 	if (r != 0 && r != 0xBABA){
-		print("%s: bad EEPROM checksum - %#.4ux\n", Type, r);
+		print("%s: bad EEPROM checksum - %#.4ux\n",
+			tname[ctlr->type], r);
 		return -1;
 	}
 
@@ -1425,9 +1530,12 @@ static int
 pnp(Ether* edev, int type)
 {
 	Ctlr *ctlr;
+	static int done;
 
-	if(i82563ctlrhead == nil)
+	if(!done) {
 		i82563pci();
+		done = 1;
+	}
 
 	/*
 	 * Any adapter matches if no edev->port is supplied,
@@ -1436,7 +1544,7 @@ pnp(Ether* edev, int type)
 	for(ctlr = i82563ctlrhead; ctlr != nil; ctlr = ctlr->next){
 		if(ctlr->active)
 			continue;
-		if(type != 0 && ctlr->type != type)
+		if(type != Iany && ctlr->type != type)
 			continue;
 		if(edev->port == 0 || edev->port == ctlr->port){
 			ctlr->active = 1;
@@ -1474,7 +1582,7 @@ pnp(Ether* edev, int type)
 static int
 anypnp(Ether *e)
 {
-	return pnp(e, 0);
+	return pnp(e, Iany);
 }
 
 static int

+ 82 - 82
sys/src/9/pc/etherm10g.c

@@ -3,7 +3,7 @@
  * © 2007 erik quanstrom, coraid
  *
  * the card is big endian.
- * we use u64int rather than uintptr to hold addresses so that
+ * we use uvlong rather than uintptr to hold addresses so that
  * we don't get "warning: stupid shift" on 32-bit architectures.
  */
 #include "u.h"
@@ -97,8 +97,8 @@ typedef union {
 
 typedef ulong Slot;
 typedef struct {
-	u16int	cksum;
-	u16int	len;
+	ushort	cksum;
+	ushort	len;
 } Slotparts;
 
 enum {
@@ -109,10 +109,10 @@ enum {
 };
 
 typedef struct {
-	u32int	high;
-	u32int	low;
-	u16int	hdroff;
-	u16int	len;
+	ulong	high;
+	ulong	low;
+	ushort	hdroff;
+	ushort	len;
 	uchar	pad;
 	uchar	nrdma;
 	uchar	chkoff;
@@ -126,7 +126,7 @@ typedef struct {
 	Block	**bring;
 //	uchar	*wcfifo;	/* what the heck is a w/c fifo? */
 	int	size;		/* of buffers in the z8's memory */
-	u32int	segsz;
+	ulong	segsz;
 	uint	n;		/* rxslots */
 	uint	m;		/* mask; rxslots must be a power of two */
 	uint	i;		/* number of segments (not frames) queued */
@@ -149,7 +149,7 @@ static Bpool	bgpool	= { .size = Maxmtu, };
 
 typedef struct {
 	Bpool	*pool;		/* free buffers */
-	u32int	*lanai;		/* rx ring; we have no permanent host shadow */
+	ulong	*lanai;		/* rx ring; we have no permanent host shadow */
 	Block	**host;		/* called "info" in myricom driver */
 //	uchar	*wcfifo;	/* cmd submission fifo */
 	uint	m;
@@ -184,7 +184,7 @@ enum {
 
 typedef struct {
 	Slot 	*entry;
-	u64int	busaddr;
+	uvlong	busaddr;
 	uint	m;
 	uint	n;
 	uint	i;
@@ -195,7 +195,7 @@ typedef struct Ctlr {
 	QLock;
 	int	state;
 	int	kprocs;
-	u64int	port;
+	uvlong	port;
 	Pcidev*	pcidev;
 	Ctlr*	next;
 	int	active;
@@ -206,32 +206,32 @@ typedef struct Ctlr {
 	int	ramsz;
 	uchar	*ram;
 
-	u32int	*irqack;
-	u32int	*irqdeass;
-	u32int	*coal;
+	ulong	*irqack;
+	ulong	*irqdeass;
+	ulong	*coal;
 
 	char	eprom[Epromsz];
 	ulong	serial;		/* unit serial number */
 
 	QLock	cmdl;
 	Cmd	*cmd;		/* address of command return */
-	u64int	cprt;		/* bus address of command */
+	uvlong	cprt;		/* bus address of command */
 
-	u64int	boot;		/* boot address */
+	uvlong	boot;		/* boot address */
 
 	Done	done;
 	Tx	tx;
 	Rx	sm;
 	Rx	bg;
 	Stats	*stats;
-	u64int	statsprt;
+	uvlong	statsprt;
 
 	Rendez	rxrendez;
 	Rendez	txrendez;
 
 	int	msi;
-	u32int	linkstat;
-	u32int	nrdma;
+	ulong	linkstat;
+	ulong	nrdma;
 } Ctlr;
 
 static Ctlr 	*ctlrs;
@@ -332,7 +332,7 @@ whichfw(Pcidev *p)
 {
 	char *s;
 	int i, off, lanes, ecrc;
-	u32int cap;
+	ulong cap;
 
 	/* check the number of configured lanes. */
 	off = pcicap(p, PciCapPCIe);
@@ -349,7 +349,7 @@ whichfw(Pcidev *p)
 	if(off != 0){
 		off += AercCCR;
 		cap = pcicfgr32(p, off);
-		print("%ud cap\n", cap);
+		print("%lud cap\n", cap);
 	}
 	ecrc = (cap>>4) & 0xf;
 	/* if we don't like the aerc, kick it here. */
@@ -402,10 +402,10 @@ parseeprom(Ctlr *c)
 	return 0;
 }
 
-static u16int
-pbit16(u16int i)
+static ushort
+pbit16(ushort i)
 {
-	u16int j;
+	ushort j;
 	uchar *p;
 
 	p = (uchar*)&j;
@@ -414,20 +414,20 @@ pbit16(u16int i)
 	return j;
 }
 
-static u16int
+static ushort
 gbit16(uchar i[2])
 {
-	u16int j;
+	ushort j;
 
 	j  = i[1];
 	j |= i[0]<<8;
 	return j;
 }
 
-static u32int
-pbit32(u32int i)
+static ulong
+pbit32(ulong i)
 {
-	u32int j;
+	ulong j;
 	uchar *p;
 
 	p = (uchar*)&j;
@@ -438,10 +438,10 @@ pbit32(u32int i)
 	return j;
 }
 
-static u32int
+static ulong
 gbit32(uchar i[4])
 {
-	u32int j;
+	ulong j;
 
 	j  = i[3];
 	j |= i[2]<<8;
@@ -451,7 +451,7 @@ gbit32(uchar i[4])
 }
 
 static void
-prepcmd(uint *cmd, int i)
+prepcmd(ulong *cmd, int i)
 {
 	while(i-- > 0)
 		cmd[i] = pbit32(cmd[i]);
@@ -468,10 +468,10 @@ prepcmd(uint *cmd, int i)
  * 40 byte = 5 int pad.
  */
 
-u32int
-cmd(Ctlr *c, int type, u64int data)
+ulong
+cmd(Ctlr *c, int type, uvlong data)
 {
-	u32int buf[16], i;
+	ulong buf[16], i;
 	Cmd *cmd;
 
 	qlock(&c->cmdl);
@@ -495,7 +495,7 @@ cmd(Ctlr *c, int type, u64int data)
 			i = gbit32(cmd->c);
 			qunlock(&c->cmdl);
 			if(cmd->i[1] != 0)
-				dprint("[%ux]", i);
+				dprint("[%lux]", i);
 			return i;
 		}
 		tsleep(&up->sleep, return0, 0, 1);
@@ -507,10 +507,10 @@ cmd(Ctlr *c, int type, u64int data)
 	return ~0;			/* silence! */
 }
 
-u32int
+ulong
 maccmd(Ctlr *c, int type, uchar *m)
 {
-	u32int buf[16], i;
+	ulong buf[16], i;
 	Cmd *cmd;
 
 	qlock(&c->cmdl);
@@ -534,7 +534,7 @@ maccmd(Ctlr *c, int type, uchar *m)
 			i = gbit32(cmd->c);
 			qunlock(&c->cmdl);
 			if(cmd->i[1] != 0)
-				dprint("[%ux]", i);
+				dprint("[%lux]", i);
 			return i;
 		}
 		tsleep(&up->sleep, return0, 0, 1);
@@ -552,10 +552,10 @@ enum {
 	DMAwrite= 0x1,
 };
 
-u32int
-dmatestcmd(Ctlr *c, int type, u64int addr, int len)
+ulong
+dmatestcmd(Ctlr *c, int type, uvlong addr, int len)
 {
-	u32int buf[16], i;
+	ulong buf[16], i;
 
 	memset(buf, 0, sizeof buf);
 	memset(c->cmd, Noconf, sizeof *c->cmd);
@@ -585,10 +585,10 @@ dmatestcmd(Ctlr *c, int type, u64int addr, int len)
 	return ~0;			/* silence! */
 }
 
-u32int
+ulong
 rdmacmd(Ctlr *c, int on)
 {
-	u32int buf[16], i;
+	ulong buf[16], i;
 
 	memset(buf, 0, sizeof buf);
 	c->cmd->i[0] = 0;
@@ -619,18 +619,18 @@ rdmacmd(Ctlr *c, int on)
 static int
 loadfw(Ctlr *c, int *align)
 {
-	uint *f, *s, sz;
+	ulong *f, *s, sz;
 	int i;
 
 	if((*align = whichfw(c->pcidev)) == 4*KiB){
-		f = (u32int*)fw4k;
+		f = (ulong*)fw4k;
 		sz = sizeof fw4k;
 	}else{
-		f = (u32int*)fw2k;
+		f = (ulong*)fw2k;
 		sz = sizeof fw2k;
 	}
 
-	s = (u32int*)(c->ram + Fwoffset);
+	s = (ulong*)(c->ram + Fwoffset);
 	for(i = 0; i < sz / 4; i++)
 		s[i] = f[i];
 	return sz & ~3;
@@ -640,7 +640,7 @@ static int
 bootfw(Ctlr *c)
 {
 	int i, sz, align;
-	uint buf[16];
+	ulong buf[16];
 	Cmd* cmd;
 
 	if((sz = loadfw(c, &align)) == 0)
@@ -667,7 +667,7 @@ bootfw(Ctlr *c)
 			break;
 		delay(1);
 	}
-	dprint("[%ux %ux]", gbit32(cmd->c), gbit32(cmd->c+4));
+	dprint("[%lux %lux]", gbit32(cmd->c), gbit32(cmd->c+4));
 	if(i == 20){
 		print("m10g: cannot load fw\n");
 		return -1;
@@ -681,13 +681,13 @@ static int
 kickthebaby(Pcidev *p, Ctlr *c)
 {
 	/* don't kick the baby! */
-	u32int code;
+	ulong code;
 
 	pcicfgw8(p,  0x10 + c->boot, 0x3);
 	pcicfgw32(p, 0x18 + c->boot, 0xfffffff0);
 	code = pcicfgr32(p, 0x14 + c->boot);
 
-	dprint("reboot status = %ux\n", code);
+	dprint("reboot status = %lux\n", code);
 	if(code != 0xfffffff0)
 		return -1;
 	return 0;
@@ -711,7 +711,7 @@ enum {
 };
 
 static char *
-fwtype(u32int type)
+fwtype(ulong type)
 {
 	switch(type){
 	case Tmx:
@@ -731,19 +731,19 @@ chkfw(Ctlr *c)
 {
 	uintptr off;
 	Fwhdr *h;
-	u32int type;
+	ulong type;
 
 	off = gbit32(c->ram+0x3c);
-	dprint("firmware %llux\n", (u64int)off);
+	dprint("firmware %llux\n", (uvlong)off);
 	if((off&3) || off + sizeof *h > c->ramsz){
-		print("!m10g: bad firmware %llux\n", (u64int)off);
+		print("!m10g: bad firmware %llux\n", (uvlong)off);
 		return -1;
 	}
 	h = (Fwhdr*)(c->ram + off);
 	type = gbit32(h->type);
 	dprint("\t" "type	%s\n", fwtype(type));
 	dprint("\t" "vers	%s\n", h->version);
-	dprint("\t" "ramsz	%ux\n", gbit32(h->ramsz));
+	dprint("\t" "ramsz	%lux\n", gbit32(h->ramsz));
 	if(type != Teth){
 		print("!m10g: bad card type %s\n", fwtype(type));
 		return -1;
@@ -755,7 +755,7 @@ chkfw(Ctlr *c)
 static int
 reset(Ether *e, Ctlr *c)
 {
-	u32int i, sz;
+	ulong i, sz;
 
 	if(waserror()){
 		print("m10g: reset error\n");
@@ -768,22 +768,22 @@ reset(Ether *e, Ctlr *c)
 
 	cmd(c, CSintrqsz, c->done.n * sizeof *c->done.entry);
 	cmd(c, CSintrqdma, c->done.busaddr);
-	c->irqack =   (u32int*)(c->ram + cmd(c, CGirqackoff, 0));
+	c->irqack =   (ulong*)(c->ram + cmd(c, CGirqackoff, 0));
 	/* required only if we're not doing msi? */
-	c->irqdeass = (u32int*)(c->ram + cmd(c, CGirqdeassoff, 0));
+	c->irqdeass = (ulong*)(c->ram + cmd(c, CGirqdeassoff, 0));
 	/* this is the driver default, why fiddle with this? */
-	c->coal = (u32int*)(c->ram + cmd(c, CGcoaloff, 0));
+	c->coal = (ulong*)(c->ram + cmd(c, CGcoaloff, 0));
 	*c->coal = pbit32(25);
 
 	dprint("dma stats:\n");
 	rdmacmd(c, 1);
 	sz = c->tx.segsz;
 	i = dmatestcmd(c, DMAread, c->done.busaddr, sz);
-	print("\t" "read: %ud MB/s\n", ((i>>16)*sz*2)/(i&0xffff));
+	print("\t" "read: %lud MB/s\n", ((i>>16)*sz*2) / (i&0xffff));
 	i = dmatestcmd(c, DMAwrite, c->done.busaddr, sz);
-	print("\t" "write: %ud MB/s\n", ((i>>16)*sz*2)/(i&0xffff));
+	print("\t" "write: %lud MB/s\n", ((i>>16)*sz*2) / (i&0xffff));
 	i = dmatestcmd(c, DMAwrite|DMAread, c->done.busaddr, sz);
-	print("\t" "r/w: %ud MB/s\n", ((i>>16)*sz*2*2)/(i&0xffff));
+	print("\t" "r/w: %lud MB/s\n", ((i>>16)*sz*2*2) / (i&0xffff));
 	memset(c->done.entry, 0, c->done.n * sizeof *c->done.entry);
 
 	maccmd(c, CSmac, c->ra);
@@ -813,8 +813,8 @@ ctlrfree(Ctlr *c)
 static int
 setmem(Pcidev *p, Ctlr *c)
 {
-	u32int i;
-	u64int raddr;
+	ulong i;
+	uvlong raddr;
 	Done *d;
 	void *mem;
 
@@ -907,7 +907,7 @@ bgbfree(Block *b)
 static void
 replenish(Rx *rx)
 {
-	u32int buf[16], i, idx, e;
+	ulong buf[16], i, idx, e;
 	Bpool *p;
 	Block *b;
 
@@ -921,7 +921,7 @@ replenish(Rx *rx)
 		idx = rx->cnt & rx->m;
 		for(i = 0; i < 8; i++){
 			b = balloc(rx);
-			buf[i*2]   = pbit32((u64int)PCIWADDR(b->wp) >> 32);
+			buf[i*2]   = pbit32((uvlong)PCIWADDR(b->wp) >> 32);
 			buf[i*2+1] = pbit32(PCIWADDR(b->wp));
 			rx->host[idx+i] = b;
 			assert(b);
@@ -982,7 +982,7 @@ open0(Ether *e, Ctlr *c)
 	entries = cmd(c, CGrxrgsz, 0)/8;
 	c->sm.pool = &smpool;
 	cmd(c, CSsmallsz, c->sm.pool->size);
-	c->sm.lanai = (u32int*)(c->ram + cmd(c, CGsmallrxoff, 0));
+	c->sm.lanai = (ulong*)(c->ram + cmd(c, CGsmallrxoff, 0));
 	c->sm.n = entries;
 	c->sm.m = entries-1;
 	c->sm.host = emalign(entries * sizeof *c->sm.host);
@@ -990,7 +990,7 @@ open0(Ether *e, Ctlr *c)
 	c->bg.pool = &bgpool;
 	c->bg.pool->size = nextpow(2 + e->maxmtu);  /* 2-byte alignment pad */
 	cmd(c, CSbigsz, c->bg.pool->size);
-	c->bg.lanai = (u32int*)(c->ram + cmd(c, CGbigrxoff, 0));
+	c->bg.lanai = (ulong*)(c->ram + cmd(c, CGbigrxoff, 0));
 	c->bg.n = entries;
 	c->bg.m = entries-1;
 	c->bg.host = emalign(entries * sizeof *c->bg.host);
@@ -1021,7 +1021,7 @@ static Block*
 nextblock(Ctlr *c)
 {
 	uint i;
-	u16int l, k;
+	ushort l, k;
 	Block *b;
 	Done *d;
 	Rx *rx;
@@ -1099,7 +1099,7 @@ m10rx(void *v)
 }
 
 static void
-txcleanup(Tx *tx, u32int n)
+txcleanup(Tx *tx, ulong n)
 {
 	Block *b;
 	uint j, l, m;
@@ -1124,7 +1124,7 @@ txcleanup(Tx *tx, u32int n)
 		if(tx->cnt == tx->i)
 			return;
 		if(l++ == m){
-			iprint("tx ovrun: %ud %uld\n", n, tx->npkt);
+			iprint("tx ovrun: %lud %lud\n", n, tx->npkt);
 			return;
 		}
 	}
@@ -1195,8 +1195,8 @@ nsegments(Block *b, int segsz)
 static void
 m10gtransmit(Ether *e)
 {
-	u16int slen;
-	u32int i, cnt, rdma, nseg, count, end, bus, len, segsz;
+	ushort slen;
+	ulong i, cnt, rdma, nseg, count, end, bus, len, segsz;
 	uchar flags;
 	Block *b;
 	Ctlr *c;
@@ -1254,7 +1254,7 @@ m10gtransmit(Ether *e)
 static void
 checkstats(Ether *e, Ctlr *c, Stats *s)
 {
-	u32int i;
+	ulong i;
 
 	if(s->updated == 0)
 		return;
@@ -1269,7 +1269,7 @@ checkstats(Ether *e, Ctlr *c, Stats *s)
 	}
 	i = gbit32(s->nrdma);
 	if(i != c->nrdma){
-		dprint("m10g: rdma timeout %d\n", i);
+		dprint("m10g: rdma timeout %ld\n", i);
 		c->nrdma = i;
 	}
 }
@@ -1383,18 +1383,18 @@ m10gifstat(Ether *e, void *v, long n, ulong off)
 
 	// l +=
 	snprint(p+l, lim,
-		"txcnt = %ud\n"	  "linkstat = %ud\n" 	"dlink = %ud\n"
-		"derror = %ud\n"  "drunt = %ud\n" 	"doverrun = %ud\n"
-		"dnosm = %ud\n"	  "dnobg = %ud\n"	"nrdma = %ud\n"
+		"txcnt = %lud\n"  "linkstat = %lud\n" 	"dlink = %lud\n"
+		"derror = %lud\n" "drunt = %lud\n" 	"doverrun = %lud\n"
+		"dnosm = %lud\n"  "dnobg = %lud\n"	"nrdma = %lud\n"
 		"txstopped = %ud\n" "down = %ud\n" 	"updated = %ud\n"
 		"valid = %ud\n\n"
-		"tx pkt = %uld\n" "tx bytes = %lld\n"
+		"tx pkt = %lud\n"  "tx bytes = %lld\n"
 		"tx cnt = %ud\n"  "tx n = %ud\n"	"tx i = %ud\n"
 		"sm cnt = %ud\n"  "sm i = %ud\n"	"sm n = %ud\n"
 		"sm lst = %ud\n"
 		"bg cnt = %ud\n"  "bg i = %ud\n"	"bg n = %ud\n"
 		"bg lst = %ud\n"
-		"segsz = %ud\n"   "coal = %d\n",
+		"segsz = %lud\n"   "coal = %lud\n",
 		gbit32(s.txcnt),  gbit32(s.linkstat),	gbit32(s.dlink),
 		gbit32(s.derror), gbit32(s.drunt),	gbit32(s.doverrun),
 		gbit32(s.dnosm),  gbit32(s.dnobg),	gbit32(s.nrdma),

+ 32 - 32
sys/src/9/pc/sdiahci.c

@@ -198,7 +198,7 @@ preg(uchar *reg, int n)
 static void
 dreg(char *s, Aport *p)
 {
-	dprint("%stask=%ux; cmd=%ux; ci=%ux; is=%ux\n", s, p->task, p->cmd,
+	dprint("%stask=%lux; cmd=%lux; ci=%lux; is=%lux\n", s, p->task, p->cmd,
 		p->ci, p->isr);
 }
 
@@ -348,7 +348,7 @@ asleep(int ms)
 static int
 ahciportreset(Aportc *c)
 {
-	u32int *cmd, i;
+	ulong *cmd, i;
 	Aport *p;
 
 	p = c->p;
@@ -394,7 +394,7 @@ smart(Aportc *pc, int n)
 	l->ctabhi = 0;
 
 	if(ahciwait(pc, 1000) == -1 || pc->p->task & (1|32)){
-		dprint("smart fail %ux\n", pc->p->task);
+		dprint("smart fail %lux\n", pc->p->task);
 //		preg(pc->m->fis.r, 20);
 		return -1;
 	}
@@ -430,7 +430,7 @@ smartrs(Aportc *pc)
 
 	c = pc->m->fis.r;
 	if(ahciwait(pc, 1000) == -1 || pc->p->task & (1|32)){
-		dprint("smart fail %ux\n", pc->p->task);
+		dprint("smart fail %lux\n", pc->p->task);
 		preg(c, 20);
 		return -1;
 	}
@@ -464,7 +464,7 @@ ahciflushcache(Aportc *pc)
 	l->ctabhi = 0;
 
 	if(ahciwait(pc, 60000) == -1 || pc->p->task & (1|32)){
-		dprint("ahciflushcache fail %ux\n", pc->p->task);
+		dprint("ahciflushcache fail %lux\n", pc->p->task);
 //		preg( pc->m->fis.r, 20);
 		return -1;
 	}
@@ -483,10 +483,10 @@ gbit16(void *a)
 	return j;
 }
 
-static u32int
+static ulong
 gbit32(void *a)
 {
-	u32int j;
+	ulong j;
 	uchar *i;
 
 	i = a;
@@ -587,7 +587,7 @@ ahciidentify(Aportc *pc, ushort *id)
 static int
 ahciquiet(Aport *a)
 {
-	u32int *p, i;
+	ulong *p, i;
 
 	p = &a->cmd;
 	*p &= ~Ast;
@@ -612,7 +612,7 @@ stop:
 	return -1;
 stop1:
 	/* extra check */
-	dprint("clo clear %x\n", a->task);
+	dprint("clo clear %lx\n", a->task);
 	if(a->task & ASbsy)
 		return -1;
 	*p |= Ast;
@@ -678,7 +678,7 @@ ahcicomreset(Aportc *pc)
 static int
 ahciidle(Aport *port)
 {
-	u32int *p, i, r;
+	ulong *p, i, r;
 
 	p = &port->cmd;
 	if((*p & Arun) == 0)
@@ -708,7 +708,7 @@ stop:
  *	- remainder is handled by configdisk.
  *	- ahcirecover is a quick recovery from a failed command.
  */
-int
+static int
 ahciswreset(Aportc *pc)
 {
 	int i;
@@ -722,7 +722,7 @@ ahciswreset(Aportc *pc)
 	return 0;
 }
 
-int
+static int
 ahcirecover(Aportc *pc)
 {
 	ahciswreset(pc);
@@ -750,7 +750,7 @@ setupfis(Afis *f)
 	f->p = f->base + 0x20;
 	f->r = f->base + 0x40;
 	f->u = f->base + 0x60;
-	f->devicebits = (u32int*)(f->base + 0x58);
+	f->devicebits = (ulong*)(f->base + 0x58);
 }
 
 static void
@@ -788,7 +788,7 @@ ahciconfigdrive(Ahba *h, Aportc *c, int mode)
 
 	if(p->sstatus & 3 && h->cap & Hsss){
 		/* device connected & staggered spin-up */
-		dprint("configdrive:  spinning up ... [%ux]\n", p->sstatus);
+		dprint("configdrive:  spinning up ... [%lux]\n", p->sstatus);
 		p->cmd |= Apod|Asud;
 		asleep(1400);
 	}
@@ -843,7 +843,7 @@ static int
 ahciconf(Ctlr *ctlr)
 {
 	Ahba *h;
-	u32int u;
+	ulong u;
 
 	h = ctlr->hba = (Ahba*)ctlr->mmio;
 	u = h->cap;
@@ -851,8 +851,8 @@ ahciconf(Ctlr *ctlr)
 	if((u&Hsam) == 0)
 		h->ghc |= Hae;
 
-	print("#S/sd%c: ahci: port %#p: hba sss %d; ncs %d; coal %d; "
-		"mports %d; led %d; clo %d; ems %d\n",
+	print("#S/sd%c: ahci: port %#p: hba sss %ld; ncs %ld; coal %ld; "
+		"mports %ld; led %ld; clo %ld; ems %ld\n",
 		ctlr->sdev->idno, h,
 		(u>>27) & 1, (u>>8) & 0x1f, (u>>7) & 1, u & 0x1f, (u>>25) & 1,
 		(u>>24) & 1, (u>>6) & 1);
@@ -897,7 +897,7 @@ idmove(char *p, ushort *a, int n)
 static int
 identify(Drive *d)
 {
-	u16int *id;
+	ushort *id;
 	vlong osectors, s;
 	uchar oserial[21];
 	SDunit *u;
@@ -945,10 +945,10 @@ clearci(Aport *p)
 static void
 updatedrive(Drive *d)
 {
-	u32int cause, serr, s0, pr, ewake;
+	ulong cause, serr, s0, pr, ewake;
 	char *name;
 	Aport *p;
-	static u32int last;
+	static ulong last;
 
 	pr = 1;
 	ewake = 0;
@@ -972,7 +972,7 @@ updatedrive(Drive *d)
 	}
 	if(cause & Adhrs){
 		if(p->task & 33){
-			dprint("Adhrs cause = %ux; serr = %ux; task=%ux\n",
+			dprint("Adhrs cause = %lux; serr = %lux; task=%lux\n",
 				cause, serr, p->task);
 			d->portm.flag |= Ferror;
 			ewake = 1;
@@ -980,10 +980,10 @@ updatedrive(Drive *d)
 		pr = 0;
 	}
 	if(p->task & 1 && last != cause)
-		dprint("err ca %ux serr %ux task %ux sstat %ux\n",
+		dprint("err ca %lux serr %lux task %lux sstat %lux\n",
 			cause, serr, p->task, p->sstatus);
 	if(pr)
-		dprint("%s: upd %ux ta %ux\n", name, cause, p->task);
+		dprint("%s: upd %lux ta %lux\n", name, cause, p->task);
 
 	if(cause & (Aprcs|Aifs)){
 		s0 = d->state;
@@ -1006,7 +1006,7 @@ updatedrive(Drive *d)
 			d->state = Doffline;
 			break;
 		}
-		dprint("%s: %s → %s [Apcrs] %ux\n", name, diskstates[s0],
+		dprint("%s: %s → %s [Apcrs] %lux\n", name, diskstates[s0],
 			diskstates[d->state], p->sstatus);
 		/* print pulled message here. */
 		if(s0 == Dready && d->state != Dready)
@@ -1172,7 +1172,7 @@ westerndigitalhung(Drive *d)
 {
 	if((d->portm.feat&Datapi) == 0 && d->active &&
 	    TK2MS(MACHP(0)->ticks - d->intick) > 5000){
-		dprint("%s: drive hung; resetting [%ux] ci=%x\n",
+		dprint("%s: drive hung; resetting [%lux] ci=%lx\n",
 			d->unit->name, d->port->task, d->port->ci);
 		d->state = Dreset;
 	}
@@ -1192,7 +1192,7 @@ doportreset(Drive *d)
 	else
 		i = 0;
 	qunlock(&d->portm);
-	dprint("portreset → %s  [task %ux]\n",
+	dprint("portreset → %s  [task %lux]\n",
 		diskstates[d->state], d->port->task);
 	return i;
 }
@@ -1248,7 +1248,7 @@ reset:
 			break;
 		case 0x103:		/* active, device, phy. comm. */
 			if((++d->wait&Midwait) == 0){
-				dprint("%s: slow reset %04ux task=%ux; %d\n",
+				dprint("%s: slow reset %04ux task=%lux; %d\n",
 					name, s, d->port->task, d->wait);
 				goto reset;
 			}
@@ -1540,7 +1540,7 @@ ahcibuildpkt(Aportm *m, SDreq *r, void *data, int n)
 static int
 waitready(Drive *d)
 {
-	u32int s, i, δ;
+	ulong s, i, δ;
 
 	for(i = 0; i < 15000; i += 250){
 		if(d->state == Dreset || d->state == Dportreset ||
@@ -1981,8 +1981,8 @@ iarctl(SDunit *u, char *p, int l)
 	}else
 		p = seprint(p, e, "no disk present [%s]\n", diskstates[d->state]);
 	serrstr(o->serror, buf, buf + sizeof buf - 1);
-	p = seprint(p, e, "reg\ttask %ux cmd %ux serr %ux %s ci %ux is %ux; "
-		"sig %ux sstatus %04x\n", o->task, o->cmd, o->serror, buf,
+	p = seprint(p, e, "reg\ttask %lux cmd %lux serr %lux %s ci %lux is %lux; "
+		"sig %lux sstatus %04lux\n", o->task, o->cmd, o->serror, buf,
 		o->ci, o->isr, o->sig, o->sstatus);
 	p = seprint(p, e, "geometry %llud 512\n", d->sectors);
 	return p - op;
@@ -2145,7 +2145,7 @@ portr(char *p, char *e, uint x)
 static char*
 iartopctl(SDev *sdev, char *p, char *e)
 {
-	u32int cap;
+	ulong cap;
 	char pr[25];
 	Ahba *hba;
 	Ctlr *ctlr;
@@ -2173,7 +2173,7 @@ iartopctl(SDev *sdev, char *p, char *e)
 	has(Hsxs, "sxs");
 	portr(pr, pr + sizeof pr, hba->pi);
 	return seprint(p, e,
-		"iss %d ncs %d np %d; ghc %ux isr %ux pi %ux %s ver %ux\n",
+		"iss %ld ncs %ld np %ld; ghc %lux isr %lux pi %lux %s ver %lux\n",
 		(cap>>20) & 0xf, (cap>>8) & 0x1f, 1 + (cap & 0x1f),
 		hba->ghc, hba->isr, hba->pi, pr, hba->ver);
 #undef has

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

@@ -1484,7 +1484,7 @@ rdregs(char *p, char *e, void *base, Regs *r, int n, char *prefix)
 	for(i=0; i<n; i++)
 		p = seprint(p, e, "%s%s%-19s %.8ux\n",
 			prefix ? prefix : "", prefix ? ": " : "",
-			r[i].name, *(u32int*)((uchar*)base+r[i].offset));
+			r[i].name, *(ulong *)((uchar*)base+r[i].offset));
 	return p;
 }
 
@@ -1683,7 +1683,8 @@ retry:
 		flag = srb->flag;
 		freesrb(srb);
 		if(flag == 0){
-	tryagain:		if(++try == 10){
+tryagain:
+			if(++try == 10){
 				print("%s: bad disk\n", drive->unit->name);
 				return SDeio;
 			}

+ 2 - 2
sys/src/9/port/devaoe.c

@@ -1724,10 +1724,10 @@ gbit16(void *a)
 	return i[1] << 8 | i[0];
 }
 
-static u32int
+static ulong
 gbit32(void *a)
 {
-	u32int j;
+	ulong j;
 	uchar *i;
 
 	i = a;

+ 2 - 2
sys/src/9/port/sdaoe.c

@@ -102,10 +102,10 @@ gbit16(void *a)
 	return i[1] << 8 | i[0];
 }
 
-static u32int
+static ulong
 gbit32(void *a)
 {
-	u32int j;
+	ulong j;
 	uchar *i;
 
 	i = a;

+ 35 - 35
sys/src/boot/pc/ahci.h

@@ -78,15 +78,15 @@ enum {
 };
 
 typedef struct {
-	u32int	cap;
-	u32int	ghc;
-	u32int	isr;
-	u32int	pi;		/* ports implemented */
-	u32int	ver;
-	u32int	ccc;		/* coaleasing control */
-	u32int	cccports;
-	u32int	emloc;
-	u32int	emctl;
+	ulong	cap;
+	ulong	ghc;
+	ulong	isr;
+	ulong	pi;		/* ports implemented */
+	ulong	ver;
+	ulong	ccc;		/* coaleasing control */
+	ulong	cccports;
+	ulong	emloc;
+	ulong	emctl;
 } Ahba;
 
 enum {
@@ -179,24 +179,24 @@ enum {
 #define	sactive	scr3
 
 typedef struct {
-	u32int	list;		/* PxCLB must be 1kb aligned. */
-	u32int	listhi;
-	u32int	fis;		/* 256-byte aligned */
-	u32int	fishi;
-	u32int	isr;
-	u32int	ie;		/* interrupt enable */
-	u32int	cmd;
-	u32int	res1;
-	u32int	task;
-	u32int	sig;
-	u32int	scr0;
-	u32int	scr2;
-	u32int	scr1;
-	u32int	scr3;
-	u32int	ci;		/* command issue */
-	u32int	ntf;
+	ulong	list;		/* PxCLB must be 1kb aligned. */
+	ulong	listhi;
+	ulong	fis;		/* 256-byte aligned */
+	ulong	fishi;
+	ulong	isr;
+	ulong	ie;		/* interrupt enable */
+	ulong	cmd;
+	ulong	res1;
+	ulong	task;
+	ulong	sig;
+	ulong	scr0;
+	ulong	scr2;
+	ulong	scr1;
+	ulong	scr3;
+	ulong	ci;		/* command issue */
+	ulong	ntf;
 	uchar	res2[8];
-	u32int	vendor;
+	ulong	vendor;
 } Aport;
 
 /* in host's memory; not memory mapped */
@@ -206,7 +206,7 @@ typedef struct {
 	uchar	*p;
 	uchar	*r;
 	uchar	*u;
-	u32int	*devicebits;
+	ulong	*devicebits;
 } Afis;
 
 enum {
@@ -223,18 +223,18 @@ enum {
 
 /* in hosts memory; memory mapped */
 typedef struct {
-	u32int	flags;
-	u32int	len;
-	u32int	ctab;
-	u32int	ctabhi;
+	ulong	flags;
+	ulong	len;
+	ulong	ctab;
+	ulong	ctabhi;
 	uchar	reserved[16];
 } Alist;
 
 typedef struct {
-	u32int	dba;
-	u32int	dbahi;
-	u32int	pad;
-	u32int	count;
+	ulong	dba;
+	ulong	dbahi;
+	ulong	pad;
+	ulong	count;
 } Aprdt;
 
 typedef struct {

+ 13 - 7
sys/src/boot/pc/etherigbe.c

@@ -1,6 +1,6 @@
 /*
  * bootstrap driver for
- * Intel RS-82543GC Gigabit Ethernet Controller
+ * Intel RS-82543GC Gigabit Ethernet PCI Controllers
  * as found on the Intel PRO/1000[FT] Server Adapter.
  * The older non-[FT] cards use the 82542 (LSI L2A1157) chip; no attempt
  * is made to handle the older chip although it should be possible.
@@ -143,10 +143,15 @@ enum {					/* Ctrl */
 	Vme		= 0x40000000,	/* VLAN Mode Enable */
 };
 
+/*
+ * can't find Tckok nor Rbcok in any Intel docs,
+ * but even 82543gc docs define Lanid.
+ */
 enum {					/* Status */
 	Lu		= 0x00000002,	/* Link Up */
-	Tckok		= 0x00000004,	/* Transmit clock is running */
-	Rbcok		= 0x00000008,	/* Receive clock is running */
+	Lanid		= 0x0000000C,	/* mask for Lan ID. (function id) */
+//	Tckok		= 0x00000004,	/* Transmit clock is running */
+//	Rbcok		= 0x00000008,	/* Receive clock is running */
 	Txoff		= 0x00000010,	/* Transmission Paused */
 	Tbimode		= 0x00000020,	/* TBI Mode Indication */
 	SpeedMASK	= 0x000000C0,
@@ -1476,10 +1481,11 @@ igbereset(Ctlr* ctlr)
 		ctlr->ra[2*i]   = ctlr->eeprom[i];
 		ctlr->ra[2*i+1] = ctlr->eeprom[i]>>8;
 	}
-	/* set mac address of second port */
-	r = csr32r(ctlr, Status)>>2;
-	ctlr->ra[5] += r & 3;		/* ea ctlr[1] = ea ctlr[0]+1 */
-
+	/* lan id seems to vary on 82543gc; don't use it */
+	if (ctlr->id != i82543gc) {
+		r = (csr32r(ctlr, Status) & Lanid) >> 2;
+		ctlr->ra[5] += r;		/* ea ctlr[1] = ea ctlr[0]+1 */
+	}
 	r = (ctlr->ra[3]<<24)|(ctlr->ra[2]<<16)|(ctlr->ra[1]<<8)|ctlr->ra[0];
 	csr32w(ctlr, Ral, r);
 	r = 0x80000000|(ctlr->ra[5]<<8)|ctlr->ra[4];

+ 2 - 1
sys/src/boot/pc/etherrhine.c

@@ -491,7 +491,8 @@ reset(Ctlr* ctlr)
 	/*
 	 * Soft reset the controller.
 	 */
-	csr16w(ctlr, Cr, Reset);
+	csr16w(ctlr, Cr, Stop);
+	csr16w(ctlr, Cr, Stop|Reset);
 	for(timeo = 0; timeo < 10000; timeo++){
 		if(!(csr16r(ctlr, Cr) & Reset))
 			break;

+ 2 - 2
sys/src/boot/pc/sdaoe.c

@@ -155,11 +155,11 @@ gbit16(void *a)
 	return i[1]<<8 | i[0];
 }
 
-static u32int
+static ulong
 gbit32(void *a)
 {
 	uchar *i;
-	u32int j;
+	ulong j;
 
 	i = a;
 	j  = i[3] << 24;

+ 1 - 0
sys/src/boot/pc/sdata.c

@@ -1507,6 +1507,7 @@ atapnp(void)
 			 * This can probably be lumped in with the 768 above.
 			 */
 			/*FALLTHROUGH*/
+		case (0x209A<<16)|0x1022:	/* AMD CS5536 */
 		case (0x01BC<<16)|0x10DE:	/* nVidia nForce1 */
 		case (0x0065<<16)|0x10DE:	/* nVidia nForce2 */
 		case (0x0085<<16)|0x10DE:	/* nVidia nForce2 MCP */

+ 24 - 24
sys/src/boot/pc/sdiahci.c

@@ -183,7 +183,7 @@ preg(uchar *reg, int n)
 static void
 dreg(char *s, Aport *p)
 {
-	dprint("%stask=%ux; cmd=%ux; ci=%ux; is=%ux\n",
+	dprint("%stask=%lux; cmd=%lux; ci=%lux; is=%lux\n",
 		s, p->task, p->cmd, p->ci, p->isr);
 }
 
@@ -297,7 +297,7 @@ asleep(int ms)
 static int
 ahciportreset(Aportc *c)
 {
-	u32int *cmd, i;
+	ulong *cmd, i;
 	Aport *p;
 
 	p = c->p;
@@ -323,10 +323,10 @@ gbit16(void *a)
 	return i[1]<<8 | i[0];
 }
 
-static u32int
+static ulong
 gbit32(void *a)
 {
-	u32int j;
+	ulong j;
 	uchar *i;
 
 	i = a;
@@ -427,7 +427,7 @@ ahciidentify(Aportc *pc, ushort *id)
 static int
 ahciquiet(Aport *a)
 {
-	u32int *p, i;
+	ulong *p, i;
 
 	p = &a->cmd;
 	*p &= ~Ast;
@@ -452,7 +452,7 @@ stop:
 	return -1;
 stop1:
 	/* extra check */
-	dprint("clo clear %x\n", a->task);
+	dprint("clo clear %lx\n", a->task);
 	if(a->task & ASbsy)
 		return -1;
 	*p |= Ast;
@@ -462,7 +462,7 @@ stop1:
 static int
 ahciidle(Aport *port)
 {
-	u32int *p, i, r;
+	ulong *p, i, r;
 
 	p = &port->cmd;
 	if((*p & Arun) == 0)
@@ -534,7 +534,7 @@ setupfis(Afis *f)
 	f->p = f->base + 0x20;
 	f->r = f->base + 0x40;
 	f->u = f->base + 0x60;
-	f->devicebits = (u32int*)(f->base + 0x58);
+	f->devicebits = (ulong*)(f->base + 0x58);
 }
 
 static void
@@ -571,7 +571,7 @@ ahciconfigdrive(Ahba *h, Aportc *c, int mode)
 	}
 
 	if(p->sstatus & 3 && h->cap & Hsss){
-		dprint("configdrive:  spinning up ... [%ux]\n", p->sstatus);
+		dprint("configdrive:  spinning up ... [%lux]\n", p->sstatus);
 		p->cmd |= Apod|Asud;
 		asleep(1400);
 	}
@@ -625,7 +625,7 @@ countbits(ulong u)
 static int
 ahciconf(Ctlr *c)
 {
-	u32int u;
+	ulong u;
 	Ahba *h;
 	static int count;
 
@@ -635,8 +635,8 @@ ahciconf(Ctlr *c)
 	if((u & Hsam) == 0)
 		h->ghc |= Hae;
 
-	print("ahci%d port %#p: hba sss %d; ncs %d; coal %d; mports %d; "
-		"led %d; clo %d; ems %d;\n", count++, h,
+	print("ahci%d port %#p: hba sss %ld; ncs %ld; coal %ld; mports %ld; "
+		"led %ld; clo %ld; ems %ld;\n", count++, h,
 		(u>>27) & 1, (u>>8) & 0x1f, (u>>7) & 1,	u & 0x1f, (u>>25) & 1,
 		(u>>24) & 1, (u>>6) & 1);
 	return countbits(h->pi);
@@ -679,7 +679,7 @@ idmove(char *p, ushort *a, int n)
 static int
 identify(Drive *d)
 {
-	u16int *id;
+	ushort *id;
 	vlong osectors, s;
 	uchar oserial[21];
 	SDunit *u;
@@ -728,10 +728,10 @@ clearci(Aport *p)
 static void
 updatedrive(Drive *d)
 {
-	u32int cause, serr, s0, pr, ewake;
+	ulong cause, serr, s0, pr, ewake;
 	char *name;
 	Aport *p;
-	static u32int last;
+	static ulong last;
 
 	pr = 1;
 	ewake = 0;
@@ -754,7 +754,7 @@ updatedrive(Drive *d)
 	}
 	if(cause & Adhrs){
 		if(p->task & (32|1)){
-			dprint("Adhrs cause = %ux; serr = %ux; task=%ux\n",
+			dprint("Adhrs cause = %lux; serr = %lux; task=%lux\n",
 				cause, serr, p->task);
 			d->portm.flag |= Ferror;
 			ewake = 1;
@@ -763,7 +763,7 @@ updatedrive(Drive *d)
 	}
 
 	if(pr)
-		dprint("%s: upd %ux ta %ux\n", name, cause, p->task);
+		dprint("%s: upd %lux ta %lux\n", name, cause, p->task);
 	if(cause & (Aprcs|Aifs)){
 		s0 = d->state;
 		switch(p->sstatus & 7){
@@ -785,7 +785,7 @@ updatedrive(Drive *d)
 			d->state = Doffline;
 			break;
 		}
-		dprint("%s: %s → %s [Apcrs] %ux\n", name, diskstates[s0],
+		dprint("%s: %s → %s [Apcrs] %lux\n", name, diskstates[s0],
 			diskstates[d->state], p->sstatus);
 		if(s0 == Dready && d->state != Dready)
 			idprint("%s: pulled\n", name);
@@ -942,8 +942,8 @@ westerndigitalhung(Drive *d)
 {
 	if((d->portm.feat & Datapi) == 0 && d->active &&
 	    TK2MS(m->ticks - d->intick) > 5000){
-		dprint("%s: drive hung; resetting [%ux] ci=%x\n", d->unit->name,
-			d->port->task, d->port->ci);
+		dprint("%s: drive hung; resetting [%lux] ci=%lx\n",
+			d->unit->name, d->port->task, d->port->ci);
 		d->state = Dreset;
 	}
 }
@@ -962,7 +962,7 @@ doportreset(Drive *d)
 	else
 		i = 0;
 	qunlock(&d->portm);
-	dprint("portreset → %s  [task %ux]\n", diskstates[d->state],
+	dprint("portreset → %s  [task %lux]\n", diskstates[d->state],
 		d->port->task);
 	return i;
 }
@@ -1013,7 +1013,7 @@ reset:
 			break;
 		case 0x103:
 			if((++d->wait&Midwait) == 0){
-				dprint("%s: slow reset %#ux task=%#ux; %d\n",
+				dprint("%s: slow reset %#ux task=%#lux; %d\n",
 					name, s, d->port->task, d->wait);
 				goto reset;
 			}
@@ -1299,7 +1299,7 @@ ahcibuildpkt(Aportm *m, SDreq *r, void *data, int n)
 static int
 waitready(Drive *d)
 {
-	u32int s, t, i;
+	ulong s, t, i;
 
 	for(i = 0; i < 120; i++){
 		ilock(d);
@@ -1311,7 +1311,7 @@ waitready(Drive *d)
 		if(d->state == Dready && (s & 7) == 3)
 			return 0;
 		if((i + 1) % 30 == 0)
-			print("%s: waitready: [%s] task=%ux sstat=%ux\n",
+			print("%s: waitready: [%s] task=%lux sstat=%lux\n",
 				d->unit->name, diskstates[d->state], t, s);
 		esleep(1000);
 	}