Преглед на файлове

Plan 9 from Bell Labs 2006-05-22

David du Colombier преди 18 години
родител
ревизия
0112711b67
променени са 70 файла, в които са добавени 2006 реда и са изтрити 221 реда
  1. 70 51
      dist/replica/_plan9.db
  2. 70 51
      dist/replica/plan9.db
  3. 72 0
      dist/replica/plan9.log
  4. 7 0
      sys/man/1/graph
  5. 3 3
      sys/man/2/getcallerpc
  6. 49 2
      sys/src/cmd/graph/graph.c
  7. 21 0
      sys/src/cmd/unix/drawterm/Make.sun
  8. 2 0
      sys/src/cmd/unix/drawterm/README
  9. 1 1
      sys/src/cmd/unix/drawterm/cpu.c
  10. 5 5
      sys/src/cmd/unix/drawterm/exportfs/exportsrv.c
  11. 2 0
      sys/src/cmd/unix/drawterm/gui-x11/screen.c
  12. 1 1
      sys/src/cmd/unix/drawterm/gui-x11/xmem.h
  13. 2 2
      sys/src/cmd/unix/drawterm/include/auth.h
  14. 1 1
      sys/src/cmd/unix/drawterm/include/dtos.h
  15. 2 1
      sys/src/cmd/unix/drawterm/include/lib.h
  16. 2 2
      sys/src/cmd/unix/drawterm/include/user.h
  17. 0 0
      sys/src/cmd/unix/drawterm/include/x
  18. 0 1
      sys/src/cmd/unix/drawterm/kern/Makefile
  19. 4 4
      sys/src/cmd/unix/drawterm/kern/allocb.c
  20. 2 2
      sys/src/cmd/unix/drawterm/kern/chan.c
  21. 3 3
      sys/src/cmd/unix/drawterm/kern/dat.h
  22. 1 0
      sys/src/cmd/unix/drawterm/kern/devaudio-unix.c
  23. 12 12
      sys/src/cmd/unix/drawterm/kern/devaudio.c
  24. 12 7
      sys/src/cmd/unix/drawterm/kern/devcons.c
  25. 36 6
      sys/src/cmd/unix/drawterm/kern/devdraw.c
  26. 5 1
      sys/src/cmd/unix/drawterm/kern/devip.c
  27. 4 4
      sys/src/cmd/unix/drawterm/kern/devlfd.c
  28. 3 3
      sys/src/cmd/unix/drawterm/kern/devmnt.c
  29. 1 1
      sys/src/cmd/unix/drawterm/kern/devssl.c
  30. 12 10
      sys/src/cmd/unix/drawterm/kern/devtls.c
  31. 2 1
      sys/src/cmd/unix/drawterm/kern/fns.h
  32. 7 0
      sys/src/cmd/unix/drawterm/kern/posix.c
  33. 3 3
      sys/src/cmd/unix/drawterm/kern/qio.c
  34. 1 1
      sys/src/cmd/unix/drawterm/kern/stub.c
  35. 9 9
      sys/src/cmd/unix/drawterm/kern/sysfile.c
  36. 24 0
      sys/src/cmd/unix/drawterm/kern/win32.c
  37. 1 1
      sys/src/cmd/unix/drawterm/libauth/auth_getuserpasswd.c
  38. 2 1
      sys/src/cmd/unix/drawterm/libauth/auth_proxy.c
  39. 1 1
      sys/src/cmd/unix/drawterm/libauth/auth_respond.c
  40. 5 1
      sys/src/cmd/unix/drawterm/libc/dofmt.c
  41. 2 2
      sys/src/cmd/unix/drawterm/libc/fmt.c
  42. 1 1
      sys/src/cmd/unix/drawterm/libc/fmtquote.c
  43. 1 1
      sys/src/cmd/unix/drawterm/libc/lock.c
  44. 1 1
      sys/src/cmd/unix/drawterm/libc/runevseprint.c
  45. 1 1
      sys/src/cmd/unix/drawterm/libc/runevsnprint.c
  46. 1 1
      sys/src/cmd/unix/drawterm/libc/strtod.c
  47. 2 2
      sys/src/cmd/unix/drawterm/libc/strtoll.c
  48. 12 8
      sys/src/cmd/unix/drawterm/libmemdraw/alloc.c
  49. 1 1
      sys/src/cmd/unix/drawterm/libmemdraw/defont.c
  50. 1 1
      sys/src/cmd/unix/drawterm/libmemdraw/draw.c
  51. 3 3
      sys/src/cmd/unix/drawterm/libmemlayer/lsetrefresh.c
  52. 1 1
      sys/src/cmd/unix/drawterm/libmp/dat.h
  53. 2 2
      sys/src/cmd/unix/drawterm/posix-386/getcallerpc.c
  54. 17 0
      sys/src/cmd/unix/drawterm/posix-amd64/Makefile
  55. 8 0
      sys/src/cmd/unix/drawterm/posix-amd64/getcallerpc.c
  56. 268 0
      sys/src/cmd/unix/drawterm/posix-amd64/md5block.c
  57. 189 0
      sys/src/cmd/unix/drawterm/posix-amd64/sha1block.c
  58. 23 0
      sys/src/cmd/unix/drawterm/posix-amd64/tas.c
  59. 25 0
      sys/src/cmd/unix/drawterm/posix-mips/Makefile
  60. 8 0
      sys/src/cmd/unix/drawterm/posix-mips/getcallerpc.c
  61. 268 0
      sys/src/cmd/unix/drawterm/posix-mips/md5block.c
  62. 189 0
      sys/src/cmd/unix/drawterm/posix-mips/sha1block.c
  63. 21 0
      sys/src/cmd/unix/drawterm/posix-mips/tas.s
  64. 2 2
      sys/src/cmd/unix/drawterm/posix-power/getcallerpc.c
  65. 26 0
      sys/src/cmd/unix/drawterm/posix-sun4u/Makefile
  66. 9 0
      sys/src/cmd/unix/drawterm/posix-sun4u/getcallerpc.c
  67. 268 0
      sys/src/cmd/unix/drawterm/posix-sun4u/md5block.c
  68. 189 0
      sys/src/cmd/unix/drawterm/posix-sun4u/sha1block.c
  69. 5 0
      sys/src/cmd/unix/drawterm/posix-sun4u/tas.s
  70. 2 2
      sys/src/cmd/unix/drawterm/win32-386/getcallerpc.c

+ 70 - 51
dist/replica/_plan9.db

@@ -263,7 +263,7 @@
 386/bin/getmap - 775 sys sys 1143777794 65518
 386/bin/gif - 775 sys sys 1143777794 158561
 386/bin/grap - 775 sys sys 1136656337 280496
-386/bin/graph - 775 sys sys 1143777795 127643
+386/bin/graph - 775 sys sys 1148230842 129345
 386/bin/grep - 775 sys sys 1143777795 79406
 386/bin/gs - 775 sys sys 1137468663 13275174
 386/bin/gunzip - 775 sys sys 1144688930 80618
@@ -7303,7 +7303,7 @@ sys/man/1/fortune - 664 sys sys 944959673 449
 sys/man/1/freq - 664 sys sys 1136378272 735
 sys/man/1/games - 664 sys sys 1137080360 5373
 sys/man/1/grap - 664 sys sys 944959675 6417
-sys/man/1/graph - 664 sys sys 944959673 2858
+sys/man/1/graph - 664 sys sys 1148227125 3061
 sys/man/1/grep - 664 sys sys 1139690020 2257
 sys/man/1/gs - 664 sys sys 1032054727 6906
 sys/man/1/gview - 664 sys sys 1136378273 4361
@@ -7468,7 +7468,7 @@ sys/man/2/frexp - 664 sys sys 984709631 871
 sys/man/2/fscanf - 664 sys sys 1048637160 10550
 sys/man/2/fversion - 664 sys sys 1017423720 1654
 sys/man/2/genrandom - 664 sys sys 1017251164 876
-sys/man/2/getcallerpc - 664 sys sys 964455063 670
+sys/man/2/getcallerpc - 664 sys sys 1148227548 666
 sys/man/2/getenv - 664 sys sys 944959695 685
 sys/man/2/getfcr - 664 sys sys 1015091521 2713
 sys/man/2/getfields - 664 sys sys 1068209043 1605
@@ -10220,7 +10220,7 @@ sys/src/cmd/grap/plot.c - 664 sys sys 944960999 2783
 sys/src/cmd/grap/print.c - 664 sys sys 944960999 5254
 sys/src/cmd/grap/ticks.c - 664 sys sys 944960999 10887
 sys/src/cmd/graph - 20000000775 sys sys 944960999 0
-sys/src/cmd/graph/graph.c - 664 sys sys 944960999 12304
+sys/src/cmd/graph/graph.c - 664 sys sys 1148227144 13164
 sys/src/cmd/graph/iplot.h - 664 sys sys 944960999 2141
 sys/src/cmd/graph/mkfile - 664 sys sys 944960999 108
 sys/src/cmd/graph/subr.c - 664 sys sys 985051276 321
@@ -13472,14 +13472,15 @@ sys/src/cmd/unix/drawterm/LICENSE - 664 sys sys 1135900534 12184
 sys/src/cmd/unix/drawterm/Make.config - 664 sys sys 1142177508 40
 sys/src/cmd/unix/drawterm/Make.irix - 664 sys sys 1137502401 493
 sys/src/cmd/unix/drawterm/Make.osx - 664 sys sys 1144150883 426
+sys/src/cmd/unix/drawterm/Make.sun - 664 sys sys 1148233748 377
 sys/src/cmd/unix/drawterm/Make.unix - 664 sys sys 1142177512 453
 sys/src/cmd/unix/drawterm/Make.win32 - 664 sys sys 1141662620 826
 sys/src/cmd/unix/drawterm/Makefile - 664 sys sys 1135900534 1112
-sys/src/cmd/unix/drawterm/README - 664 sys sys 1138469123 1002
+sys/src/cmd/unix/drawterm/README - 664 sys sys 1148233748 1056
 sys/src/cmd/unix/drawterm/args.h - 664 sys sys 1135900534 709
 sys/src/cmd/unix/drawterm/bin - 20000000775 sys sys 959090509 0
 sys/src/cmd/unix/drawterm/cpu-bl.c - 664 sys sys 1135900534 14118
-sys/src/cmd/unix/drawterm/cpu.c - 664 sys sys 1135900534 13988
+sys/src/cmd/unix/drawterm/cpu.c - 664 sys sys 1148233749 13982
 sys/src/cmd/unix/drawterm/drawterm.h - 664 sys sys 1135900535 472
 sys/src/cmd/unix/drawterm/drawterm.ico - 664 sys sys 1135900535 1662
 sys/src/cmd/unix/drawterm/drawterm.rc - 664 sys sys 1135900535 1713
@@ -13488,7 +13489,7 @@ sys/src/cmd/unix/drawterm/exportfs - 20000000775 sys sys 1135900552 0
 sys/src/cmd/unix/drawterm/exportfs/Makefile - 664 sys sys 1135900552 200
 sys/src/cmd/unix/drawterm/exportfs/exportfs.c - 664 sys sys 1135900552 8412
 sys/src/cmd/unix/drawterm/exportfs/exportfs.h - 664 sys sys 1135900552 2738
-sys/src/cmd/unix/drawterm/exportfs/exportsrv.c - 664 sys sys 1135900552 10966
+sys/src/cmd/unix/drawterm/exportfs/exportsrv.c - 664 sys sys 1148233789 11046
 sys/src/cmd/unix/drawterm/gui-win32 - 20000000775 sys sys 1135900547 0
 sys/src/cmd/unix/drawterm/gui-win32/Makefile - 664 sys sys 1135900546 220
 sys/src/cmd/unix/drawterm/gui-win32/alloc.c - 664 sys sys 1135900546 286
@@ -13506,19 +13507,19 @@ sys/src/cmd/unix/drawterm/gui-x11/keysym2ucs-x11.c - 664 sys sys 1135900547 6700
 sys/src/cmd/unix/drawterm/gui-x11/keysym2ucs.h - 664 sys sys 1135900548 244
 sys/src/cmd/unix/drawterm/gui-x11/ksym2utf.h - 664 sys sys 1135900548 13549
 sys/src/cmd/unix/drawterm/gui-x11/load.c - 664 sys sys 1135900548 258
-sys/src/cmd/unix/drawterm/gui-x11/screen.c - 664 sys sys 1135900548 24932
-sys/src/cmd/unix/drawterm/gui-x11/xmem.h - 664 sys sys 1135900548 1508
+sys/src/cmd/unix/drawterm/gui-x11/screen.c - 664 sys sys 1148233793 25060
+sys/src/cmd/unix/drawterm/gui-x11/xmem.h - 664 sys sys 1148233793 1510
 sys/src/cmd/unix/drawterm/include - 20000000775 sys sys 1135900799 0
 sys/src/cmd/unix/drawterm/include/9windows.h - 664 sys sys 1135900761 420
 sys/src/cmd/unix/drawterm/include/a.out - 664 sys sys 1135900761 4522
-sys/src/cmd/unix/drawterm/include/auth.h - 664 sys sys 1135900761 3536
+sys/src/cmd/unix/drawterm/include/auth.h - 664 sys sys 1148233794 3538
 sys/src/cmd/unix/drawterm/include/authsrv.h - 664 sys sys 1135900762 4562
 sys/src/cmd/unix/drawterm/include/cursor.h - 664 sys sys 1135900762 70
 sys/src/cmd/unix/drawterm/include/draw.h - 664 sys sys 1135900762 16052
-sys/src/cmd/unix/drawterm/include/dtos.h - 664 sys sys 1135900762 358
+sys/src/cmd/unix/drawterm/include/dtos.h - 664 sys sys 1148233795 392
 sys/src/cmd/unix/drawterm/include/fcall.h - 664 sys sys 1135900762 2676
 sys/src/cmd/unix/drawterm/include/keyboard.h - 664 sys sys 1135900762 920
-sys/src/cmd/unix/drawterm/include/lib.h - 664 sys sys 1144150883 7495
+sys/src/cmd/unix/drawterm/include/lib.h - 664 sys sys 1148233795 7540
 sys/src/cmd/unix/drawterm/include/libc.h - 664 sys sys 1135900763 36
 sys/src/cmd/unix/drawterm/include/libsec.h - 664 sys sys 1135900763 8861
 sys/src/cmd/unix/drawterm/include/memdraw.h - 664 sys sys 1135900763 6306
@@ -13526,69 +13527,70 @@ sys/src/cmd/unix/drawterm/include/memlayer.h - 664 sys sys 1135900763 1871
 sys/src/cmd/unix/drawterm/include/mp.h - 664 sys sys 1135900763 4524
 sys/src/cmd/unix/drawterm/include/u.h - 664 sys sys 1135900763 336
 sys/src/cmd/unix/drawterm/include/unix.h - 664 sys sys 1137506303 349
-sys/src/cmd/unix/drawterm/include/user.h - 664 sys sys 1135900764 2532
+sys/src/cmd/unix/drawterm/include/user.h - 664 sys sys 1148233796 2534
+sys/src/cmd/unix/drawterm/include/x - 664 sys sys 1148233796 0
 sys/src/cmd/unix/drawterm/kern - 20000000775 sys sys 1135900801 0
-sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1144150884 620
-sys/src/cmd/unix/drawterm/kern/allocb.c - 664 sys sys 1135900764 3172
+sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1148233801 610
+sys/src/cmd/unix/drawterm/kern/allocb.c - 664 sys sys 1148233801 3176
 sys/src/cmd/unix/drawterm/kern/cache.c - 664 sys sys 1135900764 466
-sys/src/cmd/unix/drawterm/kern/chan.c - 664 sys sys 1135900764 29593
-sys/src/cmd/unix/drawterm/kern/dat.h - 664 sys sys 1135900765 10716
+sys/src/cmd/unix/drawterm/kern/chan.c - 664 sys sys 1148233801 29589
+sys/src/cmd/unix/drawterm/kern/dat.h - 664 sys sys 1148233802 10717
 sys/src/cmd/unix/drawterm/kern/data.c - 664 sys sys 1135900765 423
 sys/src/cmd/unix/drawterm/kern/dev.c - 664 sys sys 1135900765 8523
 sys/src/cmd/unix/drawterm/kern/devaudio-none.c - 664 sys sys 1144150884 628
-sys/src/cmd/unix/drawterm/kern/devaudio-unix.c - 664 sys sys 1142177493 3064
-sys/src/cmd/unix/drawterm/kern/devaudio.c - 664 sys sys 1142177494 6144
+sys/src/cmd/unix/drawterm/kern/devaudio-unix.c - 664 sys sys 1148233803 3076
+sys/src/cmd/unix/drawterm/kern/devaudio.c - 664 sys sys 1148233803 6070
 sys/src/cmd/unix/drawterm/kern/devaudio.h - 664 sys sys 1142177494 328
-sys/src/cmd/unix/drawterm/kern/devcons.c - 664 sys sys 1135900765 19526
-sys/src/cmd/unix/drawterm/kern/devdraw.c - 664 sys sys 1135900765 42481
+sys/src/cmd/unix/drawterm/kern/devcons.c - 664 sys sys 1148254417 19607
+sys/src/cmd/unix/drawterm/kern/devdraw.c - 664 sys sys 1148233804 43429
 sys/src/cmd/unix/drawterm/kern/devfs-posix.c - 664 sys sys 1135900765 9772
 sys/src/cmd/unix/drawterm/kern/devfs-win32.c - 664 sys sys 1135900766 10723
 sys/src/cmd/unix/drawterm/kern/devip-posix.c - 664 sys sys 1135900766 3488
 sys/src/cmd/unix/drawterm/kern/devip-win32.c - 664 sys sys 1135900766 3534
-sys/src/cmd/unix/drawterm/kern/devip.c - 664 sys sys 1135900766 16045
+sys/src/cmd/unix/drawterm/kern/devip.c - 664 sys sys 1148233804 16112
 sys/src/cmd/unix/drawterm/kern/devip.h - 664 sys sys 1135900766 469
-sys/src/cmd/unix/drawterm/kern/devlfd.c - 664 sys sys 1135900766 1534
-sys/src/cmd/unix/drawterm/kern/devmnt.c - 664 sys sys 1135900767 21739
+sys/src/cmd/unix/drawterm/kern/devlfd.c - 664 sys sys 1148233805 1570
+sys/src/cmd/unix/drawterm/kern/devmnt.c - 664 sys sys 1148233805 21733
 sys/src/cmd/unix/drawterm/kern/devmouse.c - 664 sys sys 1135900767 3799
 sys/src/cmd/unix/drawterm/kern/devpipe.c - 664 sys sys 1135900767 5927
 sys/src/cmd/unix/drawterm/kern/devroot.c - 664 sys sys 1137502216 4755
-sys/src/cmd/unix/drawterm/kern/devssl.c - 664 sys sys 1135900767 26455
+sys/src/cmd/unix/drawterm/kern/devssl.c - 664 sys sys 1148233806 26453
 sys/src/cmd/unix/drawterm/kern/devtab.c - 664 sys sys 1144150884 544
-sys/src/cmd/unix/drawterm/kern/devtls.c - 664 sys sys 1147099089 45427
+sys/src/cmd/unix/drawterm/kern/devtls.c - 664 sys sys 1148233806 45303
 sys/src/cmd/unix/drawterm/kern/error.c - 664 sys sys 1135900767 2100
 sys/src/cmd/unix/drawterm/kern/error.h - 664 sys sys 1135900768 2583
 sys/src/cmd/unix/drawterm/kern/exportfs.c - 664 sys sys 1135900768 13444
-sys/src/cmd/unix/drawterm/kern/fns.h - 664 sys sys 1135900768 10731
+sys/src/cmd/unix/drawterm/kern/fns.h - 664 sys sys 1148254417 10766
 sys/src/cmd/unix/drawterm/kern/netif.h - 664 sys sys 1135900768 2950
 sys/src/cmd/unix/drawterm/kern/parse.c - 664 sys sys 1135900768 1993
 sys/src/cmd/unix/drawterm/kern/pgrp.c - 664 sys sys 1135900768 4017
-sys/src/cmd/unix/drawterm/kern/posix.c - 664 sys sys 1135900768 3149
+sys/src/cmd/unix/drawterm/kern/posix.c - 664 sys sys 1148254418 3251
 sys/src/cmd/unix/drawterm/kern/procinit.c - 664 sys sys 1135900769 1039
-sys/src/cmd/unix/drawterm/kern/qio.c - 664 sys sys 1135900769 23496
+sys/src/cmd/unix/drawterm/kern/qio.c - 664 sys sys 1148233807 23490
 sys/src/cmd/unix/drawterm/kern/qlock.c - 664 sys sys 1135900769 1119
 sys/src/cmd/unix/drawterm/kern/rendez.c - 664 sys sys 1135900769 1293
 sys/src/cmd/unix/drawterm/kern/rwlock.c - 664 sys sys 1135900769 634
 sys/src/cmd/unix/drawterm/kern/screen.h - 664 sys sys 1135900769 1151
 sys/src/cmd/unix/drawterm/kern/sleep.c - 664 sys sys 1135900769 1293
 sys/src/cmd/unix/drawterm/kern/smalloc.c - 664 sys sys 1135900769 187
-sys/src/cmd/unix/drawterm/kern/stub.c - 664 sys sys 1135900770 1273
+sys/src/cmd/unix/drawterm/kern/stub.c - 664 sys sys 1148233808 1275
 sys/src/cmd/unix/drawterm/kern/syscall.c - 664 sys sys 1135900770 12876
-sys/src/cmd/unix/drawterm/kern/sysfile.c - 664 sys sys 1137502217 18037
+sys/src/cmd/unix/drawterm/kern/sysfile.c - 664 sys sys 1148233809 18059
 sys/src/cmd/unix/drawterm/kern/sysproc.c - 664 sys sys 1135900770 498
 sys/src/cmd/unix/drawterm/kern/term.c - 664 sys sys 1135900770 3962
 sys/src/cmd/unix/drawterm/kern/todo.c - 664 sys sys 1135900770 0
 sys/src/cmd/unix/drawterm/kern/uart.c - 664 sys sys 1135900771 178
 sys/src/cmd/unix/drawterm/kern/waserror.c - 664 sys sys 1135900771 382
-sys/src/cmd/unix/drawterm/kern/win32.c - 664 sys sys 1135900771 7800
+sys/src/cmd/unix/drawterm/kern/win32.c - 664 sys sys 1148254419 8237
 sys/src/cmd/unix/drawterm/latin1.c - 664 sys sys 1135900535 7806
 sys/src/cmd/unix/drawterm/libauth - 20000000775 sys sys 1135900560 0
 sys/src/cmd/unix/drawterm/libauth/Makefile - 664 sys sys 1135900556 306
 sys/src/cmd/unix/drawterm/libauth/attr.c - 664 sys sys 1135900556 2857
 sys/src/cmd/unix/drawterm/libauth/auth_attr.c - 664 sys sys 1135900556 217
 sys/src/cmd/unix/drawterm/libauth/auth_challenge.c - 664 sys sys 1135900556 1976
-sys/src/cmd/unix/drawterm/libauth/auth_getuserpasswd.c - 664 sys sys 1135900556 1363
-sys/src/cmd/unix/drawterm/libauth/auth_proxy.c - 664 sys sys 1135900557 3606
-sys/src/cmd/unix/drawterm/libauth/auth_respond.c - 664 sys sys 1135900560 1420
+sys/src/cmd/unix/drawterm/libauth/auth_getuserpasswd.c - 664 sys sys 1148233812 1361
+sys/src/cmd/unix/drawterm/libauth/auth_proxy.c - 664 sys sys 1148233812 3614
+sys/src/cmd/unix/drawterm/libauth/auth_respond.c - 664 sys sys 1148233812 1418
 sys/src/cmd/unix/drawterm/libauth/auth_rpc.c - 664 sys sys 1135900560 2064
 sys/src/cmd/unix/drawterm/libauth/auth_userpasswd.c - 664 sys sys 1135900560 1097
 sys/src/cmd/unix/drawterm/libauth/authlocal.h - 664 sys sys 1135900560 87
@@ -13625,19 +13627,19 @@ sys/src/cmd/unix/drawterm/libc/dirfwstat.c - 664 sys sys 1135900563 242
 sys/src/cmd/unix/drawterm/libc/dirmodefmt.c - 664 sys sys 1135900563 581
 sys/src/cmd/unix/drawterm/libc/dirstat.c - 664 sys sys 1135900563 688
 sys/src/cmd/unix/drawterm/libc/dirwstat.c - 664 sys sys 1135900564 246
-sys/src/cmd/unix/drawterm/libc/dofmt.c - 664 sys sys 1137619295 9020
+sys/src/cmd/unix/drawterm/libc/dofmt.c - 664 sys sys 1148233816 9121
 sys/src/cmd/unix/drawterm/libc/dorfmt.c - 664 sys sys 1137619295 791
 sys/src/cmd/unix/drawterm/libc/encodefmt.c - 664 sys sys 1144150884 1100
 sys/src/cmd/unix/drawterm/libc/errfmt.c - 664 sys sys 1135900564 175
 sys/src/cmd/unix/drawterm/libc/fcallfmt.c - 664 sys sys 1135900564 5740
 sys/src/cmd/unix/drawterm/libc/fltfmt.c - 664 sys sys 1137619295 6302
-sys/src/cmd/unix/drawterm/libc/fmt.c - 664 sys sys 1137619296 3444
+sys/src/cmd/unix/drawterm/libc/fmt.c - 664 sys sys 1148233816 3440
 sys/src/cmd/unix/drawterm/libc/fmtdef.h - 664 sys sys 1137619328 2714
 sys/src/cmd/unix/drawterm/libc/fmtfd.c - 664 sys sys 1137619296 543
 sys/src/cmd/unix/drawterm/libc/fmtfdflush.c - 664 sys sys 1137619296 330
 sys/src/cmd/unix/drawterm/libc/fmtlock.c - 664 sys sys 1137506309 136
 sys/src/cmd/unix/drawterm/libc/fmtprint.c - 664 sys sys 1137619296 510
-sys/src/cmd/unix/drawterm/libc/fmtquote.c - 664 sys sys 1137619296 4763
+sys/src/cmd/unix/drawterm/libc/fmtquote.c - 664 sys sys 1148233817 4761
 sys/src/cmd/unix/drawterm/libc/fmtrune.c - 664 sys sys 1137619296 328
 sys/src/cmd/unix/drawterm/libc/fmtstr.c - 664 sys sys 1137619297 167
 sys/src/cmd/unix/drawterm/libc/fmtvprint.c - 664 sys sys 1137619297 519
@@ -13646,7 +13648,7 @@ sys/src/cmd/unix/drawterm/libc/frand.c - 664 sys sys 1135900566 210
 sys/src/cmd/unix/drawterm/libc/getfields.c - 664 sys sys 1135900566 516
 sys/src/cmd/unix/drawterm/libc/getpid.c - 664 sys sys 1135900566 198
 sys/src/cmd/unix/drawterm/libc/lnrand.c - 664 sys sys 1135900566 194
-sys/src/cmd/unix/drawterm/libc/lock.c - 664 sys sys 1135900566 774
+sys/src/cmd/unix/drawterm/libc/lock.c - 664 sys sys 1148233818 773
 sys/src/cmd/unix/drawterm/libc/lrand.c - 664 sys sys 1135900566 1109
 sys/src/cmd/unix/drawterm/libc/mallocz.c - 664 sys sys 1135900566 141
 sys/src/cmd/unix/drawterm/libc/nan.h - 664 sys sys 1135900566 114
@@ -13680,17 +13682,17 @@ sys/src/cmd/unix/drawterm/libc/runestrncpy.c - 664 sys sys 1135900569 234
 sys/src/cmd/unix/drawterm/libc/runestrrchr.c - 664 sys sys 1135900569 182
 sys/src/cmd/unix/drawterm/libc/runestrstr.c - 664 sys sys 1135900570 397
 sys/src/cmd/unix/drawterm/libc/runetype.c - 664 sys sys 1135900570 29655
-sys/src/cmd/unix/drawterm/libc/runevseprint.c - 664 sys sys 1137619306 364
+sys/src/cmd/unix/drawterm/libc/runevseprint.c - 664 sys sys 1148233820 362
 sys/src/cmd/unix/drawterm/libc/runevsmprint.c - 664 sys sys 1137619306 1103
-sys/src/cmd/unix/drawterm/libc/runevsnprint.c - 664 sys sys 1137619307 374
+sys/src/cmd/unix/drawterm/libc/runevsnprint.c - 664 sys sys 1148233821 372
 sys/src/cmd/unix/drawterm/libc/seprint.c - 664 sys sys 1137619307 216
 sys/src/cmd/unix/drawterm/libc/smprint.c - 664 sys sys 1137619307 188
 sys/src/cmd/unix/drawterm/libc/snprint.c - 664 sys sys 1137619307 215
 sys/src/cmd/unix/drawterm/libc/sprint.c - 664 sys sys 1137619307 444
 sys/src/cmd/unix/drawterm/libc/strecpy.c - 664 sys sys 1135900571 223
-sys/src/cmd/unix/drawterm/libc/strtod.c - 664 sys sys 1144256614 8407
+sys/src/cmd/unix/drawterm/libc/strtod.c - 664 sys sys 1148233822 8409
 sys/src/cmd/unix/drawterm/libc/strtod.h - 664 sys sys 1135900571 120
-sys/src/cmd/unix/drawterm/libc/strtoll.c - 664 sys sys 1135900571 1302
+sys/src/cmd/unix/drawterm/libc/strtoll.c - 664 sys sys 1148233823 1320
 sys/src/cmd/unix/drawterm/libc/sysfatal.c - 664 sys sys 1135900571 479
 sys/src/cmd/unix/drawterm/libc/time.c - 664 sys sys 1135900571 878
 sys/src/cmd/unix/drawterm/libc/tokenize.c - 664 sys sys 1135900571 1691
@@ -13724,15 +13726,15 @@ sys/src/cmd/unix/drawterm/libdraw/rectclip.c - 664 sys sys 1135900575 571
 sys/src/cmd/unix/drawterm/libdraw/rgb.c - 664 sys sys 1135900575 1679
 sys/src/cmd/unix/drawterm/libmemdraw - 20000000775 sys sys 954098724 0
 sys/src/cmd/unix/drawterm/libmemdraw/Makefile - 664 sys sys 1135900575 391
-sys/src/cmd/unix/drawterm/libmemdraw/alloc.c - 664 sys sys 1135900575 3309
+sys/src/cmd/unix/drawterm/libmemdraw/alloc.c - 664 sys sys 1148233825 3410
 sys/src/cmd/unix/drawterm/libmemdraw/alpha.hoc - 664 sys sys 1135900575 220
 sys/src/cmd/unix/drawterm/libmemdraw/arc.c - 664 sys sys 1135900575 2608
 sys/src/cmd/unix/drawterm/libmemdraw/arctest.c - 664 sys sys 1135900575 865
 sys/src/cmd/unix/drawterm/libmemdraw/cload.c - 664 sys sys 1135900576 1338
 sys/src/cmd/unix/drawterm/libmemdraw/cmap.c - 664 sys sys 1135900576 25150
 sys/src/cmd/unix/drawterm/libmemdraw/cread.c - 664 sys sys 1135900576 1982
-sys/src/cmd/unix/drawterm/libmemdraw/defont.c - 664 sys sys 1135900576 1293
-sys/src/cmd/unix/drawterm/libmemdraw/draw.c - 664 sys sys 1137502231 54659
+sys/src/cmd/unix/drawterm/libmemdraw/defont.c - 664 sys sys 1148233826 1295
+sys/src/cmd/unix/drawterm/libmemdraw/draw.c - 664 sys sys 1148233827 54657
 sys/src/cmd/unix/drawterm/libmemdraw/drawtest.c - 664 sys sys 1135900576 23441
 sys/src/cmd/unix/drawterm/libmemdraw/ellipse.c - 664 sys sys 1135900576 4864
 sys/src/cmd/unix/drawterm/libmemdraw/fillpoly.c - 664 sys sys 1135900576 9973
@@ -13759,7 +13761,7 @@ sys/src/cmd/unix/drawterm/libmemlayer/lhide.c - 664 sys sys 1135900579 1675
 sys/src/cmd/unix/drawterm/libmemlayer/line.c - 664 sys sys 1135900579 2587
 sys/src/cmd/unix/drawterm/libmemlayer/load.c - 664 sys sys 1135900579 1032
 sys/src/cmd/unix/drawterm/libmemlayer/lorigin.c - 664 sys sys 1135900579 2507
-sys/src/cmd/unix/drawterm/libmemlayer/lsetrefresh.c - 664 sys sys 1135900579 703
+sys/src/cmd/unix/drawterm/libmemlayer/lsetrefresh.c - 664 sys sys 1148233829 695
 sys/src/cmd/unix/drawterm/libmemlayer/ltofront.c - 664 sys sys 1135900579 1289
 sys/src/cmd/unix/drawterm/libmemlayer/ltorear.c - 664 sys sys 1135900579 1062
 sys/src/cmd/unix/drawterm/libmemlayer/unload.c - 664 sys sys 1135900579 1007
@@ -13768,7 +13770,7 @@ sys/src/cmd/unix/drawterm/libmp/Makefile - 664 sys sys 1135900580 602
 sys/src/cmd/unix/drawterm/libmp/betomp.c - 664 sys sys 1135900580 577
 sys/src/cmd/unix/drawterm/libmp/crt.c - 664 sys sys 1135900580 2050
 sys/src/cmd/unix/drawterm/libmp/crttest.c - 664 sys sys 1135900580 813
-sys/src/cmd/unix/drawterm/libmp/dat.h - 664 sys sys 1135900580 464
+sys/src/cmd/unix/drawterm/libmp/dat.h - 664 sys sys 1148233830 465
 sys/src/cmd/unix/drawterm/libmp/letomp.c - 664 sys sys 1135900581 455
 sys/src/cmd/unix/drawterm/libmp/mpadd.c - 664 sys sys 1135900581 783
 sys/src/cmd/unix/drawterm/libmp/mpaux.c - 664 sys sys 1135900581 2564
@@ -13862,24 +13864,41 @@ sys/src/cmd/unix/drawterm/libsec/x509.c - 664 sys sys 1135900592 50237
 sys/src/cmd/unix/drawterm/main.c - 664 sys sys 1142177501 2443
 sys/src/cmd/unix/drawterm/posix-386 - 20000000775 sys sys 1135900540 0
 sys/src/cmd/unix/drawterm/posix-386/Makefile - 664 sys sys 1135900540 378
-sys/src/cmd/unix/drawterm/posix-386/getcallerpc.c - 664 sys sys 1135900540 90
+sys/src/cmd/unix/drawterm/posix-386/getcallerpc.c - 664 sys sys 1148233712 94
 sys/src/cmd/unix/drawterm/posix-386/md5block.spp - 664 sys sys 1135900540 6472
 sys/src/cmd/unix/drawterm/posix-386/sha1block.spp - 664 sys sys 1135900540 4749
 sys/src/cmd/unix/drawterm/posix-386/tas.c - 664 sys sys 1135900540 270
+sys/src/cmd/unix/drawterm/posix-amd64 - 20000000775 sys sys 1148233713 0
+sys/src/cmd/unix/drawterm/posix-amd64/Makefile - 664 sys sys 1148233713 227
+sys/src/cmd/unix/drawterm/posix-amd64/getcallerpc.c - 664 sys sys 1148233713 90
+sys/src/cmd/unix/drawterm/posix-amd64/md5block.c - 664 sys sys 1148233713 5032
+sys/src/cmd/unix/drawterm/posix-amd64/sha1block.c - 664 sys sys 1148233713 4710
+sys/src/cmd/unix/drawterm/posix-amd64/tas.c - 664 sys sys 1148233713 273
 sys/src/cmd/unix/drawterm/posix-factotum.c - 664 sys sys 1135900536 1880
 sys/src/cmd/unix/drawterm/posix-mips - 20000000775 sys sys 1135900037 0
+sys/src/cmd/unix/drawterm/posix-mips/Makefile - 664 sys sys 1148233713 302
+sys/src/cmd/unix/drawterm/posix-mips/getcallerpc.c - 664 sys sys 1148233714 90
+sys/src/cmd/unix/drawterm/posix-mips/md5block.c - 664 sys sys 1148233714 5032
+sys/src/cmd/unix/drawterm/posix-mips/sha1block.c - 664 sys sys 1148233714 4710
+sys/src/cmd/unix/drawterm/posix-mips/tas.s - 664 sys sys 1148233714 377
 sys/src/cmd/unix/drawterm/posix-power - 20000000775 sys sys 1135900541 0
 sys/src/cmd/unix/drawterm/posix-power/Makefile - 664 sys sys 1135900541 291
-sys/src/cmd/unix/drawterm/posix-power/getcallerpc.c - 664 sys sys 1135900541 90
+sys/src/cmd/unix/drawterm/posix-power/getcallerpc.c - 664 sys sys 1148233714 94
 sys/src/cmd/unix/drawterm/posix-power/md5block.c - 664 sys sys 1135900541 5032
 sys/src/cmd/unix/drawterm/posix-power/sha1block.c - 664 sys sys 1135900541 4710
 sys/src/cmd/unix/drawterm/posix-power/tas.c - 664 sys sys 1135900541 943
+sys/src/cmd/unix/drawterm/posix-sun4u - 20000000775 sys sys 1148233715 0
+sys/src/cmd/unix/drawterm/posix-sun4u/Makefile - 664 sys sys 1148233715 292
+sys/src/cmd/unix/drawterm/posix-sun4u/getcallerpc.c - 664 sys sys 1148233715 91
+sys/src/cmd/unix/drawterm/posix-sun4u/md5block.c - 664 sys sys 1148233715 5032
+sys/src/cmd/unix/drawterm/posix-sun4u/sha1block.c - 664 sys sys 1148233715 4710
+sys/src/cmd/unix/drawterm/posix-sun4u/tas.s - 664 sys sys 1148233715 42
 sys/src/cmd/unix/drawterm/readcons.c - 664 sys sys 1135900536 1842
 sys/src/cmd/unix/drawterm/resource.h - 664 sys sys 1135900536 457
 sys/src/cmd/unix/drawterm/secstore.c - 664 sys sys 1135900536 15742
 sys/src/cmd/unix/drawterm/win32-386 - 20000000775 sys sys 1135900544 0
 sys/src/cmd/unix/drawterm/win32-386/Makefile - 664 sys sys 1135900544 291
-sys/src/cmd/unix/drawterm/win32-386/getcallerpc.c - 664 sys sys 1135900544 90
+sys/src/cmd/unix/drawterm/win32-386/getcallerpc.c - 664 sys sys 1148233841 94
 sys/src/cmd/unix/drawterm/win32-386/md5block.spp - 664 sys sys 1135900544 6591
 sys/src/cmd/unix/drawterm/win32-386/sha1block.spp - 664 sys sys 1135900544 4912
 sys/src/cmd/unix/drawterm/win32-386/tas.c - 664 sys sys 1135900544 270

+ 70 - 51
dist/replica/plan9.db

@@ -263,7 +263,7 @@
 386/bin/getmap - 775 sys sys 1143777794 65518
 386/bin/gif - 775 sys sys 1143777794 158561
 386/bin/grap - 775 sys sys 1136656337 280496
-386/bin/graph - 775 sys sys 1143777795 127643
+386/bin/graph - 775 sys sys 1148230842 129345
 386/bin/grep - 775 sys sys 1143777795 79406
 386/bin/gs - 775 sys sys 1137468663 13275174
 386/bin/gunzip - 775 sys sys 1144688930 80618
@@ -7303,7 +7303,7 @@ sys/man/1/fortune - 664 sys sys 944959673 449
 sys/man/1/freq - 664 sys sys 1136378272 735
 sys/man/1/games - 664 sys sys 1137080360 5373
 sys/man/1/grap - 664 sys sys 944959675 6417
-sys/man/1/graph - 664 sys sys 944959673 2858
+sys/man/1/graph - 664 sys sys 1148227125 3061
 sys/man/1/grep - 664 sys sys 1139690020 2257
 sys/man/1/gs - 664 sys sys 1032054727 6906
 sys/man/1/gview - 664 sys sys 1136378273 4361
@@ -7468,7 +7468,7 @@ sys/man/2/frexp - 664 sys sys 984709631 871
 sys/man/2/fscanf - 664 sys sys 1048637160 10550
 sys/man/2/fversion - 664 sys sys 1017423720 1654
 sys/man/2/genrandom - 664 sys sys 1017251164 876
-sys/man/2/getcallerpc - 664 sys sys 964455063 670
+sys/man/2/getcallerpc - 664 sys sys 1148227548 666
 sys/man/2/getenv - 664 sys sys 944959695 685
 sys/man/2/getfcr - 664 sys sys 1015091521 2713
 sys/man/2/getfields - 664 sys sys 1068209043 1605
@@ -10220,7 +10220,7 @@ sys/src/cmd/grap/plot.c - 664 sys sys 944960999 2783
 sys/src/cmd/grap/print.c - 664 sys sys 944960999 5254
 sys/src/cmd/grap/ticks.c - 664 sys sys 944960999 10887
 sys/src/cmd/graph - 20000000775 sys sys 944960999 0
-sys/src/cmd/graph/graph.c - 664 sys sys 944960999 12304
+sys/src/cmd/graph/graph.c - 664 sys sys 1148227144 13164
 sys/src/cmd/graph/iplot.h - 664 sys sys 944960999 2141
 sys/src/cmd/graph/mkfile - 664 sys sys 944960999 108
 sys/src/cmd/graph/subr.c - 664 sys sys 985051276 321
@@ -13472,14 +13472,15 @@ sys/src/cmd/unix/drawterm/LICENSE - 664 sys sys 1135900534 12184
 sys/src/cmd/unix/drawterm/Make.config - 664 sys sys 1142177508 40
 sys/src/cmd/unix/drawterm/Make.irix - 664 sys sys 1137502401 493
 sys/src/cmd/unix/drawterm/Make.osx - 664 sys sys 1144150883 426
+sys/src/cmd/unix/drawterm/Make.sun - 664 sys sys 1148233748 377
 sys/src/cmd/unix/drawterm/Make.unix - 664 sys sys 1142177512 453
 sys/src/cmd/unix/drawterm/Make.win32 - 664 sys sys 1141662620 826
 sys/src/cmd/unix/drawterm/Makefile - 664 sys sys 1135900534 1112
-sys/src/cmd/unix/drawterm/README - 664 sys sys 1138469123 1002
+sys/src/cmd/unix/drawterm/README - 664 sys sys 1148233748 1056
 sys/src/cmd/unix/drawterm/args.h - 664 sys sys 1135900534 709
 sys/src/cmd/unix/drawterm/bin - 20000000775 sys sys 959090509 0
 sys/src/cmd/unix/drawterm/cpu-bl.c - 664 sys sys 1135900534 14118
-sys/src/cmd/unix/drawterm/cpu.c - 664 sys sys 1135900534 13988
+sys/src/cmd/unix/drawterm/cpu.c - 664 sys sys 1148233749 13982
 sys/src/cmd/unix/drawterm/drawterm.h - 664 sys sys 1135900535 472
 sys/src/cmd/unix/drawterm/drawterm.ico - 664 sys sys 1135900535 1662
 sys/src/cmd/unix/drawterm/drawterm.rc - 664 sys sys 1135900535 1713
@@ -13488,7 +13489,7 @@ sys/src/cmd/unix/drawterm/exportfs - 20000000775 sys sys 1135900552 0
 sys/src/cmd/unix/drawterm/exportfs/Makefile - 664 sys sys 1135900552 200
 sys/src/cmd/unix/drawterm/exportfs/exportfs.c - 664 sys sys 1135900552 8412
 sys/src/cmd/unix/drawterm/exportfs/exportfs.h - 664 sys sys 1135900552 2738
-sys/src/cmd/unix/drawterm/exportfs/exportsrv.c - 664 sys sys 1135900552 10966
+sys/src/cmd/unix/drawterm/exportfs/exportsrv.c - 664 sys sys 1148233789 11046
 sys/src/cmd/unix/drawterm/gui-win32 - 20000000775 sys sys 1135900547 0
 sys/src/cmd/unix/drawterm/gui-win32/Makefile - 664 sys sys 1135900546 220
 sys/src/cmd/unix/drawterm/gui-win32/alloc.c - 664 sys sys 1135900546 286
@@ -13506,19 +13507,19 @@ sys/src/cmd/unix/drawterm/gui-x11/keysym2ucs-x11.c - 664 sys sys 1135900547 6700
 sys/src/cmd/unix/drawterm/gui-x11/keysym2ucs.h - 664 sys sys 1135900548 244
 sys/src/cmd/unix/drawterm/gui-x11/ksym2utf.h - 664 sys sys 1135900548 13549
 sys/src/cmd/unix/drawterm/gui-x11/load.c - 664 sys sys 1135900548 258
-sys/src/cmd/unix/drawterm/gui-x11/screen.c - 664 sys sys 1135900548 24932
-sys/src/cmd/unix/drawterm/gui-x11/xmem.h - 664 sys sys 1135900548 1508
+sys/src/cmd/unix/drawterm/gui-x11/screen.c - 664 sys sys 1148233793 25060
+sys/src/cmd/unix/drawterm/gui-x11/xmem.h - 664 sys sys 1148233793 1510
 sys/src/cmd/unix/drawterm/include - 20000000775 sys sys 1135900799 0
 sys/src/cmd/unix/drawterm/include/9windows.h - 664 sys sys 1135900761 420
 sys/src/cmd/unix/drawterm/include/a.out - 664 sys sys 1135900761 4522
-sys/src/cmd/unix/drawterm/include/auth.h - 664 sys sys 1135900761 3536
+sys/src/cmd/unix/drawterm/include/auth.h - 664 sys sys 1148233794 3538
 sys/src/cmd/unix/drawterm/include/authsrv.h - 664 sys sys 1135900762 4562
 sys/src/cmd/unix/drawterm/include/cursor.h - 664 sys sys 1135900762 70
 sys/src/cmd/unix/drawterm/include/draw.h - 664 sys sys 1135900762 16052
-sys/src/cmd/unix/drawterm/include/dtos.h - 664 sys sys 1135900762 358
+sys/src/cmd/unix/drawterm/include/dtos.h - 664 sys sys 1148233795 392
 sys/src/cmd/unix/drawterm/include/fcall.h - 664 sys sys 1135900762 2676
 sys/src/cmd/unix/drawterm/include/keyboard.h - 664 sys sys 1135900762 920
-sys/src/cmd/unix/drawterm/include/lib.h - 664 sys sys 1144150883 7495
+sys/src/cmd/unix/drawterm/include/lib.h - 664 sys sys 1148233795 7540
 sys/src/cmd/unix/drawterm/include/libc.h - 664 sys sys 1135900763 36
 sys/src/cmd/unix/drawterm/include/libsec.h - 664 sys sys 1135900763 8861
 sys/src/cmd/unix/drawterm/include/memdraw.h - 664 sys sys 1135900763 6306
@@ -13526,69 +13527,70 @@ sys/src/cmd/unix/drawterm/include/memlayer.h - 664 sys sys 1135900763 1871
 sys/src/cmd/unix/drawterm/include/mp.h - 664 sys sys 1135900763 4524
 sys/src/cmd/unix/drawterm/include/u.h - 664 sys sys 1135900763 336
 sys/src/cmd/unix/drawterm/include/unix.h - 664 sys sys 1137506303 349
-sys/src/cmd/unix/drawterm/include/user.h - 664 sys sys 1135900764 2532
+sys/src/cmd/unix/drawterm/include/user.h - 664 sys sys 1148233796 2534
+sys/src/cmd/unix/drawterm/include/x - 664 sys sys 1148233796 0
 sys/src/cmd/unix/drawterm/kern - 20000000775 sys sys 1135900801 0
-sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1144150884 620
-sys/src/cmd/unix/drawterm/kern/allocb.c - 664 sys sys 1135900764 3172
+sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1148233801 610
+sys/src/cmd/unix/drawterm/kern/allocb.c - 664 sys sys 1148233801 3176
 sys/src/cmd/unix/drawterm/kern/cache.c - 664 sys sys 1135900764 466
-sys/src/cmd/unix/drawterm/kern/chan.c - 664 sys sys 1135900764 29593
-sys/src/cmd/unix/drawterm/kern/dat.h - 664 sys sys 1135900765 10716
+sys/src/cmd/unix/drawterm/kern/chan.c - 664 sys sys 1148233801 29589
+sys/src/cmd/unix/drawterm/kern/dat.h - 664 sys sys 1148233802 10717
 sys/src/cmd/unix/drawterm/kern/data.c - 664 sys sys 1135900765 423
 sys/src/cmd/unix/drawterm/kern/dev.c - 664 sys sys 1135900765 8523
 sys/src/cmd/unix/drawterm/kern/devaudio-none.c - 664 sys sys 1144150884 628
-sys/src/cmd/unix/drawterm/kern/devaudio-unix.c - 664 sys sys 1142177493 3064
-sys/src/cmd/unix/drawterm/kern/devaudio.c - 664 sys sys 1142177494 6144
+sys/src/cmd/unix/drawterm/kern/devaudio-unix.c - 664 sys sys 1148233803 3076
+sys/src/cmd/unix/drawterm/kern/devaudio.c - 664 sys sys 1148233803 6070
 sys/src/cmd/unix/drawterm/kern/devaudio.h - 664 sys sys 1142177494 328
-sys/src/cmd/unix/drawterm/kern/devcons.c - 664 sys sys 1135900765 19526
-sys/src/cmd/unix/drawterm/kern/devdraw.c - 664 sys sys 1135900765 42481
+sys/src/cmd/unix/drawterm/kern/devcons.c - 664 sys sys 1148254417 19607
+sys/src/cmd/unix/drawterm/kern/devdraw.c - 664 sys sys 1148233804 43429
 sys/src/cmd/unix/drawterm/kern/devfs-posix.c - 664 sys sys 1135900765 9772
 sys/src/cmd/unix/drawterm/kern/devfs-win32.c - 664 sys sys 1135900766 10723
 sys/src/cmd/unix/drawterm/kern/devip-posix.c - 664 sys sys 1135900766 3488
 sys/src/cmd/unix/drawterm/kern/devip-win32.c - 664 sys sys 1135900766 3534
-sys/src/cmd/unix/drawterm/kern/devip.c - 664 sys sys 1135900766 16045
+sys/src/cmd/unix/drawterm/kern/devip.c - 664 sys sys 1148233804 16112
 sys/src/cmd/unix/drawterm/kern/devip.h - 664 sys sys 1135900766 469
-sys/src/cmd/unix/drawterm/kern/devlfd.c - 664 sys sys 1135900766 1534
-sys/src/cmd/unix/drawterm/kern/devmnt.c - 664 sys sys 1135900767 21739
+sys/src/cmd/unix/drawterm/kern/devlfd.c - 664 sys sys 1148233805 1570
+sys/src/cmd/unix/drawterm/kern/devmnt.c - 664 sys sys 1148233805 21733
 sys/src/cmd/unix/drawterm/kern/devmouse.c - 664 sys sys 1135900767 3799
 sys/src/cmd/unix/drawterm/kern/devpipe.c - 664 sys sys 1135900767 5927
 sys/src/cmd/unix/drawterm/kern/devroot.c - 664 sys sys 1137502216 4755
-sys/src/cmd/unix/drawterm/kern/devssl.c - 664 sys sys 1135900767 26455
+sys/src/cmd/unix/drawterm/kern/devssl.c - 664 sys sys 1148233806 26453
 sys/src/cmd/unix/drawterm/kern/devtab.c - 664 sys sys 1144150884 544
-sys/src/cmd/unix/drawterm/kern/devtls.c - 664 sys sys 1147099089 45427
+sys/src/cmd/unix/drawterm/kern/devtls.c - 664 sys sys 1148233806 45303
 sys/src/cmd/unix/drawterm/kern/error.c - 664 sys sys 1135900767 2100
 sys/src/cmd/unix/drawterm/kern/error.h - 664 sys sys 1135900768 2583
 sys/src/cmd/unix/drawterm/kern/exportfs.c - 664 sys sys 1135900768 13444
-sys/src/cmd/unix/drawterm/kern/fns.h - 664 sys sys 1135900768 10731
+sys/src/cmd/unix/drawterm/kern/fns.h - 664 sys sys 1148254417 10766
 sys/src/cmd/unix/drawterm/kern/netif.h - 664 sys sys 1135900768 2950
 sys/src/cmd/unix/drawterm/kern/parse.c - 664 sys sys 1135900768 1993
 sys/src/cmd/unix/drawterm/kern/pgrp.c - 664 sys sys 1135900768 4017
-sys/src/cmd/unix/drawterm/kern/posix.c - 664 sys sys 1135900768 3149
+sys/src/cmd/unix/drawterm/kern/posix.c - 664 sys sys 1148254418 3251
 sys/src/cmd/unix/drawterm/kern/procinit.c - 664 sys sys 1135900769 1039
-sys/src/cmd/unix/drawterm/kern/qio.c - 664 sys sys 1135900769 23496
+sys/src/cmd/unix/drawterm/kern/qio.c - 664 sys sys 1148233807 23490
 sys/src/cmd/unix/drawterm/kern/qlock.c - 664 sys sys 1135900769 1119
 sys/src/cmd/unix/drawterm/kern/rendez.c - 664 sys sys 1135900769 1293
 sys/src/cmd/unix/drawterm/kern/rwlock.c - 664 sys sys 1135900769 634
 sys/src/cmd/unix/drawterm/kern/screen.h - 664 sys sys 1135900769 1151
 sys/src/cmd/unix/drawterm/kern/sleep.c - 664 sys sys 1135900769 1293
 sys/src/cmd/unix/drawterm/kern/smalloc.c - 664 sys sys 1135900769 187
-sys/src/cmd/unix/drawterm/kern/stub.c - 664 sys sys 1135900770 1273
+sys/src/cmd/unix/drawterm/kern/stub.c - 664 sys sys 1148233808 1275
 sys/src/cmd/unix/drawterm/kern/syscall.c - 664 sys sys 1135900770 12876
-sys/src/cmd/unix/drawterm/kern/sysfile.c - 664 sys sys 1137502217 18037
+sys/src/cmd/unix/drawterm/kern/sysfile.c - 664 sys sys 1148233809 18059
 sys/src/cmd/unix/drawterm/kern/sysproc.c - 664 sys sys 1135900770 498
 sys/src/cmd/unix/drawterm/kern/term.c - 664 sys sys 1135900770 3962
 sys/src/cmd/unix/drawterm/kern/todo.c - 664 sys sys 1135900770 0
 sys/src/cmd/unix/drawterm/kern/uart.c - 664 sys sys 1135900771 178
 sys/src/cmd/unix/drawterm/kern/waserror.c - 664 sys sys 1135900771 382
-sys/src/cmd/unix/drawterm/kern/win32.c - 664 sys sys 1135900771 7800
+sys/src/cmd/unix/drawterm/kern/win32.c - 664 sys sys 1148254419 8237
 sys/src/cmd/unix/drawterm/latin1.c - 664 sys sys 1135900535 7806
 sys/src/cmd/unix/drawterm/libauth - 20000000775 sys sys 1135900560 0
 sys/src/cmd/unix/drawterm/libauth/Makefile - 664 sys sys 1135900556 306
 sys/src/cmd/unix/drawterm/libauth/attr.c - 664 sys sys 1135900556 2857
 sys/src/cmd/unix/drawterm/libauth/auth_attr.c - 664 sys sys 1135900556 217
 sys/src/cmd/unix/drawterm/libauth/auth_challenge.c - 664 sys sys 1135900556 1976
-sys/src/cmd/unix/drawterm/libauth/auth_getuserpasswd.c - 664 sys sys 1135900556 1363
-sys/src/cmd/unix/drawterm/libauth/auth_proxy.c - 664 sys sys 1135900557 3606
-sys/src/cmd/unix/drawterm/libauth/auth_respond.c - 664 sys sys 1135900560 1420
+sys/src/cmd/unix/drawterm/libauth/auth_getuserpasswd.c - 664 sys sys 1148233812 1361
+sys/src/cmd/unix/drawterm/libauth/auth_proxy.c - 664 sys sys 1148233812 3614
+sys/src/cmd/unix/drawterm/libauth/auth_respond.c - 664 sys sys 1148233812 1418
 sys/src/cmd/unix/drawterm/libauth/auth_rpc.c - 664 sys sys 1135900560 2064
 sys/src/cmd/unix/drawterm/libauth/auth_userpasswd.c - 664 sys sys 1135900560 1097
 sys/src/cmd/unix/drawterm/libauth/authlocal.h - 664 sys sys 1135900560 87
@@ -13625,19 +13627,19 @@ sys/src/cmd/unix/drawterm/libc/dirfwstat.c - 664 sys sys 1135900563 242
 sys/src/cmd/unix/drawterm/libc/dirmodefmt.c - 664 sys sys 1135900563 581
 sys/src/cmd/unix/drawterm/libc/dirstat.c - 664 sys sys 1135900563 688
 sys/src/cmd/unix/drawterm/libc/dirwstat.c - 664 sys sys 1135900564 246
-sys/src/cmd/unix/drawterm/libc/dofmt.c - 664 sys sys 1137619295 9020
+sys/src/cmd/unix/drawterm/libc/dofmt.c - 664 sys sys 1148233816 9121
 sys/src/cmd/unix/drawterm/libc/dorfmt.c - 664 sys sys 1137619295 791
 sys/src/cmd/unix/drawterm/libc/encodefmt.c - 664 sys sys 1144150884 1100
 sys/src/cmd/unix/drawterm/libc/errfmt.c - 664 sys sys 1135900564 175
 sys/src/cmd/unix/drawterm/libc/fcallfmt.c - 664 sys sys 1135900564 5740
 sys/src/cmd/unix/drawterm/libc/fltfmt.c - 664 sys sys 1137619295 6302
-sys/src/cmd/unix/drawterm/libc/fmt.c - 664 sys sys 1137619296 3444
+sys/src/cmd/unix/drawterm/libc/fmt.c - 664 sys sys 1148233816 3440
 sys/src/cmd/unix/drawterm/libc/fmtdef.h - 664 sys sys 1137619328 2714
 sys/src/cmd/unix/drawterm/libc/fmtfd.c - 664 sys sys 1137619296 543
 sys/src/cmd/unix/drawterm/libc/fmtfdflush.c - 664 sys sys 1137619296 330
 sys/src/cmd/unix/drawterm/libc/fmtlock.c - 664 sys sys 1137506309 136
 sys/src/cmd/unix/drawterm/libc/fmtprint.c - 664 sys sys 1137619296 510
-sys/src/cmd/unix/drawterm/libc/fmtquote.c - 664 sys sys 1137619296 4763
+sys/src/cmd/unix/drawterm/libc/fmtquote.c - 664 sys sys 1148233817 4761
 sys/src/cmd/unix/drawterm/libc/fmtrune.c - 664 sys sys 1137619296 328
 sys/src/cmd/unix/drawterm/libc/fmtstr.c - 664 sys sys 1137619297 167
 sys/src/cmd/unix/drawterm/libc/fmtvprint.c - 664 sys sys 1137619297 519
@@ -13646,7 +13648,7 @@ sys/src/cmd/unix/drawterm/libc/frand.c - 664 sys sys 1135900566 210
 sys/src/cmd/unix/drawterm/libc/getfields.c - 664 sys sys 1135900566 516
 sys/src/cmd/unix/drawterm/libc/getpid.c - 664 sys sys 1135900566 198
 sys/src/cmd/unix/drawterm/libc/lnrand.c - 664 sys sys 1135900566 194
-sys/src/cmd/unix/drawterm/libc/lock.c - 664 sys sys 1135900566 774
+sys/src/cmd/unix/drawterm/libc/lock.c - 664 sys sys 1148233818 773
 sys/src/cmd/unix/drawterm/libc/lrand.c - 664 sys sys 1135900566 1109
 sys/src/cmd/unix/drawterm/libc/mallocz.c - 664 sys sys 1135900566 141
 sys/src/cmd/unix/drawterm/libc/nan.h - 664 sys sys 1135900566 114
@@ -13680,17 +13682,17 @@ sys/src/cmd/unix/drawterm/libc/runestrncpy.c - 664 sys sys 1135900569 234
 sys/src/cmd/unix/drawterm/libc/runestrrchr.c - 664 sys sys 1135900569 182
 sys/src/cmd/unix/drawterm/libc/runestrstr.c - 664 sys sys 1135900570 397
 sys/src/cmd/unix/drawterm/libc/runetype.c - 664 sys sys 1135900570 29655
-sys/src/cmd/unix/drawterm/libc/runevseprint.c - 664 sys sys 1137619306 364
+sys/src/cmd/unix/drawterm/libc/runevseprint.c - 664 sys sys 1148233820 362
 sys/src/cmd/unix/drawterm/libc/runevsmprint.c - 664 sys sys 1137619306 1103
-sys/src/cmd/unix/drawterm/libc/runevsnprint.c - 664 sys sys 1137619307 374
+sys/src/cmd/unix/drawterm/libc/runevsnprint.c - 664 sys sys 1148233821 372
 sys/src/cmd/unix/drawterm/libc/seprint.c - 664 sys sys 1137619307 216
 sys/src/cmd/unix/drawterm/libc/smprint.c - 664 sys sys 1137619307 188
 sys/src/cmd/unix/drawterm/libc/snprint.c - 664 sys sys 1137619307 215
 sys/src/cmd/unix/drawterm/libc/sprint.c - 664 sys sys 1137619307 444
 sys/src/cmd/unix/drawterm/libc/strecpy.c - 664 sys sys 1135900571 223
-sys/src/cmd/unix/drawterm/libc/strtod.c - 664 sys sys 1144256614 8407
+sys/src/cmd/unix/drawterm/libc/strtod.c - 664 sys sys 1148233822 8409
 sys/src/cmd/unix/drawterm/libc/strtod.h - 664 sys sys 1135900571 120
-sys/src/cmd/unix/drawterm/libc/strtoll.c - 664 sys sys 1135900571 1302
+sys/src/cmd/unix/drawterm/libc/strtoll.c - 664 sys sys 1148233823 1320
 sys/src/cmd/unix/drawterm/libc/sysfatal.c - 664 sys sys 1135900571 479
 sys/src/cmd/unix/drawterm/libc/time.c - 664 sys sys 1135900571 878
 sys/src/cmd/unix/drawterm/libc/tokenize.c - 664 sys sys 1135900571 1691
@@ -13724,15 +13726,15 @@ sys/src/cmd/unix/drawterm/libdraw/rectclip.c - 664 sys sys 1135900575 571
 sys/src/cmd/unix/drawterm/libdraw/rgb.c - 664 sys sys 1135900575 1679
 sys/src/cmd/unix/drawterm/libmemdraw - 20000000775 sys sys 954098724 0
 sys/src/cmd/unix/drawterm/libmemdraw/Makefile - 664 sys sys 1135900575 391
-sys/src/cmd/unix/drawterm/libmemdraw/alloc.c - 664 sys sys 1135900575 3309
+sys/src/cmd/unix/drawterm/libmemdraw/alloc.c - 664 sys sys 1148233825 3410
 sys/src/cmd/unix/drawterm/libmemdraw/alpha.hoc - 664 sys sys 1135900575 220
 sys/src/cmd/unix/drawterm/libmemdraw/arc.c - 664 sys sys 1135900575 2608
 sys/src/cmd/unix/drawterm/libmemdraw/arctest.c - 664 sys sys 1135900575 865
 sys/src/cmd/unix/drawterm/libmemdraw/cload.c - 664 sys sys 1135900576 1338
 sys/src/cmd/unix/drawterm/libmemdraw/cmap.c - 664 sys sys 1135900576 25150
 sys/src/cmd/unix/drawterm/libmemdraw/cread.c - 664 sys sys 1135900576 1982
-sys/src/cmd/unix/drawterm/libmemdraw/defont.c - 664 sys sys 1135900576 1293
-sys/src/cmd/unix/drawterm/libmemdraw/draw.c - 664 sys sys 1137502231 54659
+sys/src/cmd/unix/drawterm/libmemdraw/defont.c - 664 sys sys 1148233826 1295
+sys/src/cmd/unix/drawterm/libmemdraw/draw.c - 664 sys sys 1148233827 54657
 sys/src/cmd/unix/drawterm/libmemdraw/drawtest.c - 664 sys sys 1135900576 23441
 sys/src/cmd/unix/drawterm/libmemdraw/ellipse.c - 664 sys sys 1135900576 4864
 sys/src/cmd/unix/drawterm/libmemdraw/fillpoly.c - 664 sys sys 1135900576 9973
@@ -13759,7 +13761,7 @@ sys/src/cmd/unix/drawterm/libmemlayer/lhide.c - 664 sys sys 1135900579 1675
 sys/src/cmd/unix/drawterm/libmemlayer/line.c - 664 sys sys 1135900579 2587
 sys/src/cmd/unix/drawterm/libmemlayer/load.c - 664 sys sys 1135900579 1032
 sys/src/cmd/unix/drawterm/libmemlayer/lorigin.c - 664 sys sys 1135900579 2507
-sys/src/cmd/unix/drawterm/libmemlayer/lsetrefresh.c - 664 sys sys 1135900579 703
+sys/src/cmd/unix/drawterm/libmemlayer/lsetrefresh.c - 664 sys sys 1148233829 695
 sys/src/cmd/unix/drawterm/libmemlayer/ltofront.c - 664 sys sys 1135900579 1289
 sys/src/cmd/unix/drawterm/libmemlayer/ltorear.c - 664 sys sys 1135900579 1062
 sys/src/cmd/unix/drawterm/libmemlayer/unload.c - 664 sys sys 1135900579 1007
@@ -13768,7 +13770,7 @@ sys/src/cmd/unix/drawterm/libmp/Makefile - 664 sys sys 1135900580 602
 sys/src/cmd/unix/drawterm/libmp/betomp.c - 664 sys sys 1135900580 577
 sys/src/cmd/unix/drawterm/libmp/crt.c - 664 sys sys 1135900580 2050
 sys/src/cmd/unix/drawterm/libmp/crttest.c - 664 sys sys 1135900580 813
-sys/src/cmd/unix/drawterm/libmp/dat.h - 664 sys sys 1135900580 464
+sys/src/cmd/unix/drawterm/libmp/dat.h - 664 sys sys 1148233830 465
 sys/src/cmd/unix/drawterm/libmp/letomp.c - 664 sys sys 1135900581 455
 sys/src/cmd/unix/drawterm/libmp/mpadd.c - 664 sys sys 1135900581 783
 sys/src/cmd/unix/drawterm/libmp/mpaux.c - 664 sys sys 1135900581 2564
@@ -13862,24 +13864,41 @@ sys/src/cmd/unix/drawterm/libsec/x509.c - 664 sys sys 1135900592 50237
 sys/src/cmd/unix/drawterm/main.c - 664 sys sys 1142177501 2443
 sys/src/cmd/unix/drawterm/posix-386 - 20000000775 sys sys 1135900540 0
 sys/src/cmd/unix/drawterm/posix-386/Makefile - 664 sys sys 1135900540 378
-sys/src/cmd/unix/drawterm/posix-386/getcallerpc.c - 664 sys sys 1135900540 90
+sys/src/cmd/unix/drawterm/posix-386/getcallerpc.c - 664 sys sys 1148233712 94
 sys/src/cmd/unix/drawterm/posix-386/md5block.spp - 664 sys sys 1135900540 6472
 sys/src/cmd/unix/drawterm/posix-386/sha1block.spp - 664 sys sys 1135900540 4749
 sys/src/cmd/unix/drawterm/posix-386/tas.c - 664 sys sys 1135900540 270
+sys/src/cmd/unix/drawterm/posix-amd64 - 20000000775 sys sys 1148233713 0
+sys/src/cmd/unix/drawterm/posix-amd64/Makefile - 664 sys sys 1148233713 227
+sys/src/cmd/unix/drawterm/posix-amd64/getcallerpc.c - 664 sys sys 1148233713 90
+sys/src/cmd/unix/drawterm/posix-amd64/md5block.c - 664 sys sys 1148233713 5032
+sys/src/cmd/unix/drawterm/posix-amd64/sha1block.c - 664 sys sys 1148233713 4710
+sys/src/cmd/unix/drawterm/posix-amd64/tas.c - 664 sys sys 1148233713 273
 sys/src/cmd/unix/drawterm/posix-factotum.c - 664 sys sys 1135900536 1880
 sys/src/cmd/unix/drawterm/posix-mips - 20000000775 sys sys 1135900037 0
+sys/src/cmd/unix/drawterm/posix-mips/Makefile - 664 sys sys 1148233713 302
+sys/src/cmd/unix/drawterm/posix-mips/getcallerpc.c - 664 sys sys 1148233714 90
+sys/src/cmd/unix/drawterm/posix-mips/md5block.c - 664 sys sys 1148233714 5032
+sys/src/cmd/unix/drawterm/posix-mips/sha1block.c - 664 sys sys 1148233714 4710
+sys/src/cmd/unix/drawterm/posix-mips/tas.s - 664 sys sys 1148233714 377
 sys/src/cmd/unix/drawterm/posix-power - 20000000775 sys sys 1135900541 0
 sys/src/cmd/unix/drawterm/posix-power/Makefile - 664 sys sys 1135900541 291
-sys/src/cmd/unix/drawterm/posix-power/getcallerpc.c - 664 sys sys 1135900541 90
+sys/src/cmd/unix/drawterm/posix-power/getcallerpc.c - 664 sys sys 1148233714 94
 sys/src/cmd/unix/drawterm/posix-power/md5block.c - 664 sys sys 1135900541 5032
 sys/src/cmd/unix/drawterm/posix-power/sha1block.c - 664 sys sys 1135900541 4710
 sys/src/cmd/unix/drawterm/posix-power/tas.c - 664 sys sys 1135900541 943
+sys/src/cmd/unix/drawterm/posix-sun4u - 20000000775 sys sys 1148233715 0
+sys/src/cmd/unix/drawterm/posix-sun4u/Makefile - 664 sys sys 1148233715 292
+sys/src/cmd/unix/drawterm/posix-sun4u/getcallerpc.c - 664 sys sys 1148233715 91
+sys/src/cmd/unix/drawterm/posix-sun4u/md5block.c - 664 sys sys 1148233715 5032
+sys/src/cmd/unix/drawterm/posix-sun4u/sha1block.c - 664 sys sys 1148233715 4710
+sys/src/cmd/unix/drawterm/posix-sun4u/tas.s - 664 sys sys 1148233715 42
 sys/src/cmd/unix/drawterm/readcons.c - 664 sys sys 1135900536 1842
 sys/src/cmd/unix/drawterm/resource.h - 664 sys sys 1135900536 457
 sys/src/cmd/unix/drawterm/secstore.c - 664 sys sys 1135900536 15742
 sys/src/cmd/unix/drawterm/win32-386 - 20000000775 sys sys 1135900544 0
 sys/src/cmd/unix/drawterm/win32-386/Makefile - 664 sys sys 1135900544 291
-sys/src/cmd/unix/drawterm/win32-386/getcallerpc.c - 664 sys sys 1135900544 90
+sys/src/cmd/unix/drawterm/win32-386/getcallerpc.c - 664 sys sys 1148233841 94
 sys/src/cmd/unix/drawterm/win32-386/md5block.spp - 664 sys sys 1135900544 6591
 sys/src/cmd/unix/drawterm/win32-386/sha1block.spp - 664 sys sys 1135900544 4912
 sys/src/cmd/unix/drawterm/win32-386/tas.c - 664 sys sys 1135900544 270

+ 72 - 0
dist/replica/plan9.log

@@ -29696,3 +29696,75 @@
 1148180431 2 c 386/bin/nm - 775 sys sys 1148180227 127108
 1148180431 3 c 386/bin/htmlroff - 775 sys sys 1148180227 148483
 1148180431 4 c 386/lib/libmach.a - 664 sys sys 1148180229 785314
+1148227246 0 c sys/man/1/graph - 664 sys sys 1148227125 3061
+1148227246 1 c sys/src/cmd/graph/graph.c - 664 sys sys 1148227144 13164
+1148229047 0 c sys/man/2/getcallerpc - 664 sys sys 1148227548 666
+1148230848 0 c 386/bin/graph - 775 sys sys 1148230842 129345
+1148234449 0 a sys/src/cmd/unix/drawterm/Make.sun - 664 sys sys 1148233748 377
+1148234449 1 c sys/src/cmd/unix/drawterm/README - 664 sys sys 1148233748 1056
+1148234449 2 c sys/src/cmd/unix/drawterm/cpu.c - 664 sys sys 1148233749 13982
+1148234449 3 c sys/src/cmd/unix/drawterm/exportfs/exportsrv.c - 664 sys sys 1148233789 11046
+1148234449 4 c sys/src/cmd/unix/drawterm/gui-x11/screen.c - 664 sys sys 1148233793 25060
+1148234449 5 c sys/src/cmd/unix/drawterm/gui-x11/xmem.h - 664 sys sys 1148233793 1510
+1148234449 6 c sys/src/cmd/unix/drawterm/include/auth.h - 664 sys sys 1148233794 3538
+1148234449 7 c sys/src/cmd/unix/drawterm/include/dtos.h - 664 sys sys 1148233795 392
+1148234449 8 c sys/src/cmd/unix/drawterm/include/lib.h - 664 sys sys 1148233795 7540
+1148234449 9 c sys/src/cmd/unix/drawterm/include/user.h - 664 sys sys 1148233796 2534
+1148234449 10 a sys/src/cmd/unix/drawterm/include/x - 664 sys sys 1148233796 0
+1148234449 11 c sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1148233801 610
+1148234449 12 c sys/src/cmd/unix/drawterm/kern/allocb.c - 664 sys sys 1148233801 3176
+1148234449 13 c sys/src/cmd/unix/drawterm/kern/chan.c - 664 sys sys 1148233801 29589
+1148234449 14 c sys/src/cmd/unix/drawterm/kern/dat.h - 664 sys sys 1148233802 10717
+1148234449 15 c sys/src/cmd/unix/drawterm/kern/devaudio-unix.c - 664 sys sys 1148233803 3076
+1148234449 16 c sys/src/cmd/unix/drawterm/kern/devaudio.c - 664 sys sys 1148233803 6070
+1148234449 17 c sys/src/cmd/unix/drawterm/kern/devcons.c - 664 sys sys 1148233803 19512
+1148234449 18 c sys/src/cmd/unix/drawterm/kern/devdraw.c - 664 sys sys 1148233804 43429
+1148234449 19 c sys/src/cmd/unix/drawterm/kern/devip.c - 664 sys sys 1148233804 16112
+1148234449 20 c sys/src/cmd/unix/drawterm/kern/devlfd.c - 664 sys sys 1148233805 1570
+1148234449 21 c sys/src/cmd/unix/drawterm/kern/devmnt.c - 664 sys sys 1148233805 21733
+1148234449 22 c sys/src/cmd/unix/drawterm/kern/devssl.c - 664 sys sys 1148233806 26453
+1148234449 23 c sys/src/cmd/unix/drawterm/kern/devtls.c - 664 sys sys 1148233806 45303
+1148234449 24 c sys/src/cmd/unix/drawterm/kern/posix.c - 664 sys sys 1148233807 3173
+1148234449 25 c sys/src/cmd/unix/drawterm/kern/qio.c - 664 sys sys 1148233807 23490
+1148234449 26 c sys/src/cmd/unix/drawterm/kern/stub.c - 664 sys sys 1148233808 1275
+1148234449 27 c sys/src/cmd/unix/drawterm/kern/sysfile.c - 664 sys sys 1148233809 18059
+1148234449 28 c sys/src/cmd/unix/drawterm/libauth/auth_getuserpasswd.c - 664 sys sys 1148233812 1361
+1148234449 29 c sys/src/cmd/unix/drawterm/libauth/auth_proxy.c - 664 sys sys 1148233812 3614
+1148234449 30 c sys/src/cmd/unix/drawterm/libauth/auth_respond.c - 664 sys sys 1148233812 1418
+1148234449 31 c sys/src/cmd/unix/drawterm/libc/dofmt.c - 664 sys sys 1148233816 9121
+1148234449 32 c sys/src/cmd/unix/drawterm/libc/fmt.c - 664 sys sys 1148233816 3440
+1148234449 33 c sys/src/cmd/unix/drawterm/libc/fmtquote.c - 664 sys sys 1148233817 4761
+1148234449 34 c sys/src/cmd/unix/drawterm/libc/lock.c - 664 sys sys 1148233818 773
+1148234449 35 c sys/src/cmd/unix/drawterm/libc/runevseprint.c - 664 sys sys 1148233820 362
+1148234449 36 c sys/src/cmd/unix/drawterm/libc/runevsnprint.c - 664 sys sys 1148233821 372
+1148234449 37 c sys/src/cmd/unix/drawterm/libc/strtod.c - 664 sys sys 1148233822 8409
+1148234449 38 c sys/src/cmd/unix/drawterm/libc/strtoll.c - 664 sys sys 1148233823 1320
+1148234449 39 c sys/src/cmd/unix/drawterm/libmemdraw/alloc.c - 664 sys sys 1148233825 3410
+1148234449 40 c sys/src/cmd/unix/drawterm/libmemdraw/defont.c - 664 sys sys 1148233826 1295
+1148234449 41 c sys/src/cmd/unix/drawterm/libmemdraw/draw.c - 664 sys sys 1148233827 54657
+1148234449 42 c sys/src/cmd/unix/drawterm/libmemlayer/lsetrefresh.c - 664 sys sys 1148233829 695
+1148234449 43 c sys/src/cmd/unix/drawterm/libmp/dat.h - 664 sys sys 1148233830 465
+1148234449 44 c sys/src/cmd/unix/drawterm/posix-386/getcallerpc.c - 664 sys sys 1148233712 94
+1148234449 45 a sys/src/cmd/unix/drawterm/posix-amd64 - 20000000775 sys sys 1148233713 0
+1148234449 46 a sys/src/cmd/unix/drawterm/posix-amd64/Makefile - 664 sys sys 1148233713 227
+1148234449 47 a sys/src/cmd/unix/drawterm/posix-amd64/getcallerpc.c - 664 sys sys 1148233713 90
+1148234449 48 a sys/src/cmd/unix/drawterm/posix-amd64/md5block.c - 664 sys sys 1148233713 5032
+1148234449 49 a sys/src/cmd/unix/drawterm/posix-amd64/sha1block.c - 664 sys sys 1148233713 4710
+1148234449 50 a sys/src/cmd/unix/drawterm/posix-amd64/tas.c - 664 sys sys 1148233713 273
+1148234449 51 a sys/src/cmd/unix/drawterm/posix-mips/Makefile - 664 sys sys 1148233713 302
+1148234449 52 a sys/src/cmd/unix/drawterm/posix-mips/getcallerpc.c - 664 sys sys 1148233714 90
+1148234449 53 a sys/src/cmd/unix/drawterm/posix-mips/md5block.c - 664 sys sys 1148233714 5032
+1148234449 54 a sys/src/cmd/unix/drawterm/posix-mips/sha1block.c - 664 sys sys 1148233714 4710
+1148234449 55 a sys/src/cmd/unix/drawterm/posix-mips/tas.s - 664 sys sys 1148233714 377
+1148234449 56 c sys/src/cmd/unix/drawterm/posix-power/getcallerpc.c - 664 sys sys 1148233714 94
+1148234449 57 a sys/src/cmd/unix/drawterm/posix-sun4u - 20000000775 sys sys 1148233715 0
+1148234449 58 a sys/src/cmd/unix/drawterm/posix-sun4u/Makefile - 664 sys sys 1148233715 292
+1148234449 59 a sys/src/cmd/unix/drawterm/posix-sun4u/getcallerpc.c - 664 sys sys 1148233715 91
+1148234449 60 a sys/src/cmd/unix/drawterm/posix-sun4u/md5block.c - 664 sys sys 1148233715 5032
+1148234449 61 a sys/src/cmd/unix/drawterm/posix-sun4u/sha1block.c - 664 sys sys 1148233715 4710
+1148234449 62 a sys/src/cmd/unix/drawterm/posix-sun4u/tas.s - 664 sys sys 1148233715 42
+1148234449 63 c sys/src/cmd/unix/drawterm/win32-386/getcallerpc.c - 664 sys sys 1148233841 94
+1148256058 0 c sys/src/cmd/unix/drawterm/kern/devcons.c - 664 sys sys 1148254417 19607
+1148256058 1 c sys/src/cmd/unix/drawterm/kern/fns.h - 664 sys sys 1148254417 10766
+1148256058 2 c sys/src/cmd/unix/drawterm/kern/posix.c - 664 sys sys 1148254418 3251
+1148256058 3 c sys/src/cmd/unix/drawterm/kern/win32.c - 664 sys sys 1148254419 8237

+ 7 - 0
sys/man/1/graph

@@ -85,6 +85,13 @@ with each abscissa value.
 The next argument is
 .IR n .
 .TP
+.B -p
+Next argument is one or more of the characters
+.B bcgkmrwy,
+choosing pen colors by their initial letter, as in
+.IR plot (6).
+Successive curves will cycle through the colors in the given order.
+.TP
 .B  -s
 Save screen; no new page for this graph.
 .TP

+ 3 - 3
sys/man/2/getcallerpc

@@ -7,7 +7,7 @@ getcallerpc \- fetch return PC of current function
 .br
 .B #include <libc.h>
 .PP
-.B ulong getcallerpc(void *firstarg)
+.B uintptr getcallerpc(void *firstarg)
 .SH DESCRIPTION
 .I Getcallerpc
 is a portable way to discover the PC to which the current function will return.
@@ -17,9 +17,9 @@ should be a pointer to the first argument to the function in question.
 .IP
 .EX
 void
-printpc(ulong arg)
+printpc(int arg)
 {
-	print("Called from %.8lux\en", getcallerpc(&arg));
+	print("Called from %p\en", getcallerpc(&arg));
 }
 
 void

+ 49 - 2
sys/src/cmd/graph/graph.c

@@ -63,6 +63,22 @@ double ident(double x){
 struct z {
 	float lb,ub,mult,quant;
 };
+
+struct {
+	char *name;
+	int next;
+} palette[] = {
+	['b']	{ "blue", 'b' },
+	['c']	{ "cyan", 'c' },
+	['g']	{ "green", 'g' },
+	['k']	{ "kblack", 'k' },
+	['m']	{ "magenta", 'm' },
+	['r']	{ "red", 'r' },
+	['w']	{ "white", 'w' },
+	['y']	{ "yellow", 'y' }
+};
+int pencolor = 'k';
+
 void init(struct xy *);
 void setopt(int, char *[]);
 void readin(void);
@@ -71,7 +87,8 @@ void getlim(struct xy *, struct val *);
 void equilibrate(struct xy *, struct xy *);
 void scale(struct xy *);
 void limread(struct xy *, int *, char ***);
-numb(float *, int *, char ***);
+int numb(float *, int *, char ***);
+void colread(int *, char ***);
 int copystring(int);
 struct z setloglim(int, int, float, float);
 struct z setlinlim(int, int, float, float);
@@ -220,6 +237,9 @@ again:		switch(argv[0][0]) {
 			if(!numb(&yd.xoff,&argc,&argv))
 				badarg();
 			break;
+		case 'p': /*pen color*/
+			colread(&argc, &argv);
+			break;
 		default:
 			badarg();
 		}
@@ -261,6 +281,26 @@ numb(float *np, int *argcp, char ***argvp){
 	return(1);
 }
 
+void colread(int *argcp, char ***argvp){
+	int c, cnext;
+	int i, n;
+
+	if(*argcp<=1)
+		return;
+	n = strlen((*argvp)[1]);
+	if(strspn((*argvp)[1], "bcgkmrwy")!=n)
+		return;
+	pencolor = cnext = (*argvp)[1][0];
+	for(i=0; i<n-1; i++){
+		c = (unsigned char)(*argvp)[1][i];
+		cnext = (unsigned char)(*argvp)[1][i+1];
+		palette[c].next = cnext;
+	}
+	palette[cnext].next = pencolor;
+	(*argcp)--;
+	(*argvp)++;
+}
+
 void readin(void){
 	int i, t;
 	struct val *temp;
@@ -546,6 +586,7 @@ void axes(void){
 	}
 }
 
+int
 setmark(int *xmark, struct xy *p){
 	int xn = 0;
 	float x,xl,xu;
@@ -593,6 +634,7 @@ void plot(void){
 		default:
 			pen(modes[mode]);
 		}
+		color(palette[pencolor].name);
 		conn = 0;
 		for(i=j; i<n; i+=ovlay) {
 			if(!conv(xx[i].xv,&xd,&ix) ||
@@ -609,10 +651,12 @@ void plot(void){
 			}
 			conn &= symbol(ix,iy,xx[i].lblptr);
 		}
+		pencolor = palette[pencolor].next;
 	}
 	pen(modes[1]);
 }
 
+int
 conv(float xv, struct xy *p, int *ip){
 	long ix;
 	ix = p->xa*(*p->xf)(xv*p->xmult) + p->xb;
@@ -622,12 +666,15 @@ conv(float xv, struct xy *p, int *ip){
 	return(1);
 }
 
+int
 getfloat(float *p){
 	int i;
 
 	i = scanf("%f",p);
 	return(i==1);
 }
+
+int
 getstring(void){
 	int i;
 	char junk[20];
@@ -656,7 +703,7 @@ getstring(void){
 	return(strlen(labbuf));
 }
 
-
+int
 symbol(int ix, int iy, int k){
 
 	if(symbf==0&&k<0) {

+ 21 - 0
sys/src/cmd/unix/drawterm/Make.sun

@@ -0,0 +1,21 @@
+# Sun-specific
+PTHREAD=
+AR=ar
+AS=as
+RANLIB=ranlib
+X11=/usr/X11R6
+CC=cc
+CFLAGS=-xCC -I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -g -D_THREAD_SAFE
+O=o
+OS=posix
+GUI=x11
+LDADD=-L$(X11)/lib -lX11 -lrt -lpthread -lsocket -lnsl
+LDFLAGS=
+TARG=drawterm
+AUDIO=none
+
+all: default
+
+libmachdep.a:
+	arch=`uname -m|sed 's/i.86/386/;s/Power Macintosh/power/'`; \
+	(cd posix-$$arch &&  make)

+ 2 - 0
sys/src/cmd/unix/drawterm/README

@@ -2,6 +2,8 @@ INSTALLATION
 --------------
 To build on Unix, run CONF=unix make.
 
+To build on Solaris using Sun cc, run CONF=sun make.
+
 To build on Windows, you need Mingw.  See http://www.mingw.org.
 Edit Make.config to uncomment the Windows section
 and comment out the rest.  Then run CONF=windows make.

+ 1 - 1
sys/src/cmd/unix/drawterm/cpu.c

@@ -54,7 +54,7 @@ struct AuthMethod {
 	{ "p9",		p9auth,		srvp9auth,},
 	{ "netkey",	netkeyauth,	netkeysrvauth,},
 //	{ "none",	noauth,		srvnoauth,},
-	{ nil,	nil}
+	{ 0 }
 };
 AuthMethod *am = authmethod;	/* default is p9 */
 

+ 5 - 5
sys/src/cmd/unix/drawterm/exportfs/exportsrv.c

@@ -434,7 +434,7 @@ slave(Fsrpc *f)
 			if(p->busy == 0) {
 				f->pid = p->pid;
 				p->busy = 1;
-				pid = rendezvous(p->pid, (ulong)f);
+				pid = (uintptr)rendezvous((void*)(uintptr)p->pid, f);
 				if(pid != p->pid)
 					fatal("rendezvous sync fail");
 				return;
@@ -459,7 +459,7 @@ slave(Fsrpc *f)
 		Proclist = p;
 
 DEBUG(DFD, "parent %d rendez\n", pid);
-		rendezvous(pid, (ulong)p);
+		rendezvous((void*)(uintptr)pid, p);
 DEBUG(DFD, "parent %d went\n", pid);
 	}
 }
@@ -479,12 +479,12 @@ blockingslave(void *x)
 	pid = getpid();
 
 DEBUG(DFD, "blockingslave %d rendez\n", pid);
-	m = (Proc*)rendezvous(pid, 0);
+	m = (Proc*)rendezvous((void*)(uintptr)pid, 0);
 DEBUG(DFD, "blockingslave %d rendez got %p\n", pid, m);
 	
 	for(;;) {
-		p = (Fsrpc*)rendezvous(pid, pid);
-		if((int)p == ~0)			/* Interrupted */
+		p = rendezvous((void*)(uintptr)pid, (void*)(uintptr)pid);
+		if((uintptr)p == ~(uintptr)0)			/* Interrupted */
 			continue;
 
 		DEBUG(DFD, "\tslave: %d %F b %d p %d\n", pid, &p->work, p->busy, p->pid);

+ 2 - 0
sys/src/cmd/unix/drawterm/gui-x11/screen.c

@@ -566,6 +566,8 @@ initmap(Window w)
 		 * some displays say MSB even though they run on LSB.
 		 * Besides, this is more anal.
 		 */
+		if(xscreendepth != DefaultDepth(xdisplay, DefaultScreen(xdisplay)))
+			xcmap = XCreateColormap(xdisplay, w, xvis, AllocNone);
 
 		c = map[19];
 		/* find out index into colormap for our RGB */

+ 1 - 1
sys/src/cmd/unix/drawterm/gui-x11/xmem.h

@@ -31,7 +31,7 @@ struct Xmem
 	int	dirty;
 	Rectangle dirtyr;
 	Rectangle r;
-	ulong pc;	/* who wrote into xi */
+	uintptr pc;	/* who wrote into xi */
 };
 
 extern	int		xtblbit;

+ 2 - 2
sys/src/cmd/unix/drawterm/include/auth.h

@@ -17,7 +17,7 @@ typedef struct	AuthRpc		AuthRpc;
 enum
 {
 	MAXCHLEN=	256,		/* max challenge length	*/
-	MAXNAMELEN=	256,		/* maximum name length */
+	AMAXNAMELEN=	256,		/* maximum name length */
 	MD5LEN=		16,
 
 	ARok = 0,			/* rpc return values */
@@ -63,7 +63,7 @@ struct Chalstate
 /* for implementation only */
 	int	afd;			/* to factotum */
 	AuthRpc	*rpc;			/* to factotum */
-	char	userbuf[MAXNAMELEN];	/* temp space if needed */
+	char	userbuf[AMAXNAMELEN];	/* temp space if needed */
 	int	userinchal;		/* user was sent to obtain challenge */
 };
 

+ 1 - 1
sys/src/cmd/unix/drawterm/include/dtos.h

@@ -1,4 +1,4 @@
-#if defined(linux) || defined(IRIX) || defined(SOLARIS) || defined(OSF1) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+#if defined(linux) || defined(IRIX) || defined(SOLARIS) || defined(OSF1) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) || defined(__sun) || defined(sun)
 #	include "unix.h"
 #	ifdef __APPLE__
 #		define panic dt_panic

+ 2 - 1
sys/src/cmd/unix/drawterm/include/lib.h

@@ -236,7 +236,7 @@ extern	int	fmtprint(Fmt*, char*, ...);
 extern	int	fmtvprint(Fmt*, char*, va_list);
 extern	void*	mallocz(ulong, int);
 
-extern	ulong	getcallerpc(void*);
+extern	uintptr	getcallerpc(void*);
 extern	char*	cleanname(char*);
 extern	void	sysfatal(char*, ...);
 extern	char*	strecpy(char*, char*, char*);
@@ -250,6 +250,7 @@ extern	int	dec64(uchar*, int, char*, int);
 extern	int	enc64(char*, int, uchar*, int);
 extern	int	dec32(uchar*, int, char*, int);
 extern	int	enc32(char*, int, uchar*, int);
+extern	int	enc16(char*, int, uchar*, int);
 void		hnputs(void *p, unsigned short v);
 extern	int	dofmt(Fmt*, char*);
 extern	double	__NaN(void);

+ 2 - 2
sys/src/cmd/unix/drawterm/include/user.h

@@ -74,13 +74,13 @@ extern	int	pushssl(int, char*, char*, char*, int*);
 extern	int	iounit(int);
 extern	long	pread(int, void*, long, vlong);
 extern	long	pwrite(int, void*, long, vlong);
-extern	ulong	rendezvous(ulong, ulong);
+extern	void*	rendezvous(void*, void*);
 extern	int	kproc(char*, void(*)(void*), void*);
 extern	int	getpid(void);
 extern	void	panic(char*, ...);
 extern	void	sleep(int);
 extern	void	osyield(void);
-extern	void	setmalloctag(void*, ulong);
+extern	void	setmalloctag(void*, uintptr);
 extern	int	errstr(char*, uint);
 extern	int	rerrstr(char*, uint);
 extern	int	encrypt(void*, void*, int);

+ 0 - 0
sys/src/cmd/unix/drawterm/include/x


+ 0 - 1
sys/src/cmd/unix/drawterm/kern/Makefile

@@ -36,7 +36,6 @@ OFILES=\
 	qio.$O\
 	qlock.$O\
 	term.$O\
-	todo.$O\
 	uart.$O\
 	waserror.$O\
 	$(OS).$O

+ 4 - 4
sys/src/cmd/unix/drawterm/kern/allocb.c

@@ -20,7 +20,7 @@ static Block*
 _allocb(int size)
 {
 	Block *b;
-	ulong addr;
+	uintptr addr;
 
 	if((b = mallocz(sizeof(Block)+size+Hdrspc, 0)) == nil)
 		return nil;
@@ -31,13 +31,13 @@ _allocb(int size)
 	b->flag = 0;
 
 	/* align start of data portion by rounding up */
-	addr = (ulong)b;
+	addr = (uintptr)b;
 	addr = ROUND(addr + sizeof(Block), BLOCKALIGN);
 	b->base = (uchar*)addr;
 
 	/* align end of data portion by rounding down */
 	b->lim = ((uchar*)b) + sizeof(Block)+size+Hdrspc;
-	addr = (ulong)(b->lim);
+	addr = (uintptr)(b->lim);
 	addr = addr & ~(BLOCKALIGN-1);
 	b->lim = (uchar*)addr;
 
@@ -60,7 +60,7 @@ allocb(int size)
 	 * Can still error out of here, though.
 	 */
 	if(up == nil)
-		panic("allocb without up: %luX\n", getcallerpc(&size));
+		panic("allocb without up: %p\n", getcallerpc(&size));
 	if((b = _allocb(size)) == nil){
 		panic("allocb: no memory for %d bytes\n", size);
 	}

+ 2 - 2
sys/src/cmd/unix/drawterm/kern/chan.c

@@ -112,7 +112,7 @@ decref(Ref *r)
 	x = --r->ref;
 	unlock(&r->lk);
 	if(x < 0)
-		panic("decref, pc=0x%lux", getcallerpc(&r));
+		panic("decref, pc=0x%p", getcallerpc(&r));
 
 	return x;
 }
@@ -354,7 +354,7 @@ void
 cclose(Chan *c)
 {
 	if(c->flag&CFREE)
-		panic("cclose %lux", getcallerpc(&c));
+		panic("cclose %p", getcallerpc(&c));
 
 	if(decref(&c->ref))
 		return;

+ 3 - 3
sys/src/cmd/unix/drawterm/kern/dat.h

@@ -236,7 +236,7 @@ struct Dirtab
 	char	name[KNAMELEN];
 	Qid	qid;
 	vlong length;
-	long	perm;
+	ulong	perm;
 };
 
 struct Walkqid
@@ -401,8 +401,8 @@ struct Proc
 	int	notepending;	/* note issued but not acted on */
 	int	kp;		/* true if a kernel process */
 
-	ulong	rendtag;	/* Tag for rendezvous */
-	ulong	rendval;	/* Value for rendezvous */
+	void*	rendtag;	/* Tag for rendezvous */
+	void*	rendval;	/* Value for rendezvous */
 	Proc	*rendhash;	/* Hash list for tag values */
 
 	int	nerrlab;

+ 1 - 0
sys/src/cmd/unix/drawterm/kern/devaudio-unix.c

@@ -179,4 +179,5 @@ int
 audiodevread(void *v, int n)
 {
 	error("no reading");
+	return -1;
 }

+ 12 - 12
sys/src/cmd/unix/drawterm/kern/devaudio.c

@@ -45,18 +45,18 @@ static	struct
 	int	irval;
 } volumes[] =
 {
-[Vaudio]		"audio",	Fout, 		50,	50,
-[Vsynth]		"synth",	Fin|Fout,	0,	0,
-[Vcd]		"cd",		Fin|Fout,	0,	0,
-[Vline]		"line",	Fin|Fout,	0,	0,
-[Vmic]		"mic",	Fin|Fout|Fmono,	0,	0,
-[Vspeaker]	"speaker",	Fout|Fmono,	0,	0,
-
-[Vtreb]		"treb",		Fout, 		50,	50,
-[Vbass]		"bass",		Fout, 		50,	50,
-
-[Vspeed]	"speed",	Fin|Fout|Fmono,	Speed,	Speed,
-		0
+	"audio",	Fout, 		50,	50,
+	"synth",	Fin|Fout,	0,	0,
+	"cd",		Fin|Fout,	0,	0,
+	"line",	Fin|Fout,	0,	0,
+	"mic",	Fin|Fout|Fmono,	0,	0,
+	"speaker",	Fout|Fmono,	0,	0,
+
+	"treb",		Fout, 		50,	50,
+	"bass",		Fout, 		50,	50,
+
+	"speed",	Fin|Fout|Fmono,	Speed,	Speed,
+	0
 };
 
 static	char	Emode[]		= "illegal open mode";

+ 12 - 7
sys/src/cmd/unix/drawterm/kern/devcons.c

@@ -6,8 +6,8 @@
 
 #include 	"keyboard.h"
 
-void	(*consdebug)(void) = nil;
-void	(*screenputs)(char*, int) = nil;
+void	(*consdebug)(void) = 0;
+void	(*screenputs)(char*, int) = 0;
 
 Queue*	kbdq;			/* unprocessed console input */
 Queue*	lineq;			/* processed console input */
@@ -86,7 +86,7 @@ return0(void *v)
 void
 printinit(void)
 {
-	lineq = qopen(2*1024, 0, nil, nil);
+	lineq = qopen(2*1024, 0, 0, nil);
 	if(lineq == nil)
 		panic("printinit");
 	qnoblock(lineq, 1);
@@ -332,14 +332,14 @@ echo(char *buf, int n)
 			pagersummary();
 			return;
 		case 'd':
-			if(consdebug == nil)
+			if(consdebug == 0)
 				consdebug = rdb;
 			else
-				consdebug = nil;
+				consdebug = 0;
 			print("consdebug now 0x%p\n", consdebug);
 			return;
 		case 'D':
-			if(consdebug == nil)
+			if(consdebug == 0)
 				consdebug = rdb;
 			consdebug();
 			return;
@@ -363,7 +363,7 @@ echo(char *buf, int n)
 	qproduce(kbdq, buf, n);
 	if(kbd.raw)
 		return;
-	if(screenputs != nil)
+	if(screenputs != 0)
 		echoscreen(buf, n);
 	if(serialoq)
 		echoserialoq(buf, n);
@@ -464,6 +464,7 @@ enum{
 	Qrandom,
 	Qreboot,
 	Qsecstore,
+	Qshowfile,
 	Qsnarf,
 	Qswap,
 	Qsysname,
@@ -497,6 +498,7 @@ static Dirtab consdir[]={
 	"random",	{Qrandom},	0,		0444,
 	"reboot",	{Qreboot},	0,		0664,
 	"secstore",	{Qsecstore},	0,		0666,
+	"showfile",	{Qshowfile},	0,	0220,
 	"snarf",	{Qsnarf},		0,		0666,
 	"swap",		{Qswap},	0,		0664,
 	"sysname",	{Qsysname},	0,		0664,
@@ -915,6 +917,9 @@ conswrite(Chan *c, void *va, long n, vlong off)
 		memmove(secstorebuf+offset, va, n);
 		return n;
 
+	case Qshowfile:
+		return showfilewrite(a, n);
+
 	case Qsnarf:
 		if(offset >= SnarfSize || offset+n >= SnarfSize)
 			error(Etoobig);

+ 36 - 6
sys/src/cmd/unix/drawterm/kern/devdraw.c

@@ -867,12 +867,17 @@ drawpoint(Point *p, uchar *a)
 	p->y = BGLONG(a+1*4);
 }
 
+#define isvgascreen(dst) 1
+
+
 Point
-drawchar(Memimage *dst, Point p, Memimage *src, Point *sp, DImage *font, int index, int op)
+drawchar(Memimage *dst, Memimage *rdst, Point p, 
+	Memimage *src, Point *sp, DImage *font, int index, int op)
 {
 	FChar *fc;
 	Rectangle r;
 	Point sp1;
+	static Memimage *tmp;
 
 	fc = &font->fchar[index];
 	r.min.x = p.x+fc->left;
@@ -881,7 +886,31 @@ drawchar(Memimage *dst, Point p, Memimage *src, Point *sp, DImage *font, int ind
 	r.max.y = r.min.y+(fc->maxy-fc->miny);
 	sp1.x = sp->x+fc->left;
 	sp1.y = sp->y+fc->miny;
-	memdraw(dst, r, src, sp1, font->image, Pt(fc->minx, fc->miny), op);
+	
+	/*
+	 * If we're drawing greyscale fonts onto a VGA screen,
+	 * it's very costly to read the screen memory to do the
+	 * alpha blending inside memdraw.  If this is really a stringbg,
+	 * then rdst is the bg image (in main memory) which we can
+	 * refer to for the underlying dst pixels instead of reading dst
+	 * directly.
+	 */
+	if(1 || (isvgascreen(dst) && !isvgascreen(rdst) /*&& font->image->depth > 1*/)){
+		if(tmp == nil || tmp->chan != dst->chan || Dx(tmp->r) < Dx(r) || Dy(tmp->r) < Dy(r)){
+			if(tmp)
+				freememimage(tmp);
+			tmp = allocmemimage(Rect(0,0,Dx(r),Dy(r)), dst->chan);
+			if(tmp == nil)
+				goto fallback;
+		}
+		memdraw(tmp, Rect(0,0,Dx(r),Dy(r)), rdst, r.min, memopaque, ZP, S);
+		memdraw(tmp, Rect(0,0,Dx(r),Dy(r)), src, sp1, font->image, Pt(fc->minx, fc->miny), op);
+		memdraw(dst, r, tmp, ZP, memopaque, ZP, S);
+	}else{
+	fallback:
+		memdraw(dst, r, src, sp1, font->image, Pt(fc->minx, fc->miny), op);
+	}
+
 	p.x += fc->width;
 	sp->x += fc->width;
 	return p;
@@ -1382,7 +1411,7 @@ drawmesg(Client *client, void *av, int n)
 				scrn = dscrn->screen;
 				if(repl || chan!=scrn->image->chan)
 					error("image parameters incompatible with screen");
-				reffn = nil;
+				reffn = 0;
 				switch(refresh){
 				case Refbackup:
 					break;
@@ -1525,9 +1554,9 @@ drawmesg(Client *client, void *av, int n)
 			oy = BGLONG(a+41);
 			op = drawclientop(client);
 			/* high bit indicates arc angles are present */
-			if(ox & (1<<31)){
+			if(ox & (1U<<31)){
 				if((ox & (1<<30)) == 0)
-					ox &= ~(1<<31);
+					ox &= ~(1U<<31);
 				memarc(dst, p, e0, e1, c, src, sp, ox, oy, op);
 			}else
 				memellipse(dst, p, e0, e1, c, src, sp, op);
@@ -1873,6 +1902,7 @@ drawmesg(Client *client, void *av, int n)
 			clipr = dst->clipr;
 			dst->clipr = r;
 			op = drawclientop(client);
+			l = dst;
 			if(*a == 'x'){
 				/* paint background */
 				l = drawimage(client, a+47);
@@ -1901,7 +1931,7 @@ drawmesg(Client *client, void *av, int n)
 					dst->clipr = clipr;
 					error(Eindex);
 				}
-				q = drawchar(dst, q, src, &sp, font, ci, op);
+				q = drawchar(dst, l, q, src, &sp, font, ci, op);
 				u += 2;
 			}
 			dst->clipr = clipr;

+ 5 - 1
sys/src/cmd/unix/drawterm/kern/devip.c

@@ -688,7 +688,11 @@ parseip(char *to, char *from)
 	p = from;
 	memset(to, 0, 4);
 	for(i = 0; i < 4 && *p; i++){
-		to[i] = strtoul(p, &p, 0);
+		to[i] = strtoul(p, &p, 10);
+		if(*p != '.' && *p != 0){
+			memset(to, 0, 4);
+			return 0;
+		}
 		if(*p == '.')
 			p++;
 	}

+ 4 - 4
sys/src/cmd/unix/drawterm/kern/devlfd.c

@@ -15,7 +15,7 @@ lfdchan(int fd)
 	
 	c = newchan();
 	c->type = devno('L', 0);
-	c->aux = (void*)fd;
+	c->aux = (void*)(uintptr)fd;
 	c->name = newcname("fd");
 	c->mode = ORDWR;
 	c->qid.type = 0;
@@ -76,14 +76,14 @@ lfdopen(Chan *c, int omode)
 static void
 lfdclose(Chan *c)
 {
-	close((int)c->aux);
+	close((int)(uintptr)c->aux);
 }
 
 static long
 lfdread(Chan *c, void *buf, long n, vlong off)
 {
 	USED(off);	/* can't pread on pipes */
-	n = read((int)c->aux, buf, n);
+	n = read((int)(uintptr)c->aux, buf, n);
 	if(n < 0){
 		iprint("error %d\n", errno);
 		oserror();
@@ -96,7 +96,7 @@ lfdwrite(Chan *c, void *buf, long n, vlong off)
 {
 	USED(off);	/* can't pread on pipes */
 
-	n = write((int)c->aux, buf, n);
+	n = write((int)(uintptr)c->aux, buf, n);
 	if(n < 0){
 		iprint("error %d\n", errno);
 		oserror();

+ 3 - 3
sys/src/cmd/unix/drawterm/kern/devmnt.c

@@ -216,7 +216,7 @@ mntversion(Chan *c, char *version, int msize, int returnlen)
 	m->version = nil;
 	kstrdup(&m->version, f.version);
 	m->id = mntalloc.id++;
-	m->q = qopen(10*MAXRPC, 0, nil, nil);
+	m->q = qopen(10*MAXRPC, 0, 0, nil);
 	m->msize = f.msize;
 	unlock(&mntalloc.lk);
 
@@ -970,7 +970,7 @@ mountmux(Mnt *m, Mntrpc *r)
 			}
 			q->done = 1;
 			unlock(&m->lk);
-			if(mntstats != nil)
+			if(mntstats != 0)
 				(*mntstats)(q->request.type,
 					m->c, q->stime,
 					q->reqlen + r->replen);
@@ -1037,7 +1037,7 @@ alloctag(void)
 
 	for(i = 0; i < NMASK; i++){
 		v = mntalloc.tagmask[i];
-		if(v == ~0UL)
+		if(v == ~0)
 			continue;
 		for(j = 0; j < 1<<TAGSHIFT; j++)
 			if((v & (1<<j)) == 0){

+ 1 - 1
sys/src/cmd/unix/drawterm/kern/devssl.c

@@ -358,7 +358,7 @@ sslwstat(Chan *c, uchar *db, int n)
 
 	if(!emptystr(dir->uid))
 		kstrdup(&s->user, dir->uid);
-	if(dir->mode != ~0UL)
+	if(dir->mode != ~0)
 		s->perm = dir->mode;
 
 	free(dir);

+ 12 - 10
sys/src/cmd/unix/drawterm/kern/devtls.c

@@ -224,7 +224,7 @@ static void	put64(uchar *p, vlong x);
 static void	put32(uchar *p, u32int);
 static void	put24(uchar *p, int);
 static void	put16(uchar *p, int);
-static u32int	get32(uchar *p);
+/* static u32int	get32(uchar *p); */
 static int	get16(uchar *p);
 static void	tlsSetState(TlsRec *tr, int new, int old);
 static void	rcvAlert(TlsRec *tr, int err);
@@ -244,15 +244,15 @@ static char *tlsnames[] = {
 	/* unused */ 0,
 	/* topdir */ 0,
 	/* protodir */ 0,
-	"clone",		/* [Qclonus] */
-	"encalgs",		/* [Qencalgs] */
-	"hashalgs",		/* [Qhashalgs] */
+	"clone",
+	"encalgs",
+	"hashalgs",
 	/* convdir */ 0,
-	"data",			/* [Qdata] */
-	"ctl",			/* [Qctl] */
-	"hand",			/* [Qhand] */
-	"status",		/* [Qstatus] */
-	"stats",		/* [Qstats] */
+	"data",
+	"ctl",
+	"hand",
+	"status",
+	"stats",
 };
 
 static int convdir[] = { Qctl, Qdata, Qhand, Qstatus, Qstats };
@@ -467,7 +467,7 @@ tlsopen(Chan *c, int omode)
 			lock(&tr->hqlock);
 			if(tr->handq != nil)
 				error(Einuse);
-			tr->handq = qopen(2 * MaxCipherRecLen, 0, nil, nil);
+			tr->handq = qopen(2 * MaxCipherRecLen, 0, 0, nil);
 			if(tr->handq == nil)
 				error("cannot allocate handshake queue");
 			tr->hqref = 1;
@@ -2136,11 +2136,13 @@ put16(uchar *p, int x)
 	p[1] = x;
 }
 
+/*
 static u32int
 get32(uchar *p)
 {
 	return (p[0]<<24)|(p[1]<<16)|(p[2]<<8)|p[3];
 }
+*/
 
 static int
 get16(uchar *p)

+ 2 - 1
sys/src/cmd/unix/drawterm/kern/fns.h

@@ -305,10 +305,11 @@ void		segclock(ulong);
 void		segpage(Segment*, Page*);
 void		setkernur(Ureg*, Proc*);
 int		setlabel(Label*);
-void		setmalloctag(void*, ulong);
+void		setmalloctag(void*, uintptr);
 void		setrealloctag(void*, ulong);
 void		setregisters(Ureg*, char*, char*, int);
 void		setswapchan(Chan*);
+long		showfilewrite(char*, int);
 char*		skipslash(char*);
 void		sleep(Rendez*, int(*)(void*), void*);
 void*		smalloc(ulong);

+ 7 - 0
sys/src/cmd/unix/drawterm/kern/posix.c

@@ -6,6 +6,7 @@
 #include <pthread.h>
 #include <time.h>
 #include <sys/time.h>
+#include <sys/select.h>
 #include <signal.h>
 #include <pwd.h>
 #include <errno.h>
@@ -212,3 +213,9 @@ ticks(void)
 	return (t.tv_sec-sec0)*1000+(t.tv_usec-usec0+500)/1000;
 }
 
+long
+showfilewrite(char *a, int n)
+{
+	error("not implemented");
+	return -1;
+}

+ 3 - 3
sys/src/cmd/unix/drawterm/kern/qio.c

@@ -96,7 +96,7 @@ padblock(Block *bp, int size)
 		}
 
 		if(bp->next)
-			panic("padblock 0x%luX", getcallerpc(&bp));
+			panic("padblock 0x%p", getcallerpc(&bp));
 		n = BLEN(bp);
 		padblockcnt++;
 		nbp = allocb(size+n);
@@ -110,7 +110,7 @@ padblock(Block *bp, int size)
 		size = -size;
 
 		if(bp->next)
-			panic("padblock 0x%luX", getcallerpc(&bp));
+			panic("padblock 0x%p", getcallerpc(&bp));
 
 		if(bp->lim - bp->wp >= size)
 			return bp;
@@ -1270,7 +1270,7 @@ qwrite(Queue *q, void *vp, int len)
 	uchar *p = vp;
 
 	QDEBUG if(!islo())
-		print("qwrite hi %lux\n", getcallerpc(&q));
+		print("qwrite hi %p\n", getcallerpc(&q));
 
 	sofar = 0;
 	do {

+ 1 - 1
sys/src/cmd/unix/drawterm/kern/stub.c

@@ -139,7 +139,7 @@ rdb(void)
 }
 
 void
-setmalloctag(void *v, ulong tag)
+setmalloctag(void *v, uintptr tag)
 {
 	USED(v);
 	USED(tag);

+ 9 - 9
sys/src/cmd/unix/drawterm/kern/sysfile.c

@@ -1189,15 +1189,15 @@ rerrstr(char *buf, uint n)
 	return strlen(buf);
 }
 
-ulong
-_sysrendezvous(ulong arg0, ulong arg1)
+void*
+_sysrendezvous(void* arg0, void* arg1)
 {
-	ulong tag, val;
+	void *tag, *val;
 	Proc *p, **l;
 
 	tag = arg0;
-	l = &REND(up->rgrp, tag);
-	up->rendval = ~0UL;
+	l = &REND(up->rgrp, (uintptr)tag);
+	up->rendval = (void*)~0;
 
 	lock(&up->rgrp->ref.lk);
 	for(p = *l; p; p = p->rendhash) {
@@ -1228,15 +1228,15 @@ _sysrendezvous(ulong arg0, ulong arg1)
 	return up->rendval;
 }
 
-ulong
-sysrendezvous(ulong tag, ulong val)
+void*
+sysrendezvous(void *tag, void *val)
 {
-	ulong n;
+	void *n;
 
 	starterror();
 	if(waserror()){
 		_syserror();
-		return -1;
+		return (void*)~0;
 	}
 	n = _sysrendezvous(tag, val);
 	enderror();

+ 24 - 0
sys/src/cmd/unix/drawterm/kern/win32.c

@@ -444,3 +444,27 @@ oserrstr(void)
 {
 	osrerrstr(up->errstr, ERRMAX);
 }
+
+long
+showfilewrite(char *a, int n)
+{
+	Rune *action, *arg, *cmd;
+	static Rune Lopen[] = { 'o', 'p', 'e', 'n', 0 };
+
+	cmd = runesmprint("%.*s", n, a);
+	if(cmd == nil)
+		error("out of memory");
+	if(cmd[runestrlen(cmd)-1] == '\n')
+		cmd[runestrlen(cmd)] = 0;
+	p = runestrchr(cmd, ' ');
+	if(p){
+		action = cmd;
+		*p++ = 0;
+		arg = p;
+	}else{
+		action = Lopen;
+		arg = cmd;
+	}
+	ShellExecute(0, 0, action, arg, 0, SW_SHOWNORMAL);
+	return n;
+}

+ 1 - 1
sys/src/cmd/unix/drawterm/libauth/auth_getuserpasswd.c

@@ -15,7 +15,7 @@ dorpc(AuthRpc *rpc, char *verb, char *val, int len, AuthGetkey *getkey)
 	for(;;){
 		if((ret = auth_rpc(rpc, verb, val, len)) != ARneedkey && ret != ARbadkey)
 			return ret;
-		if(getkey == nil)
+		if(getkey == 0)
 			return ARgiveup;	/* don't know how */
 		if((*getkey)(rpc->arg) < 0)
 			return ARgiveup;	/* user punted */

+ 2 - 1
sys/src/cmd/unix/drawterm/libauth/auth_proxy.c

@@ -90,6 +90,7 @@ auth_getinfo(AuthRpc *rpc)
 
 	if(auth_rpc(rpc, "authinfo", nil, 0) != ARok)
 		return nil;
+	a = nil;
 	if(convM2AI((uchar*)rpc->arg, rpc->narg, &a) == nil){
 		werrstr("bad auth info from factotum");
 		return nil;
@@ -105,7 +106,7 @@ dorpc(AuthRpc *rpc, char *verb, char *val, int len, AuthGetkey *getkey)
 	for(;;){
 		if((ret = auth_rpc(rpc, verb, val, len)) != ARneedkey && ret != ARbadkey)
 			return ret;
-		if(getkey == nil)
+		if(getkey == 0)
 			return ARgiveup;	/* don't know how */
 		if((*getkey)(rpc->arg) < 0)
 			return ARgiveup;	/* user punted */

+ 1 - 1
sys/src/cmd/unix/drawterm/libauth/auth_respond.c

@@ -16,7 +16,7 @@ dorpc(AuthRpc *rpc, char *verb, char *val, int len, AuthGetkey *getkey)
 	for(;;){
 		if((ret = auth_rpc(rpc, verb, val, len)) != ARneedkey && ret != ARbadkey)
 			return ret;
-		if(getkey == nil)
+		if(getkey == 0)
 			return ARgiveup;	/* don't know how */
 		if((*getkey)(rpc->arg) < 0)
 			return ARgiveup;	/* user punted */

+ 5 - 1
sys/src/cmd/unix/drawterm/libc/dofmt.c

@@ -333,7 +333,11 @@ __ifmt(Fmt *f)
 		break;
 	}
 	if(f->r == 'p'){
-		u = (ulong)va_arg(f->args, void*);
+		if(sizeof(void*) == sizeof(uvlong)){
+			isv = 1;
+			vu = (uvlong)va_arg(f->args, uvlong);
+		}else
+			u = (ulong)va_arg(f->args, ulong);
 		f->r = 'x';
 		fl |= FmtUnsigned;
 	}else if(fl & FmtVLong){

+ 2 - 2
sys/src/cmd/unix/drawterm/libc/fmt.c

@@ -61,7 +61,7 @@ static Convfmt knownfmt[] = {
 	'u',	__ifmt,
 #endif
 	'x',	__ifmt,
-	0,	nil,
+	0,	0,
 };
 
 
@@ -116,7 +116,7 @@ fmtfmt(int c)
 	ep = &fmtalloc.fmt[fmtalloc.nfmt];
 	for(p=fmtalloc.fmt; p<ep; p++)
 		if(p->c == c){
-			while(p->fmt == nil)	/* loop until value is updated */
+			while(p->fmt == 0)	/* loop until value is updated */
 				;
 			return p->fmt;
 		}

+ 1 - 1
sys/src/cmd/unix/drawterm/libc/fmtquote.c

@@ -51,7 +51,7 @@ __quotesetup(char *s, Rune *r, int nin, int nout, Quoteinfo *q, int sharp, int r
 				break;
 		}
 
-		if((c <= L' ') || (c == L'\'') || (fmtdoquote!=nil && fmtdoquote(c))){
+		if((c <= L' ') || (c == L'\'') || (fmtdoquote!=0 && fmtdoquote(c))){
 			if(!q->quoted){
 				if(runesout){
 					if(1+q->nrunesout+1+1 > nout)	/* no room for quotes */

+ 1 - 1
sys/src/cmd/unix/drawterm/libc/lock.c

@@ -38,7 +38,7 @@ lock(Lock *lk)
 	for(;;) {
 		if(canlock(lk))
 			return;
-		iprint("lock loop %ld: val=%d &lock=%ux pc=%ux\n", getpid(), lk->key, lk, getcallerpc(&lk));
+		iprint("lock loop %ld: val=%d &lock=%ux pc=%p\n", getpid(), lk->key, lk, getcallerpc(&lk));
 		osmsleep(1000);
 	}
 }

+ 1 - 1
sys/src/cmd/unix/drawterm/libc/runevseprint.c

@@ -13,7 +13,7 @@ runevseprint(Rune *buf, Rune *e, char *fmt, va_list args)
 	f.start = buf;
 	f.to = buf;
 	f.stop = e - 1;
-	f.flush = nil;
+	f.flush = 0;
 	f.farg = nil;
 	f.nfmt = 0;
 	VA_COPY(f.args,args);

+ 1 - 1
sys/src/cmd/unix/drawterm/libc/runevsnprint.c

@@ -13,7 +13,7 @@ runevsnprint(Rune *buf, int len, char *fmt, va_list args)
 	f.start = buf;
 	f.to = buf;
 	f.stop = buf + len - 1;
-	f.flush = nil;
+	f.flush = 0;
 	f.farg = nil;
 	f.nfmt = 0;
 	VA_COPY(f.args,args);

+ 1 - 1
sys/src/cmd/unix/drawterm/libc/strtod.c

@@ -224,7 +224,7 @@ fmtstrtod(const char *as, char **aas)
 	/* close approx by naive conversion */
 	mid[0] = 0;
 	mid[1] = 1;
-	for(i=0; c=a[i]; i++) {
+	for(i=0; (c=a[i]); i++) {
 		mid[0] = mid[0]*10 + (c-'0');
 		mid[1] = mid[1]*10;
 		if(i >= 8)

+ 2 - 2
sys/src/cmd/unix/drawterm/libc/strtoll.c

@@ -1,7 +1,7 @@
 #include <u.h>
 #include <libc.h>
-#define VLONG_MAX	~(((vlong) 1)<<63)
-#define VLONG_MIN	(((vlong) 1)<<63)
+#define VLONG_MAX	((vlong)~(((uvlong)1)<<63))
+#define VLONG_MIN	((vlong)(((uvlong)1)<<63))
 vlong
 strtoll(const char *nptr, char **endptr, int base)
 {

+ 12 - 8
sys/src/cmd/unix/drawterm/libmemdraw/alloc.c

@@ -19,7 +19,7 @@ memimagemove(void *from, void *to)
 	md->base = to;
 
 	/* if allocmemimage changes this must change too */
-	md->bdata = (uchar*)&md->base[2];
+	md->bdata = (uchar*)md->base+sizeof(Memdata*)+sizeof(ulong);
 }
 
 Memimage*
@@ -70,7 +70,8 @@ Memimage*
 _allocmemimage(Rectangle r, ulong chan)
 {
 	int d;
-	ulong l, nw;
+	u32int l, nw;
+	uchar *p;
 	Memdata *md;
 	Memimage *i;
 
@@ -86,18 +87,21 @@ _allocmemimage(Rectangle r, ulong chan)
 		return nil;
 
 	md->ref = 1;
-	md->base = poolalloc(imagmem, (2+nw)*sizeof(ulong));
+	md->base = poolalloc(imagmem, sizeof(Memdata*)+(1+nw)*sizeof(ulong));
 	if(md->base == nil){
 		free(md);
 		return nil;
 	}
 
-	md->base[0] = (ulong)md;
-	md->base[1] = getcallerpc(&r);
+	p = (uchar*)md->base;
+	*(Memdata**)p = md;
+	p += sizeof(Memdata*);
 
-	/* if this changes, memimagemove must change too */
-	md->bdata = (uchar*)&md->base[2];
+	*(ulong*)p = getcallerpc(&r);
+	p += sizeof(ulong);
 
+	/* if this changes, memimagemove must change too */
+	md->bdata = p;
 	md->allocd = 1;
 
 	i = allocmemimaged(r, chan, md, nil);
@@ -129,7 +133,7 @@ _freememimage(Memimage *i)
 ulong*
 wordaddr(Memimage *i, Point p)
 {
-	return (ulong*) ((ulong)byteaddr(i, p) & ~(sizeof(ulong)-1));
+	return (ulong*) ((uintptr)byteaddr(i, p) & ~(sizeof(ulong)-1));
 }
 
 uchar*

+ 1 - 1
sys/src/cmd/unix/drawterm/libmemdraw/defont.c

@@ -21,7 +21,7 @@ getmemdefont(void)
 	 * declared as char*, not ulong*.
 	 */
 	p = (char*)defontdata;
-	n = (ulong)p & 3;
+	n = (uintptr)p & 3;
 	if(n != 0){
 		memmove(p+(4-n), p, sizeofdefont-n);
 		p += 4-n;

+ 1 - 1
sys/src/cmd/unix/drawterm/libmemdraw/draw.c

@@ -1890,7 +1890,7 @@ boolcopyfn(Memimage *img, Memimage *mask)
 	default:
 		assert(0 /* boolcopyfn */);
 	}
-	return nil;
+	return 0;
 }
 
 /*

+ 3 - 3
sys/src/cmd/unix/drawterm/libmemlayer/lsetrefresh.c

@@ -10,13 +10,13 @@ memlsetrefresh(Memimage *i, Refreshfn fn, void *ptr)
 	Memlayer *l;
 
 	l = i->layer;
-	if(l->refreshfn!=nil && fn!=nil){	/* just change functions */
+	if(l->refreshfn!=0 && fn!=0){	/* just change functions */
 		l->refreshfn = fn;
 		l->refreshptr = ptr;
 		return 1;
 	}
 
-	if(l->refreshfn == nil){	/* is using backup image; just free it */
+	if(l->refreshfn == 0){	/* is using backup image; just free it */
 		freememimage(l->save);
 		l->save = nil;
 		l->refreshfn = fn;
@@ -29,7 +29,7 @@ memlsetrefresh(Memimage *i, Refreshfn fn, void *ptr)
 		return 0;
 	/* easiest way is just to update the entire save area */
 	l->refreshfn(i, i->r, l->refreshptr);
-	l->refreshfn = nil;
+	l->refreshfn = 0;
 	l->refreshptr = nil;
 	return 1;
 }

+ 1 - 1
sys/src/cmd/unix/drawterm/libmp/dat.h

@@ -1,4 +1,4 @@
-#define	mpdighi  (mpdigit)(1<<(Dbits-1))
+#define	mpdighi  (mpdigit)(1U<<(Dbits-1))
 #define DIGITS(x) ((Dbits - 1 + (x))/Dbits)
 
 // for converting between int's and mpint's

+ 2 - 2
sys/src/cmd/unix/drawterm/posix-386/getcallerpc.c

@@ -1,8 +1,8 @@
 #include "u.h"
 #include "libc.h"
 
-ulong
+uintptr
 getcallerpc(void *a)
 {
-	return ((ulong*)a)[-1];
+	return ((uintptr*)a)[-1];
 }

+ 17 - 0
sys/src/cmd/unix/drawterm/posix-amd64/Makefile

@@ -0,0 +1,17 @@
+ROOT=..
+include ../Make.config
+LIB=../libmachdep.a
+
+OFILES=\
+	getcallerpc.$O\
+	md5block.$O\
+	sha1block.$O\
+	tas.$O
+
+default: $(LIB)
+$(LIB): $(OFILES)
+	$(AR) r $(LIB) $(OFILES)
+	$(RANLIB) $(LIB)
+
+%.$O: %.c
+	$(CC) $(CFLAGS) $*.c

+ 8 - 0
sys/src/cmd/unix/drawterm/posix-amd64/getcallerpc.c

@@ -0,0 +1,8 @@
+#include "u.h"
+#include "libc.h"
+
+ulong
+getcallerpc(void *a)
+{
+	return ((ulong*)a)[-1];
+}

+ 268 - 0
sys/src/cmd/unix/drawterm/posix-amd64/md5block.c

@@ -0,0 +1,268 @@
+#include <u.h>
+#include <libc.h>
+#include <libsec.h>
+
+/*
+ *  rfc1321 requires that I include this.  The code is new.  The constants
+ *  all come from the rfc (hence the copyright).  We trade a table for the
+ *  macros in rfc.  The total size is a lot less. -- presotto
+ *
+ *	Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+ *	rights reserved.
+ *
+ *	License to copy and use this software is granted provided that it
+ *	is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ *	Algorithm" in all material mentioning or referencing this software
+ *	or this function.
+ *
+ *	License is also granted to make and use derivative works provided
+ *	that such works are identified as "derived from the RSA Data
+ *	Security, Inc. MD5 Message-Digest Algorithm" in all material
+ *	mentioning or referencing the derived work.
+ *
+ *	RSA Data Security, Inc. makes no representations concerning either
+ *	the merchantability of this software or the suitability of this
+ *	software forany particular purpose. It is provided "as is"
+ *	without express or implied warranty of any kind.
+ *	These notices must be retained in any copies of any part of this
+ *	documentation and/or software.
+ */
+
+/*
+ *	Rotate ammounts used in the algorithm
+ */
+enum
+{
+	S11=	7,
+	S12=	12,
+	S13=	17,
+	S14=	22,
+
+	S21=	5,
+	S22=	9,
+	S23=	14,
+	S24=	20,
+
+	S31=	4,
+	S32=	11,
+	S33=	16,
+	S34=	23,
+
+	S41=	6,
+	S42=	10,
+	S43=	15,
+	S44=	21,
+};
+
+static u32int md5tab[] =
+{
+	/* round 1 */
+/*[0]*/	0xd76aa478,	
+	0xe8c7b756,	
+	0x242070db,	
+	0xc1bdceee,	
+	0xf57c0faf,	
+	0x4787c62a,	
+	0xa8304613,	
+	0xfd469501,	
+	0x698098d8,	
+	0x8b44f7af,	
+	0xffff5bb1,	
+	0x895cd7be,	
+	0x6b901122,	
+	0xfd987193,	
+	0xa679438e,	
+	0x49b40821,
+
+	/* round 2 */
+/*[16]*/0xf61e2562,	
+	0xc040b340,	
+	0x265e5a51,	
+	0xe9b6c7aa,	
+	0xd62f105d,	
+	 0x2441453,	
+	0xd8a1e681,	
+	0xe7d3fbc8,	
+	0x21e1cde6,	
+	0xc33707d6,	
+	0xf4d50d87,	
+	0x455a14ed,	
+	0xa9e3e905,	
+	0xfcefa3f8,	
+	0x676f02d9,	
+	0x8d2a4c8a,
+
+	/* round 3 */
+/*[32]*/0xfffa3942,	
+	0x8771f681,	
+	0x6d9d6122,	
+	0xfde5380c,	
+	0xa4beea44,	
+	0x4bdecfa9,	
+	0xf6bb4b60,	
+	0xbebfbc70,	
+	0x289b7ec6,	
+	0xeaa127fa,	
+	0xd4ef3085,	
+	 0x4881d05,	
+	0xd9d4d039,	
+	0xe6db99e5,	
+	0x1fa27cf8,	
+	0xc4ac5665,	
+
+	/* round 4 */
+/*[48]*/0xf4292244,	
+	0x432aff97,	
+	0xab9423a7,	
+	0xfc93a039,	
+	0x655b59c3,	
+	0x8f0ccc92,	
+	0xffeff47d,	
+	0x85845dd1,	
+	0x6fa87e4f,	
+	0xfe2ce6e0,	
+	0xa3014314,	
+	0x4e0811a1,	
+	0xf7537e82,	
+	0xbd3af235,	
+	0x2ad7d2bb,	
+	0xeb86d391,	
+};
+
+static void decode(u32int*, uchar*, ulong);
+extern void _md5block(uchar *p, ulong len, u32int *s);
+
+void
+_md5block(uchar *p, ulong len, u32int *s)
+{
+	u32int a, b, c, d, sh;
+	u32int *t;
+	uchar *end;
+	u32int x[16];
+
+	for(end = p+len; p < end; p += 64){
+		a = s[0];
+		b = s[1];
+		c = s[2];
+		d = s[3];
+
+		decode(x, p, 64);
+	
+		t = md5tab;
+		sh = 0;
+		for(; sh != 16; t += 4){
+			a += ((c ^ d) & b) ^ d;
+			a += x[sh] + t[0];
+			a = (a << S11) | (a >> (32 - S11));
+			a += b;
+
+			d += ((b ^ c) & a) ^ c;
+			d += x[sh + 1] + t[1];
+			d = (d << S12) | (d >> (32 - S12));
+			d += a;
+
+			c += ((a ^ b) & d) ^ b;
+			c += x[sh + 2] + t[2];
+			c = (c << S13) | (c >> (32 - S13));
+			c += d;
+
+			b += ((d ^ a) & c) ^ a;
+			b += x[sh + 3] + t[3];
+			b = (b << S14) | (b >> (32 - S14));
+			b += c;
+
+			sh += 4;
+		}
+		sh = 1;
+		for(; sh != 1+20*4; t += 4){
+			a += ((b ^ c) & d) ^ c;
+			a += x[sh & 0xf] + t[0];
+			a = (a << S21) | (a >> (32 - S21));
+			a += b;
+
+			d += ((a ^ b) & c) ^ b;
+			d += x[(sh + 5) & 0xf] + t[1];
+			d = (d << S22) | (d >> (32 - S22));
+			d += a;
+
+			c += ((d ^ a) & b) ^ a;
+			c += x[(sh + 10) & 0xf] + t[2];
+			c = (c << S23) | (c >> (32 - S23));
+			c += d;
+
+			b += ((c ^ d) & a) ^ d;
+			b += x[(sh + 15) & 0xf] + t[3];
+			b = (b << S24) | (b >> (32 - S24));
+			b += c;
+
+			sh += 20;
+		}
+		sh = 5;
+		for(; sh != 5+12*4; t += 4){
+			a += b ^ c ^ d;
+			a += x[sh & 0xf] + t[0];
+			a = (a << S31) | (a >> (32 - S31));
+			a += b;
+
+			d += a ^ b ^ c;
+			d += x[(sh + 3) & 0xf] + t[1];
+			d = (d << S32) | (d >> (32 - S32));
+			d += a;
+
+			c += d ^ a ^ b;
+			c += x[(sh + 6) & 0xf] + t[2];
+			c = (c << S33) | (c >> (32 - S33));
+			c += d;
+
+			b += c ^ d ^ a;
+			b += x[(sh + 9) & 0xf] + t[3];
+			b = (b << S34) | (b >> (32 - S34));
+			b += c;
+
+			sh += 12;
+		}
+		sh = 0;
+		for(; sh != 28*4; t += 4){
+			a += c ^ (b | ~d);
+			a += x[sh & 0xf] + t[0];
+			a = (a << S41) | (a >> (32 - S41));
+			a += b;
+
+			d += b ^ (a | ~c);
+			d += x[(sh + 7) & 0xf] + t[1];
+			d = (d << S42) | (d >> (32 - S42));
+			d += a;
+
+			c += a ^ (d | ~b);
+			c += x[(sh + 14) & 0xf] + t[2];
+			c = (c << S43) | (c >> (32 - S43));
+			c += d;
+
+			b += d ^ (c | ~a);
+			b += x[(sh + 21) & 0xf] + t[3];
+			b = (b << S44) | (b >> (32 - S44));
+			b += c;
+
+			sh += 28;
+		}
+
+		s[0] += a;
+		s[1] += b;
+		s[2] += c;
+		s[3] += d;
+	}
+}
+
+/*
+ *	decodes input (uchar) into output (u32int). Assumes len is
+ *	a multiple of 4.
+ */
+static void
+decode(u32int *output, uchar *input, ulong len)
+{
+	uchar *e;
+
+	for(e = input+len; input < e; input += 4)
+		*output++ = input[0] | (input[1] << 8) |
+			(input[2] << 16) | (input[3] << 24);
+}

+ 189 - 0
sys/src/cmd/unix/drawterm/posix-amd64/sha1block.c

@@ -0,0 +1,189 @@
+#include <u.h>
+#include <libc.h>
+#include <libsec.h>
+
+void
+_sha1block(uchar *p, ulong len, u32int *s)
+{
+	u32int a, b, c, d, e, x;
+	uchar *end;
+	u32int *wp, *wend;
+	u32int w[80];
+
+	/* at this point, we have a multiple of 64 bytes */
+	for(end = p+len; p < end;){
+		a = s[0];
+		b = s[1];
+		c = s[2];
+		d = s[3];
+		e = s[4];
+
+		wend = w + 15;
+		for(wp = w; wp < wend; wp += 5){
+			wp[0] = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0x5a827999 + (((c^d)&b)^d);
+			b = (b<<30)|(b>>2);
+
+			wp[1] = (p[4]<<24) | (p[5]<<16) | (p[6]<<8) | p[7];
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0x5a827999 + (((b^c)&a)^c);
+			a = (a<<30)|(a>>2);
+
+			wp[2] = (p[8]<<24) | (p[9]<<16) | (p[10]<<8) | p[11];
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0x5a827999 + (((a^b)&e)^b);
+			e = (e<<30)|(e>>2);
+
+			wp[3] = (p[12]<<24) | (p[13]<<16) | (p[14]<<8) | p[15];
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0x5a827999 + (((e^a)&d)^a);
+			d = (d<<30)|(d>>2);
+
+			wp[4] = (p[16]<<24) | (p[17]<<16) | (p[18]<<8) | p[19];
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0x5a827999 + (((d^e)&c)^e);
+			c = (c<<30)|(c>>2);
+			
+			p += 20;
+		}
+
+		wp[0] = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
+		e += ((a<<5) | (a>>27)) + wp[0];
+		e += 0x5a827999 + (((c^d)&b)^d);
+		b = (b<<30)|(b>>2);
+
+		x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+		wp[1] = (x<<1) | (x>>31);
+		d += ((e<<5) | (e>>27)) + wp[1];
+		d += 0x5a827999 + (((b^c)&a)^c);
+		a = (a<<30)|(a>>2);
+
+		x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+		wp[2] = (x<<1) | (x>>31);
+		c += ((d<<5) | (d>>27)) + wp[2];
+		c += 0x5a827999 + (((a^b)&e)^b);
+		e = (e<<30)|(e>>2);
+
+		x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+		wp[3] = (x<<1) | (x>>31);
+		b += ((c<<5) | (c>>27)) + wp[3];
+		b += 0x5a827999 + (((e^a)&d)^a);
+		d = (d<<30)|(d>>2);
+
+		x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+		wp[4] = (x<<1) | (x>>31);
+		a += ((b<<5) | (b>>27)) + wp[4];
+		a += 0x5a827999 + (((d^e)&c)^e);
+		c = (c<<30)|(c>>2);
+
+		wp += 5;
+		p += 4;
+
+		wend = w + 40;
+		for(; wp < wend; wp += 5){
+			x = wp[-3] ^ wp[-8] ^ wp[-14] ^ wp[-16];
+			wp[0] = (x<<1) | (x>>31);
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0x6ed9eba1 + (b^c^d);
+			b = (b<<30)|(b>>2);
+
+			x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+			wp[1] = (x<<1) | (x>>31);
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0x6ed9eba1 + (a^b^c);
+			a = (a<<30)|(a>>2);
+
+			x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+			wp[2] = (x<<1) | (x>>31);
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0x6ed9eba1 + (e^a^b);
+			e = (e<<30)|(e>>2);
+
+			x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+			wp[3] = (x<<1) | (x>>31);
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0x6ed9eba1 + (d^e^a);
+			d = (d<<30)|(d>>2);
+
+			x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+			wp[4] = (x<<1) | (x>>31);
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0x6ed9eba1 + (c^d^e);
+			c = (c<<30)|(c>>2);
+		}
+
+		wend = w + 60;
+		for(; wp < wend; wp += 5){
+			x = wp[-3] ^ wp[-8] ^ wp[-14] ^ wp[-16];
+			wp[0] = (x<<1) | (x>>31);
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0x8f1bbcdc + ((b&c)|((b|c)&d));
+			b = (b<<30)|(b>>2);
+
+			x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+			wp[1] = (x<<1) | (x>>31);
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0x8f1bbcdc + ((a&b)|((a|b)&c));
+			a = (a<<30)|(a>>2);
+
+			x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+			wp[2] = (x<<1) | (x>>31);
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0x8f1bbcdc + ((e&a)|((e|a)&b));
+			e = (e<<30)|(e>>2);
+
+			x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+			wp[3] = (x<<1) | (x>>31);
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0x8f1bbcdc + ((d&e)|((d|e)&a));
+			d = (d<<30)|(d>>2);
+
+			x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+			wp[4] = (x<<1) | (x>>31);
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0x8f1bbcdc + ((c&d)|((c|d)&e));
+			c = (c<<30)|(c>>2);
+		}
+
+		wend = w + 80;
+		for(; wp < wend; wp += 5){
+			x = wp[-3] ^ wp[-8] ^ wp[-14] ^ wp[-16];
+			wp[0] = (x<<1) | (x>>31);
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0xca62c1d6 + (b^c^d);
+			b = (b<<30)|(b>>2);
+
+			x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+			wp[1] = (x<<1) | (x>>31);
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0xca62c1d6 + (a^b^c);
+			a = (a<<30)|(a>>2);
+
+			x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+			wp[2] = (x<<1) | (x>>31);
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0xca62c1d6 + (e^a^b);
+			e = (e<<30)|(e>>2);
+
+			x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+			wp[3] = (x<<1) | (x>>31);
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0xca62c1d6 + (d^e^a);
+			d = (d<<30)|(d>>2);
+
+			x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+			wp[4] = (x<<1) | (x>>31);
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0xca62c1d6 + (c^d^e);
+			c = (c<<30)|(c>>2);
+		}
+
+		/* save state */
+		s[0] += a;
+		s[1] += b;
+		s[2] += c;
+		s[3] += d;
+		s[4] += e;
+	}
+}

+ 23 - 0
sys/src/cmd/unix/drawterm/posix-amd64/tas.c

@@ -0,0 +1,23 @@
+#include "u.h"
+#include "libc.h"
+
+int
+tas(long *x)
+{
+	int     v;
+
+	__asm__(	"movl   $1, %%eax\n\t"
+				"xchgl  %%eax,(%%rcx)"
+				: "=a" (v)
+				: "c" (x)
+	);
+	switch(v) {
+	case 0:
+	case 1:
+		return v;
+	default:
+		print("canlock: corrupted 0x%lux\n", v);
+		return 1;
+	}
+}
+

+ 25 - 0
sys/src/cmd/unix/drawterm/posix-mips/Makefile

@@ -0,0 +1,25 @@
+ROOT=..
+include ../Make.config
+LIB=../libmachdep.a
+
+OFILES=\
+	getcallerpc.$O\
+	md5block.$O\
+	sha1block.$O\
+	tas.$O
+
+default: $(LIB)
+$(LIB): $(OFILES)
+	$(AR) r $(LIB) $(OFILES)
+	$(RANLIB) $(LIB)
+
+%.$O: %.c
+	$(CC) $(CFLAGS) $*.c
+
+%.$O: %.s
+	$(AS) $(ASFLAGS) -o $*.$O $*.s
+
+%.s: %.spp
+	cpp $*.spp >$*.s
+
+

+ 8 - 0
sys/src/cmd/unix/drawterm/posix-mips/getcallerpc.c

@@ -0,0 +1,8 @@
+#include "u.h"
+#include "libc.h"
+
+ulong
+getcallerpc(void *a)
+{
+	return ((ulong*)a)[-1];
+}

+ 268 - 0
sys/src/cmd/unix/drawterm/posix-mips/md5block.c

@@ -0,0 +1,268 @@
+#include <u.h>
+#include <libc.h>
+#include <libsec.h>
+
+/*
+ *  rfc1321 requires that I include this.  The code is new.  The constants
+ *  all come from the rfc (hence the copyright).  We trade a table for the
+ *  macros in rfc.  The total size is a lot less. -- presotto
+ *
+ *	Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+ *	rights reserved.
+ *
+ *	License to copy and use this software is granted provided that it
+ *	is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ *	Algorithm" in all material mentioning or referencing this software
+ *	or this function.
+ *
+ *	License is also granted to make and use derivative works provided
+ *	that such works are identified as "derived from the RSA Data
+ *	Security, Inc. MD5 Message-Digest Algorithm" in all material
+ *	mentioning or referencing the derived work.
+ *
+ *	RSA Data Security, Inc. makes no representations concerning either
+ *	the merchantability of this software or the suitability of this
+ *	software forany particular purpose. It is provided "as is"
+ *	without express or implied warranty of any kind.
+ *	These notices must be retained in any copies of any part of this
+ *	documentation and/or software.
+ */
+
+/*
+ *	Rotate ammounts used in the algorithm
+ */
+enum
+{
+	S11=	7,
+	S12=	12,
+	S13=	17,
+	S14=	22,
+
+	S21=	5,
+	S22=	9,
+	S23=	14,
+	S24=	20,
+
+	S31=	4,
+	S32=	11,
+	S33=	16,
+	S34=	23,
+
+	S41=	6,
+	S42=	10,
+	S43=	15,
+	S44=	21,
+};
+
+static u32int md5tab[] =
+{
+	/* round 1 */
+/*[0]*/	0xd76aa478,	
+	0xe8c7b756,	
+	0x242070db,	
+	0xc1bdceee,	
+	0xf57c0faf,	
+	0x4787c62a,	
+	0xa8304613,	
+	0xfd469501,	
+	0x698098d8,	
+	0x8b44f7af,	
+	0xffff5bb1,	
+	0x895cd7be,	
+	0x6b901122,	
+	0xfd987193,	
+	0xa679438e,	
+	0x49b40821,
+
+	/* round 2 */
+/*[16]*/0xf61e2562,	
+	0xc040b340,	
+	0x265e5a51,	
+	0xe9b6c7aa,	
+	0xd62f105d,	
+	 0x2441453,	
+	0xd8a1e681,	
+	0xe7d3fbc8,	
+	0x21e1cde6,	
+	0xc33707d6,	
+	0xf4d50d87,	
+	0x455a14ed,	
+	0xa9e3e905,	
+	0xfcefa3f8,	
+	0x676f02d9,	
+	0x8d2a4c8a,
+
+	/* round 3 */
+/*[32]*/0xfffa3942,	
+	0x8771f681,	
+	0x6d9d6122,	
+	0xfde5380c,	
+	0xa4beea44,	
+	0x4bdecfa9,	
+	0xf6bb4b60,	
+	0xbebfbc70,	
+	0x289b7ec6,	
+	0xeaa127fa,	
+	0xd4ef3085,	
+	 0x4881d05,	
+	0xd9d4d039,	
+	0xe6db99e5,	
+	0x1fa27cf8,	
+	0xc4ac5665,	
+
+	/* round 4 */
+/*[48]*/0xf4292244,	
+	0x432aff97,	
+	0xab9423a7,	
+	0xfc93a039,	
+	0x655b59c3,	
+	0x8f0ccc92,	
+	0xffeff47d,	
+	0x85845dd1,	
+	0x6fa87e4f,	
+	0xfe2ce6e0,	
+	0xa3014314,	
+	0x4e0811a1,	
+	0xf7537e82,	
+	0xbd3af235,	
+	0x2ad7d2bb,	
+	0xeb86d391,	
+};
+
+static void decode(u32int*, uchar*, ulong);
+extern void _md5block(uchar *p, ulong len, u32int *s);
+
+void
+_md5block(uchar *p, ulong len, u32int *s)
+{
+	u32int a, b, c, d, sh;
+	u32int *t;
+	uchar *end;
+	u32int x[16];
+
+	for(end = p+len; p < end; p += 64){
+		a = s[0];
+		b = s[1];
+		c = s[2];
+		d = s[3];
+
+		decode(x, p, 64);
+	
+		t = md5tab;
+		sh = 0;
+		for(; sh != 16; t += 4){
+			a += ((c ^ d) & b) ^ d;
+			a += x[sh] + t[0];
+			a = (a << S11) | (a >> (32 - S11));
+			a += b;
+
+			d += ((b ^ c) & a) ^ c;
+			d += x[sh + 1] + t[1];
+			d = (d << S12) | (d >> (32 - S12));
+			d += a;
+
+			c += ((a ^ b) & d) ^ b;
+			c += x[sh + 2] + t[2];
+			c = (c << S13) | (c >> (32 - S13));
+			c += d;
+
+			b += ((d ^ a) & c) ^ a;
+			b += x[sh + 3] + t[3];
+			b = (b << S14) | (b >> (32 - S14));
+			b += c;
+
+			sh += 4;
+		}
+		sh = 1;
+		for(; sh != 1+20*4; t += 4){
+			a += ((b ^ c) & d) ^ c;
+			a += x[sh & 0xf] + t[0];
+			a = (a << S21) | (a >> (32 - S21));
+			a += b;
+
+			d += ((a ^ b) & c) ^ b;
+			d += x[(sh + 5) & 0xf] + t[1];
+			d = (d << S22) | (d >> (32 - S22));
+			d += a;
+
+			c += ((d ^ a) & b) ^ a;
+			c += x[(sh + 10) & 0xf] + t[2];
+			c = (c << S23) | (c >> (32 - S23));
+			c += d;
+
+			b += ((c ^ d) & a) ^ d;
+			b += x[(sh + 15) & 0xf] + t[3];
+			b = (b << S24) | (b >> (32 - S24));
+			b += c;
+
+			sh += 20;
+		}
+		sh = 5;
+		for(; sh != 5+12*4; t += 4){
+			a += b ^ c ^ d;
+			a += x[sh & 0xf] + t[0];
+			a = (a << S31) | (a >> (32 - S31));
+			a += b;
+
+			d += a ^ b ^ c;
+			d += x[(sh + 3) & 0xf] + t[1];
+			d = (d << S32) | (d >> (32 - S32));
+			d += a;
+
+			c += d ^ a ^ b;
+			c += x[(sh + 6) & 0xf] + t[2];
+			c = (c << S33) | (c >> (32 - S33));
+			c += d;
+
+			b += c ^ d ^ a;
+			b += x[(sh + 9) & 0xf] + t[3];
+			b = (b << S34) | (b >> (32 - S34));
+			b += c;
+
+			sh += 12;
+		}
+		sh = 0;
+		for(; sh != 28*4; t += 4){
+			a += c ^ (b | ~d);
+			a += x[sh & 0xf] + t[0];
+			a = (a << S41) | (a >> (32 - S41));
+			a += b;
+
+			d += b ^ (a | ~c);
+			d += x[(sh + 7) & 0xf] + t[1];
+			d = (d << S42) | (d >> (32 - S42));
+			d += a;
+
+			c += a ^ (d | ~b);
+			c += x[(sh + 14) & 0xf] + t[2];
+			c = (c << S43) | (c >> (32 - S43));
+			c += d;
+
+			b += d ^ (c | ~a);
+			b += x[(sh + 21) & 0xf] + t[3];
+			b = (b << S44) | (b >> (32 - S44));
+			b += c;
+
+			sh += 28;
+		}
+
+		s[0] += a;
+		s[1] += b;
+		s[2] += c;
+		s[3] += d;
+	}
+}
+
+/*
+ *	decodes input (uchar) into output (u32int). Assumes len is
+ *	a multiple of 4.
+ */
+static void
+decode(u32int *output, uchar *input, ulong len)
+{
+	uchar *e;
+
+	for(e = input+len; input < e; input += 4)
+		*output++ = input[0] | (input[1] << 8) |
+			(input[2] << 16) | (input[3] << 24);
+}

+ 189 - 0
sys/src/cmd/unix/drawterm/posix-mips/sha1block.c

@@ -0,0 +1,189 @@
+#include <u.h>
+#include <libc.h>
+#include <libsec.h>
+
+void
+_sha1block(uchar *p, ulong len, u32int *s)
+{
+	u32int a, b, c, d, e, x;
+	uchar *end;
+	u32int *wp, *wend;
+	u32int w[80];
+
+	/* at this point, we have a multiple of 64 bytes */
+	for(end = p+len; p < end;){
+		a = s[0];
+		b = s[1];
+		c = s[2];
+		d = s[3];
+		e = s[4];
+
+		wend = w + 15;
+		for(wp = w; wp < wend; wp += 5){
+			wp[0] = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0x5a827999 + (((c^d)&b)^d);
+			b = (b<<30)|(b>>2);
+
+			wp[1] = (p[4]<<24) | (p[5]<<16) | (p[6]<<8) | p[7];
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0x5a827999 + (((b^c)&a)^c);
+			a = (a<<30)|(a>>2);
+
+			wp[2] = (p[8]<<24) | (p[9]<<16) | (p[10]<<8) | p[11];
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0x5a827999 + (((a^b)&e)^b);
+			e = (e<<30)|(e>>2);
+
+			wp[3] = (p[12]<<24) | (p[13]<<16) | (p[14]<<8) | p[15];
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0x5a827999 + (((e^a)&d)^a);
+			d = (d<<30)|(d>>2);
+
+			wp[4] = (p[16]<<24) | (p[17]<<16) | (p[18]<<8) | p[19];
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0x5a827999 + (((d^e)&c)^e);
+			c = (c<<30)|(c>>2);
+			
+			p += 20;
+		}
+
+		wp[0] = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
+		e += ((a<<5) | (a>>27)) + wp[0];
+		e += 0x5a827999 + (((c^d)&b)^d);
+		b = (b<<30)|(b>>2);
+
+		x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+		wp[1] = (x<<1) | (x>>31);
+		d += ((e<<5) | (e>>27)) + wp[1];
+		d += 0x5a827999 + (((b^c)&a)^c);
+		a = (a<<30)|(a>>2);
+
+		x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+		wp[2] = (x<<1) | (x>>31);
+		c += ((d<<5) | (d>>27)) + wp[2];
+		c += 0x5a827999 + (((a^b)&e)^b);
+		e = (e<<30)|(e>>2);
+
+		x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+		wp[3] = (x<<1) | (x>>31);
+		b += ((c<<5) | (c>>27)) + wp[3];
+		b += 0x5a827999 + (((e^a)&d)^a);
+		d = (d<<30)|(d>>2);
+
+		x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+		wp[4] = (x<<1) | (x>>31);
+		a += ((b<<5) | (b>>27)) + wp[4];
+		a += 0x5a827999 + (((d^e)&c)^e);
+		c = (c<<30)|(c>>2);
+
+		wp += 5;
+		p += 4;
+
+		wend = w + 40;
+		for(; wp < wend; wp += 5){
+			x = wp[-3] ^ wp[-8] ^ wp[-14] ^ wp[-16];
+			wp[0] = (x<<1) | (x>>31);
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0x6ed9eba1 + (b^c^d);
+			b = (b<<30)|(b>>2);
+
+			x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+			wp[1] = (x<<1) | (x>>31);
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0x6ed9eba1 + (a^b^c);
+			a = (a<<30)|(a>>2);
+
+			x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+			wp[2] = (x<<1) | (x>>31);
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0x6ed9eba1 + (e^a^b);
+			e = (e<<30)|(e>>2);
+
+			x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+			wp[3] = (x<<1) | (x>>31);
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0x6ed9eba1 + (d^e^a);
+			d = (d<<30)|(d>>2);
+
+			x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+			wp[4] = (x<<1) | (x>>31);
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0x6ed9eba1 + (c^d^e);
+			c = (c<<30)|(c>>2);
+		}
+
+		wend = w + 60;
+		for(; wp < wend; wp += 5){
+			x = wp[-3] ^ wp[-8] ^ wp[-14] ^ wp[-16];
+			wp[0] = (x<<1) | (x>>31);
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0x8f1bbcdc + ((b&c)|((b|c)&d));
+			b = (b<<30)|(b>>2);
+
+			x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+			wp[1] = (x<<1) | (x>>31);
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0x8f1bbcdc + ((a&b)|((a|b)&c));
+			a = (a<<30)|(a>>2);
+
+			x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+			wp[2] = (x<<1) | (x>>31);
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0x8f1bbcdc + ((e&a)|((e|a)&b));
+			e = (e<<30)|(e>>2);
+
+			x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+			wp[3] = (x<<1) | (x>>31);
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0x8f1bbcdc + ((d&e)|((d|e)&a));
+			d = (d<<30)|(d>>2);
+
+			x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+			wp[4] = (x<<1) | (x>>31);
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0x8f1bbcdc + ((c&d)|((c|d)&e));
+			c = (c<<30)|(c>>2);
+		}
+
+		wend = w + 80;
+		for(; wp < wend; wp += 5){
+			x = wp[-3] ^ wp[-8] ^ wp[-14] ^ wp[-16];
+			wp[0] = (x<<1) | (x>>31);
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0xca62c1d6 + (b^c^d);
+			b = (b<<30)|(b>>2);
+
+			x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+			wp[1] = (x<<1) | (x>>31);
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0xca62c1d6 + (a^b^c);
+			a = (a<<30)|(a>>2);
+
+			x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+			wp[2] = (x<<1) | (x>>31);
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0xca62c1d6 + (e^a^b);
+			e = (e<<30)|(e>>2);
+
+			x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+			wp[3] = (x<<1) | (x>>31);
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0xca62c1d6 + (d^e^a);
+			d = (d<<30)|(d>>2);
+
+			x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+			wp[4] = (x<<1) | (x>>31);
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0xca62c1d6 + (c^d^e);
+			c = (c<<30)|(c>>2);
+		}
+
+		/* save state */
+		s[0] += a;
+		s[1] += b;
+		s[2] += c;
+		s[3] += d;
+		s[4] += e;
+	}
+}

+ 21 - 0
sys/src/cmd/unix/drawterm/posix-mips/tas.s

@@ -0,0 +1,21 @@
+#include <sys/regdef.h>
+#include <sys/asm.h>
+
+.globl tas
+.ent tas 2
+
+tas:
+.set noreorder
+1:
+	ori	t1, zero, 12345	/* t1 = 12345 */
+	ll	t0, (a0)		/* t0 = *a0 */
+	sc	t1, (a0)		/* *a0 = t1 if *a0 hasn't changed; t1=success */
+	beq	t1, zero, 1b		/* repeat if *a0 did change */
+	nop
+
+	j $31				/* return */
+	or	v0, t0, zero		/* set return value on way out */
+
+.set reorder
+.end tas
+

+ 2 - 2
sys/src/cmd/unix/drawterm/posix-power/getcallerpc.c

@@ -1,8 +1,8 @@
 #include "u.h"
 #include "libc.h"
 
-ulong
+uintptr
 getcallerpc(void *a)
 {
-	return ((ulong*)a)[-1];
+	return ((uintptr*)a)[-1];
 }

+ 26 - 0
sys/src/cmd/unix/drawterm/posix-sun4u/Makefile

@@ -0,0 +1,26 @@
+ROOT=..
+include ../Make.config
+LIB=../libmachdep.a
+
+OFILES=\
+	getcallerpc.$O\
+	md5block.$O\
+	sha1block.$O\
+	tas.$O
+
+default: $(LIB)
+$(LIB): $(OFILES)
+	$(AR) r $(LIB) $(OFILES)
+	$(RANLIB) $(LIB)
+
+%.$O: %.c
+	$(CC) $(CFLAGS) $*.c
+
+%.$O: %.s
+	$(AS) -o $*.$O $*.s
+
+%.s: %.spp
+	cpp $*.spp >$*.s
+
+
+

+ 9 - 0
sys/src/cmd/unix/drawterm/posix-sun4u/getcallerpc.c

@@ -0,0 +1,9 @@
+#include "u.h"
+#include "libc.h"
+
+ulong
+getcallerpc(void *a)
+{
+	return ((ulong*)a)[-1];
+}
+

+ 268 - 0
sys/src/cmd/unix/drawterm/posix-sun4u/md5block.c

@@ -0,0 +1,268 @@
+#include <u.h>
+#include <libc.h>
+#include <libsec.h>
+
+/*
+ *  rfc1321 requires that I include this.  The code is new.  The constants
+ *  all come from the rfc (hence the copyright).  We trade a table for the
+ *  macros in rfc.  The total size is a lot less. -- presotto
+ *
+ *	Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+ *	rights reserved.
+ *
+ *	License to copy and use this software is granted provided that it
+ *	is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ *	Algorithm" in all material mentioning or referencing this software
+ *	or this function.
+ *
+ *	License is also granted to make and use derivative works provided
+ *	that such works are identified as "derived from the RSA Data
+ *	Security, Inc. MD5 Message-Digest Algorithm" in all material
+ *	mentioning or referencing the derived work.
+ *
+ *	RSA Data Security, Inc. makes no representations concerning either
+ *	the merchantability of this software or the suitability of this
+ *	software forany particular purpose. It is provided "as is"
+ *	without express or implied warranty of any kind.
+ *	These notices must be retained in any copies of any part of this
+ *	documentation and/or software.
+ */
+
+/*
+ *	Rotate ammounts used in the algorithm
+ */
+enum
+{
+	S11=	7,
+	S12=	12,
+	S13=	17,
+	S14=	22,
+
+	S21=	5,
+	S22=	9,
+	S23=	14,
+	S24=	20,
+
+	S31=	4,
+	S32=	11,
+	S33=	16,
+	S34=	23,
+
+	S41=	6,
+	S42=	10,
+	S43=	15,
+	S44=	21,
+};
+
+static u32int md5tab[] =
+{
+	/* round 1 */
+/*[0]*/	0xd76aa478,	
+	0xe8c7b756,	
+	0x242070db,	
+	0xc1bdceee,	
+	0xf57c0faf,	
+	0x4787c62a,	
+	0xa8304613,	
+	0xfd469501,	
+	0x698098d8,	
+	0x8b44f7af,	
+	0xffff5bb1,	
+	0x895cd7be,	
+	0x6b901122,	
+	0xfd987193,	
+	0xa679438e,	
+	0x49b40821,
+
+	/* round 2 */
+/*[16]*/0xf61e2562,	
+	0xc040b340,	
+	0x265e5a51,	
+	0xe9b6c7aa,	
+	0xd62f105d,	
+	 0x2441453,	
+	0xd8a1e681,	
+	0xe7d3fbc8,	
+	0x21e1cde6,	
+	0xc33707d6,	
+	0xf4d50d87,	
+	0x455a14ed,	
+	0xa9e3e905,	
+	0xfcefa3f8,	
+	0x676f02d9,	
+	0x8d2a4c8a,
+
+	/* round 3 */
+/*[32]*/0xfffa3942,	
+	0x8771f681,	
+	0x6d9d6122,	
+	0xfde5380c,	
+	0xa4beea44,	
+	0x4bdecfa9,	
+	0xf6bb4b60,	
+	0xbebfbc70,	
+	0x289b7ec6,	
+	0xeaa127fa,	
+	0xd4ef3085,	
+	 0x4881d05,	
+	0xd9d4d039,	
+	0xe6db99e5,	
+	0x1fa27cf8,	
+	0xc4ac5665,	
+
+	/* round 4 */
+/*[48]*/0xf4292244,	
+	0x432aff97,	
+	0xab9423a7,	
+	0xfc93a039,	
+	0x655b59c3,	
+	0x8f0ccc92,	
+	0xffeff47d,	
+	0x85845dd1,	
+	0x6fa87e4f,	
+	0xfe2ce6e0,	
+	0xa3014314,	
+	0x4e0811a1,	
+	0xf7537e82,	
+	0xbd3af235,	
+	0x2ad7d2bb,	
+	0xeb86d391,	
+};
+
+static void decode(u32int*, uchar*, ulong);
+extern void _md5block(uchar *p, ulong len, u32int *s);
+
+void
+_md5block(uchar *p, ulong len, u32int *s)
+{
+	u32int a, b, c, d, sh;
+	u32int *t;
+	uchar *end;
+	u32int x[16];
+
+	for(end = p+len; p < end; p += 64){
+		a = s[0];
+		b = s[1];
+		c = s[2];
+		d = s[3];
+
+		decode(x, p, 64);
+	
+		t = md5tab;
+		sh = 0;
+		for(; sh != 16; t += 4){
+			a += ((c ^ d) & b) ^ d;
+			a += x[sh] + t[0];
+			a = (a << S11) | (a >> (32 - S11));
+			a += b;
+
+			d += ((b ^ c) & a) ^ c;
+			d += x[sh + 1] + t[1];
+			d = (d << S12) | (d >> (32 - S12));
+			d += a;
+
+			c += ((a ^ b) & d) ^ b;
+			c += x[sh + 2] + t[2];
+			c = (c << S13) | (c >> (32 - S13));
+			c += d;
+
+			b += ((d ^ a) & c) ^ a;
+			b += x[sh + 3] + t[3];
+			b = (b << S14) | (b >> (32 - S14));
+			b += c;
+
+			sh += 4;
+		}
+		sh = 1;
+		for(; sh != 1+20*4; t += 4){
+			a += ((b ^ c) & d) ^ c;
+			a += x[sh & 0xf] + t[0];
+			a = (a << S21) | (a >> (32 - S21));
+			a += b;
+
+			d += ((a ^ b) & c) ^ b;
+			d += x[(sh + 5) & 0xf] + t[1];
+			d = (d << S22) | (d >> (32 - S22));
+			d += a;
+
+			c += ((d ^ a) & b) ^ a;
+			c += x[(sh + 10) & 0xf] + t[2];
+			c = (c << S23) | (c >> (32 - S23));
+			c += d;
+
+			b += ((c ^ d) & a) ^ d;
+			b += x[(sh + 15) & 0xf] + t[3];
+			b = (b << S24) | (b >> (32 - S24));
+			b += c;
+
+			sh += 20;
+		}
+		sh = 5;
+		for(; sh != 5+12*4; t += 4){
+			a += b ^ c ^ d;
+			a += x[sh & 0xf] + t[0];
+			a = (a << S31) | (a >> (32 - S31));
+			a += b;
+
+			d += a ^ b ^ c;
+			d += x[(sh + 3) & 0xf] + t[1];
+			d = (d << S32) | (d >> (32 - S32));
+			d += a;
+
+			c += d ^ a ^ b;
+			c += x[(sh + 6) & 0xf] + t[2];
+			c = (c << S33) | (c >> (32 - S33));
+			c += d;
+
+			b += c ^ d ^ a;
+			b += x[(sh + 9) & 0xf] + t[3];
+			b = (b << S34) | (b >> (32 - S34));
+			b += c;
+
+			sh += 12;
+		}
+		sh = 0;
+		for(; sh != 28*4; t += 4){
+			a += c ^ (b | ~d);
+			a += x[sh & 0xf] + t[0];
+			a = (a << S41) | (a >> (32 - S41));
+			a += b;
+
+			d += b ^ (a | ~c);
+			d += x[(sh + 7) & 0xf] + t[1];
+			d = (d << S42) | (d >> (32 - S42));
+			d += a;
+
+			c += a ^ (d | ~b);
+			c += x[(sh + 14) & 0xf] + t[2];
+			c = (c << S43) | (c >> (32 - S43));
+			c += d;
+
+			b += d ^ (c | ~a);
+			b += x[(sh + 21) & 0xf] + t[3];
+			b = (b << S44) | (b >> (32 - S44));
+			b += c;
+
+			sh += 28;
+		}
+
+		s[0] += a;
+		s[1] += b;
+		s[2] += c;
+		s[3] += d;
+	}
+}
+
+/*
+ *	decodes input (uchar) into output (u32int). Assumes len is
+ *	a multiple of 4.
+ */
+static void
+decode(u32int *output, uchar *input, ulong len)
+{
+	uchar *e;
+
+	for(e = input+len; input < e; input += 4)
+		*output++ = input[0] | (input[1] << 8) |
+			(input[2] << 16) | (input[3] << 24);
+}

+ 189 - 0
sys/src/cmd/unix/drawterm/posix-sun4u/sha1block.c

@@ -0,0 +1,189 @@
+#include <u.h>
+#include <libc.h>
+#include <libsec.h>
+
+void
+_sha1block(uchar *p, ulong len, u32int *s)
+{
+	u32int a, b, c, d, e, x;
+	uchar *end;
+	u32int *wp, *wend;
+	u32int w[80];
+
+	/* at this point, we have a multiple of 64 bytes */
+	for(end = p+len; p < end;){
+		a = s[0];
+		b = s[1];
+		c = s[2];
+		d = s[3];
+		e = s[4];
+
+		wend = w + 15;
+		for(wp = w; wp < wend; wp += 5){
+			wp[0] = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0x5a827999 + (((c^d)&b)^d);
+			b = (b<<30)|(b>>2);
+
+			wp[1] = (p[4]<<24) | (p[5]<<16) | (p[6]<<8) | p[7];
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0x5a827999 + (((b^c)&a)^c);
+			a = (a<<30)|(a>>2);
+
+			wp[2] = (p[8]<<24) | (p[9]<<16) | (p[10]<<8) | p[11];
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0x5a827999 + (((a^b)&e)^b);
+			e = (e<<30)|(e>>2);
+
+			wp[3] = (p[12]<<24) | (p[13]<<16) | (p[14]<<8) | p[15];
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0x5a827999 + (((e^a)&d)^a);
+			d = (d<<30)|(d>>2);
+
+			wp[4] = (p[16]<<24) | (p[17]<<16) | (p[18]<<8) | p[19];
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0x5a827999 + (((d^e)&c)^e);
+			c = (c<<30)|(c>>2);
+			
+			p += 20;
+		}
+
+		wp[0] = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
+		e += ((a<<5) | (a>>27)) + wp[0];
+		e += 0x5a827999 + (((c^d)&b)^d);
+		b = (b<<30)|(b>>2);
+
+		x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+		wp[1] = (x<<1) | (x>>31);
+		d += ((e<<5) | (e>>27)) + wp[1];
+		d += 0x5a827999 + (((b^c)&a)^c);
+		a = (a<<30)|(a>>2);
+
+		x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+		wp[2] = (x<<1) | (x>>31);
+		c += ((d<<5) | (d>>27)) + wp[2];
+		c += 0x5a827999 + (((a^b)&e)^b);
+		e = (e<<30)|(e>>2);
+
+		x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+		wp[3] = (x<<1) | (x>>31);
+		b += ((c<<5) | (c>>27)) + wp[3];
+		b += 0x5a827999 + (((e^a)&d)^a);
+		d = (d<<30)|(d>>2);
+
+		x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+		wp[4] = (x<<1) | (x>>31);
+		a += ((b<<5) | (b>>27)) + wp[4];
+		a += 0x5a827999 + (((d^e)&c)^e);
+		c = (c<<30)|(c>>2);
+
+		wp += 5;
+		p += 4;
+
+		wend = w + 40;
+		for(; wp < wend; wp += 5){
+			x = wp[-3] ^ wp[-8] ^ wp[-14] ^ wp[-16];
+			wp[0] = (x<<1) | (x>>31);
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0x6ed9eba1 + (b^c^d);
+			b = (b<<30)|(b>>2);
+
+			x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+			wp[1] = (x<<1) | (x>>31);
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0x6ed9eba1 + (a^b^c);
+			a = (a<<30)|(a>>2);
+
+			x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+			wp[2] = (x<<1) | (x>>31);
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0x6ed9eba1 + (e^a^b);
+			e = (e<<30)|(e>>2);
+
+			x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+			wp[3] = (x<<1) | (x>>31);
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0x6ed9eba1 + (d^e^a);
+			d = (d<<30)|(d>>2);
+
+			x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+			wp[4] = (x<<1) | (x>>31);
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0x6ed9eba1 + (c^d^e);
+			c = (c<<30)|(c>>2);
+		}
+
+		wend = w + 60;
+		for(; wp < wend; wp += 5){
+			x = wp[-3] ^ wp[-8] ^ wp[-14] ^ wp[-16];
+			wp[0] = (x<<1) | (x>>31);
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0x8f1bbcdc + ((b&c)|((b|c)&d));
+			b = (b<<30)|(b>>2);
+
+			x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+			wp[1] = (x<<1) | (x>>31);
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0x8f1bbcdc + ((a&b)|((a|b)&c));
+			a = (a<<30)|(a>>2);
+
+			x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+			wp[2] = (x<<1) | (x>>31);
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0x8f1bbcdc + ((e&a)|((e|a)&b));
+			e = (e<<30)|(e>>2);
+
+			x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+			wp[3] = (x<<1) | (x>>31);
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0x8f1bbcdc + ((d&e)|((d|e)&a));
+			d = (d<<30)|(d>>2);
+
+			x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+			wp[4] = (x<<1) | (x>>31);
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0x8f1bbcdc + ((c&d)|((c|d)&e));
+			c = (c<<30)|(c>>2);
+		}
+
+		wend = w + 80;
+		for(; wp < wend; wp += 5){
+			x = wp[-3] ^ wp[-8] ^ wp[-14] ^ wp[-16];
+			wp[0] = (x<<1) | (x>>31);
+			e += ((a<<5) | (a>>27)) + wp[0];
+			e += 0xca62c1d6 + (b^c^d);
+			b = (b<<30)|(b>>2);
+
+			x = wp[-2] ^ wp[-7] ^ wp[-13] ^ wp[-15];
+			wp[1] = (x<<1) | (x>>31);
+			d += ((e<<5) | (e>>27)) + wp[1];
+			d += 0xca62c1d6 + (a^b^c);
+			a = (a<<30)|(a>>2);
+
+			x = wp[-1] ^ wp[-6] ^ wp[-12] ^ wp[-14];
+			wp[2] = (x<<1) | (x>>31);
+			c += ((d<<5) | (d>>27)) + wp[2];
+			c += 0xca62c1d6 + (e^a^b);
+			e = (e<<30)|(e>>2);
+
+			x = wp[0] ^ wp[-5] ^ wp[-11] ^ wp[-13];
+			wp[3] = (x<<1) | (x>>31);
+			b += ((c<<5) | (c>>27)) + wp[3];
+			b += 0xca62c1d6 + (d^e^a);
+			d = (d<<30)|(d>>2);
+
+			x = wp[1] ^ wp[-4] ^ wp[-10] ^ wp[-12];
+			wp[4] = (x<<1) | (x>>31);
+			a += ((b<<5) | (b>>27)) + wp[4];
+			a += 0xca62c1d6 + (c^d^e);
+			c = (c<<30)|(c>>2);
+		}
+
+		/* save state */
+		s[0] += a;
+		s[1] += b;
+		s[2] += c;
+		s[3] += d;
+		s[4] += e;
+	}
+}

+ 5 - 0
sys/src/cmd/unix/drawterm/posix-sun4u/tas.s

@@ -0,0 +1,5 @@
+.globl tas
+tas:
+	retl
+	ldstub [%o0], %o0
+

+ 2 - 2
sys/src/cmd/unix/drawterm/win32-386/getcallerpc.c

@@ -1,8 +1,8 @@
 #include "u.h"
 #include "libc.h"
 
-ulong
+uintptr
 getcallerpc(void *a)
 {
-	return ((ulong*)a)[-1];
+	return ((uintptr*)a)[-1];
 }