Browse Source

Plan 9 from Bell Labs 2004-12-04

David du Colombier 16 years ago
parent
commit
543ebf23ee

+ 18 - 17
dist/replica/_plan9.db

@@ -3450,7 +3450,7 @@ sys/include/html.h - 664 sys sys 1091904420 15220
 sys/include/httpd.h - 664 sys sys 1091904418 5771
 sys/include/ip.h - 664 sys sys 1089299185 2958
 sys/include/keyboard.h - 664 sys sys 1079577798 815
-sys/include/libc.h - 664 sys sys 1089299187 19463
+sys/include/libc.h - 664 sys sys 1102093062 19516
 sys/include/libsec.h - 664 sys sys 1084318867 9264
 sys/include/mach.h - 664 sys sys 1089313992 8164
 sys/include/memdraw.h - 664 sys sys 1091904419 5645
@@ -3460,7 +3460,7 @@ sys/include/mp.h - 664 sys sys 1014929065 4610
 sys/include/ndb.h - 664 sys sys 1091904429 4369
 sys/include/nfs3.h - 664 sys sys 1045589438 15082
 sys/include/plumb.h - 664 sys sys 1014929065 989
-sys/include/pool.h - 664 sys sys 1032058257 1156
+sys/include/pool.h - 664 sys sys 1102093074 1219
 sys/include/rdbg.h - 664 sys sys 1014929066 95
 sys/include/realtime.h - 664 sys sys 1037669237 869
 sys/include/regexp.h - 664 sys sys 1014929066 1308
@@ -4881,7 +4881,7 @@ sys/man/2/isalpharune - 664 sys sys 1015091523 1059
 sys/man/2/keyboard - 664 sys sys 950892860 2065
 sys/man/2/lock - 664 sys sys 1048643958 4692
 sys/man/2/mach - 664 sys sys 1080179298 7995
-sys/man/2/malloc - 664 sys sys 1101135773 4375
+sys/man/2/malloc - 664 sys sys 1102093069 4763
 sys/man/2/matrix - 664 sys sys 950892861 6090
 sys/man/2/memdraw - 664 sys sys 1040484074 10144
 sys/man/2/memlayer - 664 sys sys 1040484074 6963
@@ -4898,7 +4898,7 @@ sys/man/2/open - 664 sys sys 1015091524 3404
 sys/man/2/perror - 664 sys sys 944959696 1881
 sys/man/2/pipe - 664 sys sys 950892864 1587
 sys/man/2/plumb - 664 sys sys 1015091524 4816
-sys/man/2/pool - 664 sys sys 1017423720 8134
+sys/man/2/pool - 664 sys sys 1102093086 8574
 sys/man/2/postnote - 664 sys sys 944959695 790
 sys/man/2/prime - 664 sys sys 1063855709 1962
 sys/man/2/print - 664 sys sys 1046620831 8889
@@ -4976,7 +4976,7 @@ sys/man/3/segment - 664 sys sys 1017423721 2378
 sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
 sys/man/3/tls - 664 sys sys 1045501496 7018
-sys/man/3/uart - 664 sys sys 1068393771 1651
+sys/man/3/uart - 664 sys sys 1102093395 1710
 sys/man/3/usb - 664 sys sys 1063855746 6727
 sys/man/3/vga - 664 sys sys 1020356225 4827
 sys/man/4 - 20000000775 sys sys 1018581459 0
@@ -4999,7 +4999,7 @@ sys/man/4/ftpfs - 664 sys sys 1048285446 4327
 sys/man/4/import - 664 sys sys 1034195346 2204
 sys/man/4/iostats - 664 sys sys 959566568 1415
 sys/man/4/keyfs - 664 sys sys 1017251244 5003
-sys/man/4/kfs - 664 sys sys 1019058716 2159
+sys/man/4/kfs - 664 sys sys 1102088374 2164
 sys/man/4/lnfs - 664 sys sys 1073491345 1219
 sys/man/4/mntgen - 664 sys sys 1043680799 473
 sys/man/4/namespace - 664 sys sys 1018386777 6916
@@ -5121,7 +5121,7 @@ sys/man/8/ppp - 664 sys sys 1096036494 4424
 sys/man/8/prep - 664 sys sys 1079705872 13820
 sys/man/8/qer - 664 sys sys 1067723129 4909
 sys/man/8/reboot - 664 sys sys 969499895 414
-sys/man/8/replica - 664 sys sys 1021579979 6239
+sys/man/8/replica - 664 sys sys 1102088374 6295
 sys/man/8/rsa - 664 sys sys 1057955511 4628
 sys/man/8/scanmail - 664 sys sys 969499895 10803
 sys/man/8/scuzz - 664 sys sys 984709640 7916
@@ -5431,7 +5431,7 @@ sys/src/9/pc/sdata.c - 664 sys sys 1099487462 50970
 sys/src/9/pc/sdmylex.c - 664 sys sys 1071245460 27812
 sys/src/9/pc/sdscsi.c - 664 sys sys 1077033661 7487
 sys/src/9/pc/trap.c - 664 sys sys 1092080705 20458
-sys/src/9/pc/uarti8250.c - 664 sys sys 1067722686 13859
+sys/src/9/pc/uarti8250.c - 664 sys sys 1102093392 13917
 sys/src/9/pc/uartpci.c - 664 sys sys 1096379063 2891
 sys/src/9/pc/usb.h - 664 sys sys 1099760881 3650
 sys/src/9/pc/usbuhci.c - 664 sys sys 1099760881 30955
@@ -5463,7 +5463,7 @@ sys/src/9/pc/wavelan.c - 664 sys sys 1056299581 27253
 sys/src/9/pc/wavelan.h - 664 sys sys 1055700615 6151
 sys/src/9/port - 20000000775 sys sys 1018469625 0
 sys/src/9/port/alarm.c - 664 sys sys 1067722766 1426
-sys/src/9/port/alloc.c - 664 sys sys 1067722763 5329
+sys/src/9/port/alloc.c - 664 sys sys 1102093389 5645
 sys/src/9/port/allocb.c - 664 sys sys 1067722759 3200
 sys/src/9/port/auth.c - 664 sys sys 1055688251 2308
 sys/src/9/port/cache.c - 664 sys sys 1055688274 9241
@@ -5497,7 +5497,7 @@ sys/src/9/port/devsrv.c - 664 sys sys 1086406908 5198
 sys/src/9/port/devssl.c - 664 sys sys 1045063590 26100
 sys/src/9/port/devtinyfs.c - 664 sys sys 1015278339 15347
 sys/src/9/port/devtls.c - 664 sys sys 1086406907 45225
-sys/src/9/port/devuart.c - 664 sys sys 1077055016 11683
+sys/src/9/port/devuart.c - 664 sys sys 1102093393 12192
 sys/src/9/port/edf.c - 664 sys sys 1099760881 12742
 sys/src/9/port/edf.h - 664 sys sys 1084475128 1156
 sys/src/9/port/error.h - 664 sys sys 1055700517 2630
@@ -5525,9 +5525,9 @@ sys/src/9/port/netif.h - 664 sys sys 1066514947 2975
 sys/src/9/port/page.c - 664 sys sys 1055688510 8107
 sys/src/9/port/parse.c - 664 sys sys 1014931177 2026
 sys/src/9/port/pgrp.c - 664 sys sys 1072704671 3940
-sys/src/9/port/portclock.c - 664 sys sys 1084475128 4542
-sys/src/9/port/portdat.h - 664 sys sys 1091904422 22118
-sys/src/9/port/portfns.h - 664 sys sys 1091904430 11426
+sys/src/9/port/portclock.c - 664 sys sys 1102093397 4556
+sys/src/9/port/portdat.h - 664 sys sys 1102093399 22207
+sys/src/9/port/portfns.h - 664 sys sys 1102093388 11474
 sys/src/9/port/portmkfile - 664 sys sys 1091733856 2087
 sys/src/9/port/print.c - 664 sys sys 1014931178 227
 sys/src/9/port/proc.c - 664 sys sys 1099760501 28207
@@ -10919,7 +10919,7 @@ sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1015013150 1069
 sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1097901337 19565
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1064589597 1084
-sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1100893957 30201
+sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1102093207 30350
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1067722781 1111
 sys/src/cmd/upas/smtp/smtpd.y - 664 sys sys 1061836986 6949
 sys/src/cmd/upas/smtp/spam.c - 664 sys sys 1098803961 10231
@@ -10928,7 +10928,7 @@ sys/src/cmd/upas/unesc/mkfile - 664 sys sys 1075080255 164
 sys/src/cmd/upas/unesc/unesc.c - 664 sys sys 1075080255 789
 sys/src/cmd/upas/vf - 20000000775 sys sys 1015096796 0
 sys/src/cmd/upas/vf/mkfile - 664 sys sys 1064393881 241
-sys/src/cmd/upas/vf/vf.c - 664 sys sys 1087829630 17442
+sys/src/cmd/upas/vf/vf.c - 664 sys sys 1102093227 17450
 sys/src/cmd/usb - 20000000775 sys sys 1017802022 0
 sys/src/cmd/usb/audio - 20000000775 sys sys 1017802021 0
 sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1100568596 18166
@@ -11682,7 +11682,7 @@ sys/src/libc/port/lock.c - 664 sys sys 1014927398 493
 sys/src/libc/port/log.c - 664 sys sys 1014927398 1026
 sys/src/libc/port/lrand.c - 664 sys sys 1035832917 1109
 sys/src/libc/port/malloc.acid - 664 sys sys 1014927398 6227
-sys/src/libc/port/malloc.c - 664 sys sys 1014927398 5381
+sys/src/libc/port/malloc.c - 664 sys sys 1102093081 5697
 sys/src/libc/port/memccpy.c - 664 sys sys 1014927398 216
 sys/src/libc/port/memchr.c - 664 sys sys 1014927398 182
 sys/src/libc/port/memcmp.c - 664 sys sys 1014927398 259
@@ -11698,7 +11698,7 @@ sys/src/libc/port/netmkaddr.c - 664 sys sys 1014927400 863
 sys/src/libc/port/nrand.c - 664 sys sys 1035832917 191
 sys/src/libc/port/ntruerand.c - 664 sys sys 1014927400 371
 sys/src/libc/port/perror.c - 664 sys sys 1014927400 199
-sys/src/libc/port/pool.c - 664 sys sys 1067719044 27913
+sys/src/libc/port/pool.c - 664 sys sys 1102093118 30853
 sys/src/libc/port/pow.c - 664 sys sys 1014927401 965
 sys/src/libc/port/pow10.c - 664 sys sys 1014927401 1946
 sys/src/libc/port/profile.c - 664 sys sys 1067719045 5495
@@ -12394,3 +12394,4 @@ usr/glenda/lib/profile - 664 glenda glenda 1021580005 847
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+sys/src/9/port/page.c - 664 sys sys 1102133425 8281

+ 18 - 18
dist/replica/plan9.db

@@ -3450,7 +3450,7 @@ sys/include/html.h - 664 sys sys 1091904420 15220
 sys/include/httpd.h - 664 sys sys 1091904418 5771
 sys/include/ip.h - 664 sys sys 1089299185 2958
 sys/include/keyboard.h - 664 sys sys 1079577798 815
-sys/include/libc.h - 664 sys sys 1089299187 19463
+sys/include/libc.h - 664 sys sys 1102093062 19516
 sys/include/libsec.h - 664 sys sys 1084318867 9264
 sys/include/mach.h - 664 sys sys 1089313992 8164
 sys/include/memdraw.h - 664 sys sys 1091904419 5645
@@ -3460,7 +3460,7 @@ sys/include/mp.h - 664 sys sys 1014929065 4610
 sys/include/ndb.h - 664 sys sys 1091904429 4369
 sys/include/nfs3.h - 664 sys sys 1045589438 15082
 sys/include/plumb.h - 664 sys sys 1014929065 989
-sys/include/pool.h - 664 sys sys 1032058257 1156
+sys/include/pool.h - 664 sys sys 1102093074 1219
 sys/include/rdbg.h - 664 sys sys 1014929066 95
 sys/include/realtime.h - 664 sys sys 1037669237 869
 sys/include/regexp.h - 664 sys sys 1014929066 1308
@@ -4881,7 +4881,7 @@ sys/man/2/isalpharune - 664 sys sys 1015091523 1059
 sys/man/2/keyboard - 664 sys sys 950892860 2065
 sys/man/2/lock - 664 sys sys 1048643958 4692
 sys/man/2/mach - 664 sys sys 1080179298 7995
-sys/man/2/malloc - 664 sys sys 1101135773 4375
+sys/man/2/malloc - 664 sys sys 1102093069 4763
 sys/man/2/matrix - 664 sys sys 950892861 6090
 sys/man/2/memdraw - 664 sys sys 1040484074 10144
 sys/man/2/memlayer - 664 sys sys 1040484074 6963
@@ -4898,7 +4898,7 @@ sys/man/2/open - 664 sys sys 1015091524 3404
 sys/man/2/perror - 664 sys sys 944959696 1881
 sys/man/2/pipe - 664 sys sys 950892864 1587
 sys/man/2/plumb - 664 sys sys 1015091524 4816
-sys/man/2/pool - 664 sys sys 1017423720 8134
+sys/man/2/pool - 664 sys sys 1102093086 8574
 sys/man/2/postnote - 664 sys sys 944959695 790
 sys/man/2/prime - 664 sys sys 1063855709 1962
 sys/man/2/print - 664 sys sys 1046620831 8889
@@ -4976,7 +4976,7 @@ sys/man/3/segment - 664 sys sys 1017423721 2378
 sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
 sys/man/3/tls - 664 sys sys 1045501496 7018
-sys/man/3/uart - 664 sys sys 1068393771 1651
+sys/man/3/uart - 664 sys sys 1102093395 1710
 sys/man/3/usb - 664 sys sys 1063855746 6727
 sys/man/3/vga - 664 sys sys 1020356225 4827
 sys/man/4 - 20000000775 sys sys 1018581459 0
@@ -4999,7 +4999,7 @@ sys/man/4/ftpfs - 664 sys sys 1048285446 4327
 sys/man/4/import - 664 sys sys 1034195346 2204
 sys/man/4/iostats - 664 sys sys 959566568 1415
 sys/man/4/keyfs - 664 sys sys 1017251244 5003
-sys/man/4/kfs - 664 sys sys 1019058716 2159
+sys/man/4/kfs - 664 sys sys 1102088374 2164
 sys/man/4/lnfs - 664 sys sys 1073491345 1219
 sys/man/4/mntgen - 664 sys sys 1043680799 473
 sys/man/4/namespace - 664 sys sys 1018386777 6916
@@ -5121,7 +5121,7 @@ sys/man/8/ppp - 664 sys sys 1096036494 4424
 sys/man/8/prep - 664 sys sys 1079705872 13820
 sys/man/8/qer - 664 sys sys 1067723129 4909
 sys/man/8/reboot - 664 sys sys 969499895 414
-sys/man/8/replica - 664 sys sys 1021579979 6239
+sys/man/8/replica - 664 sys sys 1102088374 6295
 sys/man/8/rsa - 664 sys sys 1057955511 4628
 sys/man/8/scanmail - 664 sys sys 969499895 10803
 sys/man/8/scuzz - 664 sys sys 984709640 7916
@@ -5431,7 +5431,7 @@ sys/src/9/pc/sdata.c - 664 sys sys 1099487462 50970
 sys/src/9/pc/sdmylex.c - 664 sys sys 1071245460 27812
 sys/src/9/pc/sdscsi.c - 664 sys sys 1077033661 7487
 sys/src/9/pc/trap.c - 664 sys sys 1092080705 20458
-sys/src/9/pc/uarti8250.c - 664 sys sys 1067722686 13859
+sys/src/9/pc/uarti8250.c - 664 sys sys 1102093392 13917
 sys/src/9/pc/uartpci.c - 664 sys sys 1096379063 2891
 sys/src/9/pc/usb.h - 664 sys sys 1099760881 3650
 sys/src/9/pc/usbuhci.c - 664 sys sys 1099760881 30955
@@ -5463,7 +5463,7 @@ sys/src/9/pc/wavelan.c - 664 sys sys 1056299581 27253
 sys/src/9/pc/wavelan.h - 664 sys sys 1055700615 6151
 sys/src/9/port - 20000000775 sys sys 1018469625 0
 sys/src/9/port/alarm.c - 664 sys sys 1067722766 1426
-sys/src/9/port/alloc.c - 664 sys sys 1067722763 5329
+sys/src/9/port/alloc.c - 664 sys sys 1102093389 5645
 sys/src/9/port/allocb.c - 664 sys sys 1067722759 3200
 sys/src/9/port/auth.c - 664 sys sys 1055688251 2308
 sys/src/9/port/cache.c - 664 sys sys 1055688274 9241
@@ -5497,7 +5497,7 @@ sys/src/9/port/devsrv.c - 664 sys sys 1086406908 5198
 sys/src/9/port/devssl.c - 664 sys sys 1045063590 26100
 sys/src/9/port/devtinyfs.c - 664 sys sys 1015278339 15347
 sys/src/9/port/devtls.c - 664 sys sys 1086406907 45225
-sys/src/9/port/devuart.c - 664 sys sys 1077055016 11683
+sys/src/9/port/devuart.c - 664 sys sys 1102093393 12192
 sys/src/9/port/edf.c - 664 sys sys 1099760881 12742
 sys/src/9/port/edf.h - 664 sys sys 1084475128 1156
 sys/src/9/port/error.h - 664 sys sys 1055700517 2630
@@ -5522,12 +5522,12 @@ sys/src/9/port/mksystab - 664 sys sys 1014931176 783
 sys/src/9/port/mul64fract.c - 664 sys sys 1071671674 867
 sys/src/9/port/netif.c - 664 sys sys 1066514951 13421
 sys/src/9/port/netif.h - 664 sys sys 1066514947 2975
-sys/src/9/port/page.c - 664 sys sys 1055688510 8107
+sys/src/9/port/page.c - 664 sys sys 1102133425 8281
 sys/src/9/port/parse.c - 664 sys sys 1014931177 2026
 sys/src/9/port/pgrp.c - 664 sys sys 1072704671 3940
-sys/src/9/port/portclock.c - 664 sys sys 1084475128 4542
-sys/src/9/port/portdat.h - 664 sys sys 1091904422 22118
-sys/src/9/port/portfns.h - 664 sys sys 1091904430 11426
+sys/src/9/port/portclock.c - 664 sys sys 1102093397 4556
+sys/src/9/port/portdat.h - 664 sys sys 1102093399 22207
+sys/src/9/port/portfns.h - 664 sys sys 1102093388 11474
 sys/src/9/port/portmkfile - 664 sys sys 1091733856 2087
 sys/src/9/port/print.c - 664 sys sys 1014931178 227
 sys/src/9/port/proc.c - 664 sys sys 1099760501 28207
@@ -10919,7 +10919,7 @@ sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1015013150 1069
 sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1097901337 19565
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1064589597 1084
-sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1100893957 30201
+sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1102093207 30350
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1067722781 1111
 sys/src/cmd/upas/smtp/smtpd.y - 664 sys sys 1061836986 6949
 sys/src/cmd/upas/smtp/spam.c - 664 sys sys 1098803961 10231
@@ -10928,7 +10928,7 @@ sys/src/cmd/upas/unesc/mkfile - 664 sys sys 1075080255 164
 sys/src/cmd/upas/unesc/unesc.c - 664 sys sys 1075080255 789
 sys/src/cmd/upas/vf - 20000000775 sys sys 1015096796 0
 sys/src/cmd/upas/vf/mkfile - 664 sys sys 1064393881 241
-sys/src/cmd/upas/vf/vf.c - 664 sys sys 1087829630 17442
+sys/src/cmd/upas/vf/vf.c - 664 sys sys 1102093227 17450
 sys/src/cmd/usb - 20000000775 sys sys 1017802022 0
 sys/src/cmd/usb/audio - 20000000775 sys sys 1017802021 0
 sys/src/cmd/usb/audio/audiofs.c - 664 sys sys 1100568596 18166
@@ -11682,7 +11682,7 @@ sys/src/libc/port/lock.c - 664 sys sys 1014927398 493
 sys/src/libc/port/log.c - 664 sys sys 1014927398 1026
 sys/src/libc/port/lrand.c - 664 sys sys 1035832917 1109
 sys/src/libc/port/malloc.acid - 664 sys sys 1014927398 6227
-sys/src/libc/port/malloc.c - 664 sys sys 1014927398 5381
+sys/src/libc/port/malloc.c - 664 sys sys 1102093081 5697
 sys/src/libc/port/memccpy.c - 664 sys sys 1014927398 216
 sys/src/libc/port/memchr.c - 664 sys sys 1014927398 182
 sys/src/libc/port/memcmp.c - 664 sys sys 1014927398 259
@@ -11698,7 +11698,7 @@ sys/src/libc/port/netmkaddr.c - 664 sys sys 1014927400 863
 sys/src/libc/port/nrand.c - 664 sys sys 1035832917 191
 sys/src/libc/port/ntruerand.c - 664 sys sys 1014927400 371
 sys/src/libc/port/perror.c - 664 sys sys 1014927400 199
-sys/src/libc/port/pool.c - 664 sys sys 1067719044 27913
+sys/src/libc/port/pool.c - 664 sys sys 1102093118 30853
 sys/src/libc/port/pow.c - 664 sys sys 1014927401 965
 sys/src/libc/port/pow10.c - 664 sys sys 1014927401 1946
 sys/src/libc/port/profile.c - 664 sys sys 1067719045 5495

+ 18 - 0
dist/replica/plan9.log

@@ -17146,3 +17146,21 @@
 1101961850 5 c 386/bin/tar - 775 sys sys 1101960675 81834
 1101961850 6 c 386/lib/libframe.a - 664 sys sys 1101960676 66060
 1101997857 0 c sys/man/1/acme - 664 sys sys 1101996606 17593
+1102089674 0 c sys/man/4/kfs - 664 sys sys 1102088374 2164
+1102089674 1 c sys/man/8/replica - 664 sys sys 1102088374 6295
+1102093275 0 c sys/include/libc.h - 664 sys sys 1102093062 19516
+1102093275 1 c sys/include/pool.h - 664 sys sys 1102093074 1219
+1102093275 2 c sys/man/2/malloc - 664 sys sys 1102093069 4763
+1102093275 3 c sys/man/2/pool - 664 sys sys 1102093086 8574
+1102093275 4 c sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1102093207 30350
+1102093275 5 c sys/src/cmd/upas/vf/vf.c - 664 sys sys 1102093227 17450
+1102093275 6 c sys/src/libc/port/malloc.c - 664 sys sys 1102093081 5697
+1102093275 7 c sys/src/libc/port/pool.c - 664 sys sys 1102093118 30853
+1102095075 0 c sys/man/3/uart - 664 sys sys 1102093395 1710
+1102095075 1 c sys/src/9/pc/uarti8250.c - 664 sys sys 1102093392 13917
+1102095075 2 c sys/src/9/port/alloc.c - 664 sys sys 1102093389 5645
+1102095075 3 c sys/src/9/port/devuart.c - 664 sys sys 1102093393 12192
+1102095075 4 c sys/src/9/port/portclock.c - 664 sys sys 1102093397 4556
+1102095075 5 c sys/src/9/port/portdat.h - 664 sys sys 1102093399 22207
+1102095075 6 c sys/src/9/port/portfns.h - 664 sys sys 1102093388 11474
+1102134682 0 c sys/src/9/port/page.c - 664 sys sys 1102133425 8281

+ 1 - 0
sys/include/libc.h

@@ -91,6 +91,7 @@ extern	void*	malloc(ulong);
 extern	void*	mallocz(ulong, int);
 extern	void	free(void*);
 extern	ulong	msize(void*);
+extern	void*	mallocalign(ulong, ulong, long, ulong);
 extern	void*	calloc(ulong, ulong);
 extern	void*	realloc(void*, ulong);
 extern	void		setmalloctag(void*, ulong);

+ 1 - 0
sys/include/pool.h

@@ -32,6 +32,7 @@ struct Pool {
 };
 
 extern void*	poolalloc(Pool*, ulong);
+extern void*	poolallocalign(Pool*, ulong, ulong, long, ulong);
 extern void	poolfree(Pool*, void*);
 extern ulong	poolmsize(Pool*, void*);
 extern void*	poolrealloc(Pool*, void*, ulong);

+ 24 - 1
sys/man/2/malloc

@@ -1,6 +1,6 @@
 .TH MALLOC 2
 .SH NAME
-malloc, mallocz, free, realloc, calloc, msize, setmalloctag, setrealloctag, getmalloctag, getrealloctag, malloctopoolblock \- memory allocator
+malloc, mallocalign, mallocz, free, realloc, calloc, msize, setmalloctag, setrealloctag, getmalloctag, getrealloctag, malloctopoolblock \- memory allocator
 .SH SYNOPSIS
 .B #include <u.h>
 .br
@@ -11,6 +11,9 @@ malloc, mallocz, free, realloc, calloc, msize, setmalloctag, setrealloctag, getm
 void*	malloc(ulong size)
 .PP
 .B
+void*	mallocalign(ulong size, ulong align, long offset, ulong span)
+.PP
+.B
 void*	mallocz(ulong size, int clr)
 .PP
 .B
@@ -73,6 +76,26 @@ except that if
 .I clr
 is non-zero, the memory returned will be zeroed.
 .PP
+.I Mallocalign
+allocates a block of at least 
+.I n
+bytes of memory respecting alignment contraints.
+If
+.I align
+is non-zero,
+the returned pointer is aligned to be equal to
+.I offset
+modulo
+.IR align .
+If
+.I span
+is non-zero,
+the
+.I n
+byte block allocated will not span a
+.IR span -byte
+boundary.
+.PP
 .I Realloc
 changes the size of the block pointed to by
 .I ptr

+ 27 - 1
sys/man/2/pool

@@ -1,6 +1,6 @@
 .TH POOL 2
 .SH NAME
-poolalloc, poolfree, poolmsize, poolrealloc, poolcompact, poolcheck, poolblockcheck,
+poolalloc, poolallocalignspan, poolfree, poolmsize, poolrealloc, poolcompact, poolcheck, poolblockcheck,
 pooldump \- general memory management routines
 .SH SYNOPSIS
 .B #include <u.h>
@@ -13,6 +13,11 @@ pooldump \- general memory management routines
 void*	poolalloc(Pool* pool, ulong size)
 .PP
 .B
+void*	poolallocalignspan(Pool *pool, ulong size, 
+.br
+                ulong align, long offset, ulong span)
+.PP
+.B
 void	poolfree(Pool* pool, void* ptr)
 .PP
 .B
@@ -57,6 +62,27 @@ pointer not returned by
 The call
 .B "poolfree(nil)
 is legal and is a no-op.
+.PP
+.I Poolallocalign
+attempts to allocate a block of size
+.B size
+with the given alignment constraints.
+If
+.I align
+is non-zero,
+the returned pointer is aligned to be equal to
+.I offset
+modulo
+.IR align .
+If
+.I span
+is non-zero,
+the
+.I n
+byte block allocated will not span a
+.IR span -byte
+boundary.
+.PP
 .I Poolrealloc
 attempts to resize to
 .B nsize

+ 5 - 0
sys/man/3/uart

@@ -95,6 +95,11 @@ Legal values are 1 or 2.
 Set number of bits per byte to
 .IR n .
 Legal values are 5, 6, 7, or 8.
+.TP
+.BI w n
+Set the uart clock timer to
+n times 100us.
+.IP
 .PP
 The status
 files contain a textual representation of the status of the line, in the format of the

+ 1 - 1
sys/man/4/kfs

@@ -108,7 +108,7 @@ and mount it on
 .BR /n/kfs .
 .IP
 .EX
-% kfs -rb4096 -nlocal
+% disk/kfs -rb4096 -nlocal
 % mount -c /srv/kfs.local /n/kfs
 .EE
 .PP

+ 8 - 4
sys/man/8/replica

@@ -70,7 +70,8 @@ provide a more polished interface.
 .PP
 Both client and server maintain textual databases of file system
 metadata.  Each line is of the form
-.sp 0.5
+.ift .sp 0.5
+.ifn .sp
 \h'0.25i'
 .I path
 .I mode
@@ -78,7 +79,8 @@ metadata.  Each line is of the form
 .I gid
 .I mtime
 .I length
-.sp 0.5
+.ift .sp 0.5
+.ifn .sp
 Later entries for a
 .I path
 supersede previous ones.
@@ -101,7 +103,8 @@ A replica is further described on the server by a textual
 log listing creation and deletion of files and changes
 to file contents and metadata.
 Each line is of the form:
-.sp 0.5
+.ift .sp 0.5
+.ifn .sp
 \h'0.25i'
 .I time
 .I gen
@@ -113,7 +116,8 @@ Each line is of the form:
 .I gid
 .I mtime
 .I length
-.sp 0.5
+.ift .sp 0.5
+.ifn .sp
 The
 .I time
 and

+ 10 - 7
sys/src/9/pc/uarti8250.c

@@ -164,8 +164,9 @@ i8250status(Uart* uart, void* buf, long n, long offset)
 	ier = ctlr->sticky[Ier];
 	lcr = ctlr->sticky[Lcr];
 	snprint(p, READSTR,
-		"b%d c%d d%d e%d l%d m%d p%c r%d s%d i%d ier=%ux\n"
-		"dev(%d) type(%d) framing(%d) overruns(%d)%s%s%s%s\n",
+		"b%d c%d d%d e%d l%d m%d p%c r%d s%d i%d\n"
+		"dev(%d) type(%d) framing(%d) overruns(%d) "
+		"berr(%d) serr(%d)%s%s%s%s\n",
 
 		uart->baud,
 		uart->hup_dcd, 
@@ -177,12 +178,13 @@ i8250status(Uart* uart, void* buf, long n, long offset)
 		(mcr & Rts) != 0,
 		(lcr & Stb) ? 2: 1,
 		ctlr->fena,
-		ier,
 
 		uart->dev,
 		uart->type,
 		uart->ferr,
-		uart->oerr, 
+		uart->oerr,
+		uart->berr,
+		uart->serr,
 		(msr & Cts) ? " cts": "",
 		(msr & Dsr) ? " dsr": "",
 		(msr & Dcd) ? " dcd": "",
@@ -316,8 +318,9 @@ i8250parity(Uart* uart, int parity)
 		lcr |= Pen;
 		break;
 	case 'n':
-	default:
 		break;
+	default:
+		return -1;
 	}
 	ctlr->sticky[Lcr] = lcr;
 	csr8w(ctlr, Lcr, 0);
@@ -420,7 +423,7 @@ i8250break(Uart* uart, int ms)
 	/*
 	 * Send a break.
 	 */
-	if(ms == 0)
+	if(ms <= 0)
 		ms = 200;
 
 	ctlr = uart->regs;
@@ -502,7 +505,7 @@ i8250interrupt(Ureg*, void* arg)
 			 * already been tossed.
 			 */
 			while((lsr = csr8r(ctlr, Lsr)) & Dr){
-				if(lsr & Oe)
+				if(lsr & (FIFOerr|Oe))
 					uart->oerr++;
 				if(lsr & Pe)
 					uart->perr++;

+ 14 - 0
sys/src/9/port/alloc.c

@@ -216,6 +216,20 @@ mallocz(ulong size, int clr)
 	return v;
 }
 
+void*
+mallocalign(ulong size, ulong align, long offset, ulong span)
+{
+	void *v;
+
+	v = poolallocalign(mainmem, size+Npadlong*sizeof(ulong), align, offset-Npadlong*sizeof(ulong), span);
+	if(Npadlong && v != nil){
+		v = (ulong*)v+Npadlong;
+		setmalloctag(v, getcallerpc(&size));
+		setrealloctag(v, 0);
+	}
+	return v;
+}
+
 void
 free(void *v)
 {

+ 49 - 17
sys/src/9/port/devuart.c

@@ -23,6 +23,7 @@ static Uart** uart;
 static int uartnuart;
 static Dirtab *uartdir;
 static int uartndir;
+static Timer *uarttimer;
 
 struct Uartalloc {
 	Lock;
@@ -41,13 +42,13 @@ uartenable(Uart *p)
 	Uart **l;
 
 	if(p->iq == nil){
-		if((p->iq = qopen(4*1024, 0, uartflow, p)) == nil)
+		if((p->iq = qopen(8*1024, 0, uartflow, p)) == nil)
 			return nil;
 	}
 	else
 		qreopen(p->iq);
 	if(p->oq == nil){
-		if((p->oq = qopen(4*1024, 0, uartkick, p)) == nil){
+		if((p->oq = qopen(8*1024, 0, uartkick, p)) == nil){
 			qfree(p->iq);
 			p->iq = nil;
 			return nil;
@@ -225,9 +226,9 @@ uartreset(void)
 	if(uartnuart){
 		/*
 		 * at 115200 baud, the 1024 char buffer takes 56 ms to process,
-		 * processing it every 22 ms should be fine
+		 * processing it every 22 ms should be fine.
 		 */
-		addclock0link(uartclock, 22);
+		uarttimer = addclock0link(uartclock, 22);
 	}
 }
 
@@ -317,7 +318,9 @@ uartclose(Chan *c)
 		qlock(p);
 		if(--(p->opens) == 0){
 			qclose(p->iq);
+			ilock(&p->rlock);
 			p->ir = p->iw = p->istage;
+			iunlock(&p->rlock);
 
 			/*
 			 */
@@ -461,7 +464,9 @@ uartctl(Uart *p, char *cmd)
 			break;
 		case 'W':
 		case 'w':
-			/* obsolete */
+			if(uarttimer == nil || n < 1)
+				return -1;
+			uarttimer->tns = (vlong)n * 100000LL;
 			break;
 		case 'X':
 		case 'x':
@@ -630,6 +635,35 @@ uartkick(void *v)
 	}
 }
 
+/*
+ * Move data from the interrupt staging area to
+ * the input Queue.
+ */
+static void
+uartstageinput(Uart *p)
+{
+	int n;
+	uchar *ir, *iw;
+
+	while(p->ir != p->iw){
+		ir = p->ir;
+		if(p->ir > p->iw){
+			iw = p->ie;
+			p->ir = p->istage;
+		}
+		else{
+			iw = p->iw;
+			p->ir = p->iw;
+		}
+		if((n = qproduce(p->iq, ir, iw - ir)) < 0){
+			p->serr++;
+			(*p->phys->rts)(p, 0);
+		}
+		else if(n == 0)
+			p->berr++;
+	}
+}
+
 /*
  *  receive a character at interrupt time
  */
@@ -652,13 +686,17 @@ uartrecv(Uart *p,  char ch)
 	if(p->putc)
 		p->putc(p->iq, ch);
 	else{
+		ilock(&p->rlock);
 		next = p->iw + 1;
 		if(next == p->ie)
 			next = p->istage;
+		if(next == p->ir)
+			uartstageinput(p);
 		if(next != p->ir){
 			*p->iw = ch;
 			p->iw = next;
 		}
+		iunlock(&p->rlock);
 	}
 }
 
@@ -670,22 +708,15 @@ static void
 uartclock(void)
 {
 	Uart *p;
-	uchar *iw;
 
+	lock(&uartalloc);
 	for(p = uartalloc.elist; p; p = p->elist){
 
-		/* this amortizes cost of qproduce to many chars */
+		/* this hopefully amortizes cost of qproduce to many chars */
 		if(p->iw != p->ir){
-			iw = p->iw;
-			if(iw < p->ir){
-				if(qproduce(p->iq, p->ir, p->ie-p->ir) < 0)
-					(*p->phys->rts)(p, 0);
-				p->ir = p->istage;
-			}
-			if(iw > p->ir)
-				if(qproduce(p->iq, p->ir, iw-p->ir) < 0)
-					(*p->phys->rts)(p, 0);
-			p->ir = iw;
+			ilock(&p->rlock);
+			uartstageinput(p);
+			iunlock(&p->rlock);
 		}
 
 		/* hang up if requested */
@@ -705,6 +736,7 @@ uartclock(void)
 			iunlock(&p->tlock);
 		}
 	}
+	unlock(&uartalloc);
 }
 
 /*

+ 17 - 6
sys/src/9/port/page.c

@@ -261,7 +261,9 @@ auxpage()
 	return p;
 }
 
-void
+static int dupretries = 15000;
+
+int
 duppage(Page *p)				/* Always call with p locked */
 {
 	Page *np;
@@ -271,12 +273,19 @@ duppage(Page *p)				/* Always call with p locked */
 	retries = 0;
 retry:
 
-	if(retries++ > 10000)
-		panic("duppage %d", retries);
+	if(retries++ > dupretries){
+		print("duppage %d, up %p\n", retries, up);
+		dupretries += 100;
+		if(dupretries > 100000)
+			panic("duppage\n");
+		uncachepage(p);
+		return 1;
+	}
+		
 
 	/* don't dup pages with no image */
 	if(p->ref == 0 || p->image == nil || p->image->notext)
-		return;
+		return 0;
 
 	/*
 	 *  normal lock ordering is to call
@@ -296,7 +305,7 @@ retry:
 	if(palloc.freecount < swapalloc.highwater) {
 		unlock(&palloc);
 		uncachepage(p);
-		return;
+		return 1;
 	}
 
 	color = getpgcolor(p->va);
@@ -308,7 +317,7 @@ retry:
 	if(np == 0) {
 		unlock(&palloc);
 		uncachepage(p);
-		return;
+		return 1;
 	}
 
 	pageunchain(np);
@@ -325,6 +334,8 @@ retry:
 	cachepage(np, p->image);
 	unlock(np);
 	uncachepage(p);
+
+	return 0;
 }
 
 void

+ 2 - 1
sys/src/9/port/portclock.c

@@ -229,7 +229,7 @@ timersinit(void)
 	timeradd(t);
 }
 
-void
+Timer*
 addclock0link(void (*f)(void), int ms)
 {
 	Timer *nt;
@@ -249,6 +249,7 @@ addclock0link(void (*f)(void), int ms)
 	if(when)
 		timerset(when);
 	iunlock(&timers[0]);
+	return nt;
 }
 
 /*

+ 4 - 1
sys/src/9/port/portdat.h

@@ -833,7 +833,7 @@ struct PhysUart
 };
 
 enum {
-	Stagesize=	1024
+	Stagesize=	2048
 };
 
 /*
@@ -865,12 +865,15 @@ struct Uart
 	int	perr;			/* parity errors */
 	int	ferr;			/* framing errors */
 	int	oerr;			/* rcvr overruns */
+	int	berr;			/* no input buffers */
+	int	serr;			/* input queue overflow */
 
 	/* buffers */
 	int	(*putc)(Queue*, int);
 	Queue	*iq;
 	Queue	*oq;
 
+	Lock	rlock;
 	uchar	istage[Stagesize];
 	uchar	*iw;
 	uchar	*ir;

+ 3 - 2
sys/src/9/port/portfns.h

@@ -1,5 +1,5 @@
 void		accounttime(void);
-void		addclock0link(void (*)(void), int);
+Timer*		addclock0link(void (*)(void), int);
 int		addphysseg(Physseg*);
 void		addbootfile(char*, uchar*, ulong);
 Block*		adjustblock(Block*, int);
@@ -87,7 +87,7 @@ void		dumpqueues(void);
 void		dumpregs(Ureg*);
 void		dumpstack(void);
 Fgrp*		dupfgrp(Fgrp*);
-void		duppage(Page*);
+int		duppage(Page*);
 void		dupswap(Page*);
 void		edfinit(Proc*);
 char*		edfadmit(Proc*);
@@ -177,6 +177,7 @@ Page*		lookpage(Image*, ulong);
 void		machinit(void);
 void*		mallocz(ulong, int);
 void*		malloc(ulong);
+void*		mallocalign(ulong, ulong, long, ulong);
 void		mallocsummary(void);
 Block*		mem2bl(uchar*, int);
 void		mfreeseg(Segment*, ulong, int);

+ 5 - 2
sys/src/cmd/upas/smtp/smtpd.c

@@ -40,6 +40,7 @@ char	*tlscert;
 List	senders;
 List	rcvers;
 
+char pipbuf[ERRMAX];
 char	*piperror;
 int	pipemsg(int*);
 String*	startcmd(void);
@@ -256,9 +257,10 @@ hello(String *himp, int extended)
 {
 	char **mynames;
 
+	him = s_to_c(himp);
+	syslog(0, "smtpd", "%s from %s as %s", extended ? "ehlo" : "helo", nci->rsys, him);
 	if(rejectcheck())
 		return;
-	him = s_to_c(himp);
 
 	if(strchr(him, '.') && nci && !trusted && fflag && strcmp(nci->rsys, nci->lsys) != 0){
 		/*
@@ -1011,7 +1013,8 @@ pipemsg(int *byteswritten)
 	s_free(line);
 	if(sawdot == 0){
 		/* message did not terminate normally */
-		piperror = "unexpected eof";
+		snprint(pipbuf, sizeof pipbuf, "network eof: %r");
+		piperror = pipbuf;
 		syskillpg(pp->pid);
 		status = 1;
 	}

+ 4 - 5
sys/src/cmd/upas/vf/vf.c

@@ -1,3 +1,7 @@
+/*
+ *  this is a filter that changes mime types and names of
+ *  suspect executable attachments.
+ */
 #include "common.h"
 #include <ctype.h>
 
@@ -111,11 +115,6 @@ Mtype *mtypes;
 int justreject;
 char *savefile;
 
-/*
- *  this is a filter that changes mime types and names of
- *  suspect attachments.
- *
- */
 void
 main(int argc, char **argv)
 {

+ 14 - 0
sys/src/libc/port/malloc.c

@@ -221,6 +221,20 @@ mallocz(ulong size, int clr)
 	return v;
 }
 
+void*
+mallocalign(ulong size, ulong align, long offset, ulong span)
+{
+	void *v;
+
+	v = poolallocalign(mainmem, size+Npadlong*sizeof(ulong), align, offset-Npadlong*sizeof(ulong), span);
+	if(Npadlong && v != nil){
+		v = (ulong*)v+Npadlong;
+		setmalloctag(v, getcallerpc(&size));
+		setrealloctag(v, 0);
+	}
+	return v;
+}
+
 void
 free(void *v)
 {

+ 174 - 26
sys/src/libc/port/pool.c

@@ -20,12 +20,12 @@
  * When freed, adjacent blocks are coalesced to create larger blocks when
  * possible.
  * 
- * Allocated blocks (Alloc*) have one of two magic values: KEMPT_MAGIC or
- * UNKEMPT_MAGIC.  When blocks are released from the pool, they have
- * magic value UNKEMPT_MAGIC.  Once the block has been trimmed by kemb()
+ * Allocated blocks (Alloc*) have one of two magic values: ALLOC_MAGIC or
+ * UNALLOC_MAGIC.  When blocks are released from the pool, they have
+ * magic value UNALLOC_MAGIC.  Once the block has been trimmed by trim()
  * and the amount of user-requested data has been recorded in the
- * datasize field of the tail, the magic value is changed to KEMPT_MAGIC.
- * All blocks returned to callers should be of type KEMPT_MAGIC, as
+ * datasize field of the tail, the magic value is changed to ALLOC_MAGIC.
+ * All blocks returned to callers should be of type ALLOC_MAGIC, as
  * should all blocks passed to us by callers.  The amount of data the user
  * asked us for can be found by subtracting the short in tail->datasize 
  * from header->size.  Further, the up to at most four bytes between the
@@ -95,8 +95,8 @@ struct Alloc {
 			Bhdr;
 };
 enum {
-	KEMPT_MAGIC = 0x0A110C09,
-	UNKEMPT_MAGIC = 0xCAB00D1E+1,
+	ALLOC_MAGIC = 0x0A110C09,
+	UNALLOC_MAGIC = 0xCAB00D1E+1,
 };
 
 struct Arena {
@@ -113,6 +113,10 @@ enum {
 #define A2TB(a)	((Bhdr*)((uchar*)(a)+(a)->asize-sizeof(Bhdr)))
 #define A2B(a)	B2NB(a)
 
+enum {
+	ALIGN_MAGIC = 0xA1F1D1C1,
+};
+
 enum {
 	MINBLOCKSIZE = sizeof(Free)+sizeof(Btail)
 };
@@ -136,7 +140,7 @@ static Bhdr*	blocksetsize(Bhdr*, ulong);
 static ulong	bsize2asize(Pool*, ulong);
 static ulong	dsize2bsize(Pool*, ulong);
 static ulong	getdsize(Alloc*);
-static Alloc*	kemb(Pool*, Alloc*, ulong);
+static Alloc*	trim(Pool*, Alloc*, ulong);
 static Free*	listadd(Free*, Free*);
 static Free*	listdelete(Free*, Free*);
 static void		logstack(Pool*);
@@ -417,7 +421,7 @@ pooldel(Pool *p, Free *node)
 		memmark(_B2D(node), 0xF9, node->size-sizeof(Bhdr)-sizeof(Btail));
 	}
 
-	node->magic = UNKEMPT_MAGIC;
+	node->magic = UNALLOC_MAGIC;
 	return (Alloc*)node;
 }
 
@@ -473,7 +477,7 @@ blockmerge(Pool *pool, Bhdr *a, Bhdr *b)
 	b->size = NOT_MAGIC;
 	b->magic = NOT_MAGIC;
 
-	a->magic = UNKEMPT_MAGIC;
+	a->magic = UNALLOC_MAGIC;
 	return (Alloc*)a;
 }
 
@@ -525,9 +529,9 @@ blocksetdsize(Pool *p, Alloc *b, ulong dsize)
 	return b;
 }
 
-/* kemb: trim a block down to what is needed to hold dsize bytes of user data */
+/* trim: trim a block down to what is needed to hold dsize bytes of user data */
 static Alloc*
-kemb(Pool *p, Alloc *b, ulong dsize)
+trim(Pool *p, Alloc *b, ulong dsize)
 {
 	ulong extra, bsize;
 	Alloc *frag;
@@ -543,16 +547,34 @@ kemb(Pool *p, Alloc *b, ulong dsize)
 			memmark(frag, 0xF1, extra);
 		}
 
-		frag->magic = UNKEMPT_MAGIC;
+		frag->magic = UNALLOC_MAGIC;
 		blocksetsize(frag, extra);
 		pooladd(p, frag);
 	}
 
-	b->magic = KEMPT_MAGIC;
+	b->magic = ALLOC_MAGIC;
 	blocksetdsize(p, b, dsize);
 	return b;
 }
 
+static Alloc*
+freefromfront(Pool *p, Alloc *b, ulong skip)
+{
+	Alloc *bb;
+
+	skip = skip&~(p->quantum-1);
+	if(skip >= 0x1000 || (skip >= b->size>>2 && skip >= MINBLOCKSIZE && skip >= p->minblock)){
+		bb = (Alloc*)((uchar*)b+skip);
+		blocksetsize(bb, b->size-skip);
+		bb->magic = UNALLOC_MAGIC;
+		blocksetsize(b, skip);
+		b->magic = UNALLOC_MAGIC;
+		pooladd(p, b);
+		return bb;
+	}
+	return b;	
+}
+
 /*
  * Arena maintenance
  */
@@ -602,7 +624,7 @@ poolnewarena(Pool *p, ulong asize)
 
 	/* create one large block in arena */
 	b = (Alloc*)A2B(a);
-	b->magic = UNKEMPT_MAGIC;
+	b->magic = UNALLOC_MAGIC;
 	blocksetsize(b, (uchar*)A2TB(a)-(uchar*)b);
 	blockcheck(p, b);
 	pooladd(p, b);
@@ -652,7 +674,7 @@ blockgrow(Pool *p, Bhdr *b, ulong nsize)
 		a = (Alloc*)b;
 		dsize = getdsize(a);
 		blocksetsize(a, nsize);
-		kemb(p, a, dsize);
+		trim(p, a, dsize);
 	}
 }
 
@@ -710,7 +732,7 @@ dumpblock(Pool *p, Bhdr *b)
 	p->print(p, "tail %.8lux %.8lux %.8lux %.8lux %.8lux %.8lux | %.8lux %.8lux\n",
 		dp[-6], dp[-5], dp[-4], dp[-3], dp[-2], dp[-1], dp[0], dp[1]);
 
-	if(b->magic == KEMPT_MAGIC){
+	if(b->magic == ALLOC_MAGIC){
 		dsize = getdsize((Alloc*)b);
 		if(dsize >= b->size)	/* user data size corrupt */
 			return;
@@ -754,7 +776,7 @@ blockcheck(Pool *p, Bhdr *b)
 	default:
 		panicblock(p, b, "bad magic");
 	case FREE_MAGIC:
-	case UNKEMPT_MAGIC:
+	case UNALLOC_MAGIC:
 	 	t = B2T(b);
 		if(t->magic0 != TAIL_MAGIC0 || t->magic1 != TAIL_MAGIC1)
 			panicblock(p, b, "corrupt tail magic");
@@ -783,7 +805,7 @@ blockcheck(Pool *p, Bhdr *b)
 		if(b->size != 0)
 			panicblock(p, b, "bad arena tail size");
 		break;
-	case KEMPT_MAGIC:
+	case ALLOC_MAGIC:
 		a = (Alloc*)b;
 		if(a->size > 1024*1024*1024)
 			panicblock(p, b, "block too big");
@@ -851,7 +873,7 @@ arenacompact(Pool *p, Arena *a)
 			pooldel(p, (Free*)b);
 			b->magic = FLOATING_MAGIC;
 			break;
-		case KEMPT_MAGIC:
+		case ALLOC_MAGIC:
 			if(wb != b) {
 				memmove(wb, b, b->size);
 				p->move(_B2D(b), _B2D(wb));
@@ -867,7 +889,7 @@ arenacompact(Pool *p, Arena *a)
 	 * at by wb.  all we need to do is set its size and get out.
 	 */
 	if(wb < eb) {
-		wb->magic = UNKEMPT_MAGIC;
+		wb->magic = UNALLOC_MAGIC;
 		blocksetsize(wb, (uchar*)eb-(uchar*)wb);
 		pooladd(p, (Alloc*)wb);
 	}
@@ -919,7 +941,7 @@ _B2D(void *a)
 static void*
 B2D(Pool *p, Alloc *a)
 {
-	if(a->magic != KEMPT_MAGIC)
+	if(a->magic != ALLOC_MAGIC)
 		p->panic(p, "B2D called on unworthy block");
 	return _B2D(a);
 }
@@ -938,8 +960,15 @@ static Alloc*
 D2B(Pool *p, void *v)
 {
 	Alloc *a;
-	a = _D2B(v);
-	if(a->magic != KEMPT_MAGIC)
+	ulong *u;
+
+	if((ulong)v&(sizeof(ulong)-1))
+		v = (char*)v - ((ulong)v&(sizeof(ulong)-1));
+	u = v;
+	while(u[-1] == ALIGN_MAGIC)
+		u--;
+	a = _D2B(u);
+	if(a->magic != ALLOC_MAGIC)
 		p->panic(p, "D2B called on non-block %p (double-free?)", v);
 	return a;
 }
@@ -968,7 +997,7 @@ poolallocl(Pool *p, ulong dsize)
 		}
 	}
 
-	ab = kemb(p, pooldel(p, fb), dsize);
+	ab = trim(p, pooldel(p, fb), dsize);
 	p->curalloc += ab->size;
 	return B2D(p, ab);
 }
@@ -1002,7 +1031,7 @@ poolreallocl(Pool *p, void *v, ulong ndsize)
 	Returnblock:
 		if(v != _B2D(a))
 			memmove(_B2D(a), v, odsize);
-		a = kemb(p, a, ndsize);
+		a = trim(p, a, ndsize);
 		p->curalloc -= obsize;
 		p->curalloc += a->size;
 		v = B2D(p, a);
@@ -1051,6 +1080,100 @@ poolreallocl(Pool *p, void *v, ulong ndsize)
 	return nv;
 }
 
+static void*
+alignptr(void *v, ulong align, long offset)
+{
+	char *c;
+	ulong off;
+
+	c = v;
+	if(align){
+		off = (ulong)c%align;
+		if(off != offset){
+			c += offset - off;
+			if(off > offset)
+				c += align;
+		}
+	}
+	return c;
+}
+
+/* poolspanallocl: allocate as described below; assumes pool locked */
+static void*
+poolallocalignl(Pool *p, ulong dsize, ulong align, long offset, ulong span)
+{
+	ulong asize;
+	void *v;
+	char *c;
+	ulong *u;
+	int skip;
+	Alloc *b;
+
+	/*
+	 * allocate block
+	 * 	dsize bytes
+	 *	addr == offset (modulo align)
+	 *	does not cross span-byte block boundary
+	 *
+	 * to satisfy alignment, just allocate an extra
+	 * align bytes and then shift appropriately.
+	 * 
+	 * to satisfy span, try once and see if we're
+	 * lucky.  the second time, allocate 2x asize
+	 * so that we definitely get one not crossing
+	 * the boundary.
+	 */
+	if(align){
+		if(offset < 0)
+			offset = align - ((-offset)%align);
+		else
+			offset %= align;
+	}
+	asize = dsize+align;
+	v = poolallocl(p, asize);
+	if(v == nil)
+		return nil;
+	if(span && (ulong)v/span != ((ulong)v+asize)/span){
+		/* try again */
+		poolfreel(p, v);
+		v = poolallocl(p, 2*asize);
+		if(v == nil)
+			return nil;
+	}
+
+	/*
+	 * figure out what pointer we want to return
+	 */
+	c = alignptr(v, align, offset);
+	if(span && (ulong)c/span != (ulong)(c+dsize-1)/span){
+		c += span - (ulong)c%span;
+		c = alignptr(c, align, offset);
+		if((ulong)c/span != (ulong)(c+dsize-1)/span){
+			poolfreel(p, v);
+			werrstr("cannot satisfy dsize %lud span %lud with align %lud+%ld", dsize, span, align, offset);
+			return nil;
+		}
+	}
+	skip = c - (char*)v;
+
+	/*
+	 * free up the skip bytes before that pointer
+	 * or mark it as unavailable.
+	 */
+	b = _D2B(v);
+	b = freefromfront(p, b, skip);
+	v = _B2D(b);
+	skip = c - (char*)v;
+	if(c > (char*)v){
+		u = v;
+		while(c >= (char*)u+sizeof(ulong))
+			*u++ = ALIGN_MAGIC;
+	}
+	trim(p, b, skip+dsize);
+	assert(D2B(p, c) == b);
+	return c;
+}
+
 /* poolfree: free block obtained from poolalloc; assumes lock held */
 static void
 poolfreel(Pool *p, void *v)
@@ -1112,6 +1235,31 @@ poolalloc(Pool *p, ulong n)
 	return v;
 }
 
+void*
+poolallocalign(Pool *p, ulong n, ulong align, long offset, ulong span)
+{
+	void *v;
+
+	p->lock(p);
+	paranoia {
+		poolcheckl(p);
+	}
+	verbosity {
+		pooldumpl(p);
+	}
+	v = poolallocalignl(p, n, align, offset, span);
+	paranoia {
+		poolcheckl(p);
+	}
+	verbosity {
+		pooldumpl(p);
+	}
+	if(p->logstack && (p->flags & POOL_LOGGING)) p->logstack(p);
+	LOG(p, "poolalignspanalloc %p %lud %lud %lud %ld = %p\n", p, n, align, span, offset, v);
+	p->unlock(p);
+	return v;
+}
+
 int
 poolcompact(Pool *p)
 {