commit c14c4459e9cfe78f60c9ddb1a0ea129d18b66875
parent 159cf31388f881c3c827a15901d4217635056035
Author: Commit-Bot <unknown>
Date: Sun, 5 Sep 2010 11:03:35 +0000
Automatic commit from picoLisp.tgz, From: Sun, 05 Sep 2010 11:03:35 GMT
Diffstat:
4 files changed, 64 insertions(+), 69 deletions(-)
diff --git a/lib/tags b/lib/tags
@@ -29,7 +29,7 @@ adr (613 . "@src64/main.l")
alarm (487 . "@src64/main.l")
all (772 . "@src64/sym.l")
and (1643 . "@src64/flow.l")
-any (3793 . "@src64/io.l")
+any (3787 . "@src64/io.l")
append (1329 . "@src64/subr.l")
apply (597 . "@src64/apply.l")
arg (2243 . "@src64/main.l")
@@ -82,11 +82,11 @@ cdddr (245 . "@src64/subr.l")
cddr (79 . "@src64/subr.l")
cdr (17 . "@src64/subr.l")
chain (1132 . "@src64/subr.l")
-char (3275 . "@src64/io.l")
+char (3269 . "@src64/io.l")
chop (1093 . "@src64/sym.l")
circ (816 . "@src64/subr.l")
clip (1786 . "@src64/subr.l")
-close (4181 . "@src64/io.l")
+close (4175 . "@src64/io.l")
cmd (2846 . "@src64/main.l")
cnt (1297 . "@src64/apply.l")
co (2566 . "@src64/flow.l")
@@ -97,7 +97,7 @@ cond (1938 . "@src64/flow.l")
connect (201 . "@src64/net.l")
cons (747 . "@src64/subr.l")
copy (1216 . "@src64/subr.l")
-ctl (4121 . "@src64/io.l")
+ctl (4115 . "@src64/io.l")
ctty (2644 . "@src64/main.l")
cut (1797 . "@src64/sym.l")
date (2358 . "@src64/main.l")
@@ -114,13 +114,13 @@ dir (2777 . "@src64/main.l")
dm (561 . "@src64/flow.l")
do (2158 . "@src64/flow.l")
e (2932 . "@src64/flow.l")
-echo (4212 . "@src64/io.l")
+echo (4206 . "@src64/io.l")
env (625 . "@src64/main.l")
-eof (3352 . "@src64/io.l")
-eol (3343 . "@src64/io.l")
+eof (3346 . "@src64/io.l")
+eol (3337 . "@src64/io.l")
errno (1358 . "@src64/main.l")
eval (208 . "@src64/flow.l")
-ext (4941 . "@src64/io.l")
+ext (4935 . "@src64/io.l")
ext? (1034 . "@src64/sym.l")
extern (900 . "@src64/sym.l")
extra (1284 . "@src64/flow.l")
@@ -135,13 +135,13 @@ find (1206 . "@src64/apply.l")
fish (1497 . "@src64/apply.l")
flg? (2419 . "@src64/subr.l")
flip (1686 . "@src64/subr.l")
-flush (4916 . "@src64/io.l")
+flush (4910 . "@src64/io.l")
fold (3343 . "@src64/sym.l")
for (2247 . "@src64/flow.l")
fork (3276 . "@src64/flow.l")
format (2089 . "@src64/big.l")
free (2024 . "@src64/db.l")
-from (3371 . "@src64/io.l")
+from (3365 . "@src64/io.l")
full (1066 . "@src64/subr.l")
fun? (734 . "@src64/sym.l")
gc (439 . "@src64/gc.l")
@@ -153,14 +153,14 @@ glue (1234 . "@src64/sym.l")
gt0 (2702 . "@src64/big.l")
head (1807 . "@src64/subr.l")
heap (542 . "@src64/main.l")
-hear (3093 . "@src64/io.l")
+hear (3087 . "@src64/io.l")
host (184 . "@src64/net.l")
id (1024 . "@src64/db.l")
idx (2037 . "@src64/sym.l")
if (1824 . "@src64/flow.l")
if2 (1843 . "@src64/flow.l")
ifn (1884 . "@src64/flow.l")
-in (4017 . "@src64/io.l")
+in (4011 . "@src64/io.l")
inc (2256 . "@src64/big.l")
index (2611 . "@src64/subr.l")
info (2681 . "@src64/main.l")
@@ -169,21 +169,21 @@ ipid (3221 . "@src64/flow.l")
isa (978 . "@src64/flow.l")
job (1448 . "@src64/flow.l")
journal (967 . "@src64/db.l")
-key (3202 . "@src64/io.l")
+key (3196 . "@src64/io.l")
kill (3253 . "@src64/flow.l")
last (2031 . "@src64/subr.l")
length (2687 . "@src64/subr.l")
let (1498 . "@src64/flow.l")
let? (1559 . "@src64/flow.l")
lieu (1153 . "@src64/db.l")
-line (3527 . "@src64/io.l")
-lines (3680 . "@src64/io.l")
+line (3521 . "@src64/io.l")
+lines (3674 . "@src64/io.l")
link (1163 . "@src64/subr.l")
lisp (1921 . "@src64/main.l")
list (887 . "@src64/subr.l")
listen (151 . "@src64/net.l")
lit (183 . "@src64/flow.l")
-load (3994 . "@src64/io.l")
+load (3988 . "@src64/io.l")
lock (1181 . "@src64/db.l")
loop (2190 . "@src64/flow.l")
low? (3215 . "@src64/sym.l")
@@ -233,31 +233,31 @@ offset (2651 . "@src64/subr.l")
on (1583 . "@src64/sym.l")
onOff (1613 . "@src64/sym.l")
one (1646 . "@src64/sym.l")
-open (4143 . "@src64/io.l")
+open (4137 . "@src64/io.l")
opid (3237 . "@src64/flow.l")
opt (2967 . "@src64/main.l")
or (1659 . "@src64/flow.l")
-out (4037 . "@src64/io.l")
+out (4031 . "@src64/io.l")
pack (1144 . "@src64/sym.l")
pair (2381 . "@src64/subr.l")
pass (638 . "@src64/apply.l")
pat? (720 . "@src64/sym.l")
path (1200 . "@src64/io.l")
-peek (3259 . "@src64/io.l")
+peek (3253 . "@src64/io.l")
pick (1253 . "@src64/apply.l")
pid (157 . "@src64/flow.l")
-pipe (4058 . "@src64/io.l")
-poll (3155 . "@src64/io.l")
+pipe (4052 . "@src64/io.l")
+poll (3149 . "@src64/io.l")
pool (647 . "@src64/db.l")
pop (1773 . "@src64/sym.l")
port (5 . "@src64/net.l")
-pr (5032 . "@src64/io.l")
+pr (5026 . "@src64/io.l")
pre? (1411 . "@src64/sym.l")
-prin (4840 . "@src64/io.l")
-prinl (4854 . "@src64/io.l")
-print (4880 . "@src64/io.l")
-println (4911 . "@src64/io.l")
-printsp (4896 . "@src64/io.l")
+prin (4834 . "@src64/io.l")
+prinl (4848 . "@src64/io.l")
+print (4874 . "@src64/io.l")
+println (4905 . "@src64/io.l")
+printsp (4890 . "@src64/io.l")
prog (1779 . "@src64/flow.l")
prog1 (1787 . "@src64/flow.l")
prog2 (1804 . "@src64/flow.l")
@@ -276,15 +276,15 @@ rand (2959 . "@src64/big.l")
range (988 . "@src64/subr.l")
rank (2970 . "@src64/subr.l")
raw (465 . "@src64/main.l")
-rd (4958 . "@src64/io.l")
+rd (4952 . "@src64/io.l")
read (2532 . "@src64/io.l")
replace (1490 . "@src64/subr.l")
rest (2272 . "@src64/main.l")
reverse (1665 . "@src64/subr.l")
-rewind (4924 . "@src64/io.l")
+rewind (4918 . "@src64/io.l")
rollback (1875 . "@src64/db.l")
rot (848 . "@src64/subr.l")
-rpc (5065 . "@src64/io.l")
+rpc (5059 . "@src64/io.l")
run (331 . "@src64/flow.l")
sect (2515 . "@src64/subr.l")
seed (2944 . "@src64/big.l")
@@ -295,31 +295,31 @@ set (1482 . "@src64/sym.l")
setq (1515 . "@src64/sym.l")
sigio (503 . "@src64/main.l")
size (2752 . "@src64/subr.l")
-skip (3329 . "@src64/io.l")
+skip (3323 . "@src64/io.l")
sort (3869 . "@src64/subr.l")
sp? (711 . "@src64/sym.l")
-space (4858 . "@src64/io.l")
+space (4852 . "@src64/io.l")
split (1579 . "@src64/subr.l")
stack (571 . "@src64/main.l")
state (2028 . "@src64/flow.l")
stem (1976 . "@src64/subr.l")
-str (3847 . "@src64/io.l")
+str (3841 . "@src64/io.l")
str? (1013 . "@src64/sym.l")
strip (1563 . "@src64/subr.l")
sub? (1444 . "@src64/sym.l")
sum (1344 . "@src64/apply.l")
super (1237 . "@src64/flow.l")
-sym (3833 . "@src64/io.l")
+sym (3827 . "@src64/io.l")
sym? (2408 . "@src64/subr.l")
-sync (3056 . "@src64/io.l")
+sync (3050 . "@src64/io.l")
sys (3073 . "@src64/flow.l")
t (1770 . "@src64/flow.l")
tail (1898 . "@src64/subr.l")
-tell (3125 . "@src64/io.l")
+tell (3119 . "@src64/io.l")
text (1272 . "@src64/sym.l")
throw (2510 . "@src64/flow.l")
tick (3189 . "@src64/flow.l")
-till (3438 . "@src64/io.l")
+till (3432 . "@src64/io.l")
time (2491 . "@src64/main.l")
touch (1049 . "@src64/sym.l")
trim (1746 . "@src64/subr.l")
@@ -336,12 +336,12 @@ use (1592 . "@src64/flow.l")
usec (2596 . "@src64/main.l")
val (1463 . "@src64/sym.l")
version (2981 . "@src64/main.l")
-wait (3018 . "@src64/io.l")
+wait (3012 . "@src64/io.l")
when (1903 . "@src64/flow.l")
while (2080 . "@src64/flow.l")
wipe (3090 . "@src64/sym.l")
with (1349 . "@src64/flow.l")
-wr (5049 . "@src64/io.l")
+wr (5043 . "@src64/io.l")
xchg (1538 . "@src64/sym.l")
xor (1720 . "@src64/flow.l")
x| (2871 . "@src64/big.l")
diff --git a/src64/io.l b/src64/io.l
@@ -1,4 +1,4 @@
-# 02sep10abu
+# 05sep10abu
# (c) Software Lab. Alexander Burger
# Close file descriptor
@@ -2575,10 +2575,6 @@
null C # Any?
ret
-(code 'inReadyC_F 0)
- cmp (C I) (C II) # 'ix' < 'cnt'?
- ret # Yes: 'nz'
-
(code 'inReadyA_FC 0)
ld C A
shl C 3 # Vector index
@@ -2600,13 +2596,13 @@
ld C (C) # Slot?
null C # Any?
jz rdSetASL_F # No
- call inReadyC_F # Data in buffer?
+ cmp (C I) (C II) # Data in buffer ('ix' < 'cnt')?
if z # No
- lea Z (L -III) # Beyond last 'poll' structure
+ lea Z (L -IV) # Beyond last 'poll' structure
do
+ cmp Z (L -IV) # More structures?
+ jeq ret # No: 'z'
sub Z POLLFD # Next structure
- cmp Z S # More structures?
- jle retz # No: 'z'
cmp4 (Z) # Found 'fd'?
until eq # Yes
ld2 (Z POLL_REVENTS) # 'revents'
@@ -2620,11 +2616,11 @@
ret
(code 'rdSetASL_F 0) # Z
- lea Z (L -III) # Beyond last 'poll' structure
+ lea Z (L -IV) # Beyond last 'poll' structure
do
+ cmp Z (L -IV) # More structures?
+ jeq ret # No: 'z'
sub Z POLLFD # Next structure
- cmp Z S # More structures?
- jle retz # No: 'z'
cmp4 (Z) # Found 'fd'?
until eq # Yes
ld2 (Z POLL_REVENTS) # 'revents'
@@ -2632,11 +2628,11 @@
ret # Return 'nz'
(code 'wrSetASL_F 0) # Z
- lea Z (L -III) # Beyond last 'poll' structure
+ lea Z (L -IV) # Beyond last 'poll' structure
do
+ cmp Z (L -IV) # More structures?
+ jeq ret # No: 'z'
sub Z POLLFD # Next structure
- cmp Z S # More structures?
- jle retz # No: 'z'
cmp4 (Z) # Found 'fd'?
until eq # Yes
ld2 (Z POLL_REVENTS) # 'revents'
@@ -2654,8 +2650,8 @@
push C # <L -I> File descriptor
push E # <L -II> Milliseconds
push E # <L -III> Timeout
+ push 0 # <L -IV> Poll array
do
- ld Z 0 # Structure count
ld A (L -I) # File descriptor
null A # Positive?
if ns # Yes
@@ -2667,7 +2663,6 @@
st4 (S) # Store 'fd'
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- inc Z # Increment count
end
end
ld Y (Run) # Get '*Run'
@@ -2705,7 +2700,6 @@
st4 (S) # Store 'fd'
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- inc Z # Increment count
end
end
end
@@ -2718,7 +2712,7 @@
if ne # Yes
call inFilesA_FC # Still open?
if nz # Yes
- call inReadyC_F # Data in buffer?
+ cmp (C I) (C II) # Data in buffer ('ix' < 'cnt')?
if nz # Yes
ld (L -III) 0 # Timeout = 0
else
@@ -2726,7 +2720,6 @@
st4 (S) # Store 'Hear'
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- inc Z # Increment count
end
end
end
@@ -2738,7 +2731,6 @@
st4 (S) # Store 'Spkr'
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- inc Z # Increment count
end
ld Y (Child) # Iterate children
ld E (Children) # Count
@@ -2752,7 +2744,6 @@
st4 (S)
ld A POLLIN # Poll input
st2 (S POLL_EVENTS) # Store 'events'
- inc Z # Increment count
null (Y IV) # Child's buffer count?
if nz # Yes
sub S POLLFD # Create 'poll' structure
@@ -2760,17 +2751,20 @@
st4 (S)
ld A POLLOUT # Poll output
st2 (S POLL_EVENTS) # Store 'events'
- inc Z # Increment count
end
end
add Y VI # Increment by sizeof(child)
loop
cmp S (StkLimit) # Stack check
jlt stkErrX
+ lea C (L -IV) # Set poll array pointer
+ ld (C) S
+ sub C S # Calculate poll count
+ shr C POLLFD_SH
call msec_A # Get milliseconds
ld E A # into E
do
- cc poll(S Z (L -III)) # Wait for event or timeout
+ cc poll(S C (L -III)) # Wait for event or timeout
nul4 # OK?
while s # No
call errno_A
@@ -3004,7 +2998,7 @@
while ns # Yes
call rdSetRdyASL_F # Ready?
while z # No
- lea S (L -III) # Drop 'poll' structures
+ lea S (L -IV) # Drop 'poll' structures
loop
ld (At) (L II) # Restore '@'
ld A (L -II) # Return milliseconds
@@ -3170,7 +3164,7 @@
ldz E Nil # No: Return NIL
if nz
do
- call inReadyC_F # Data in buffer?
+ cmp (C I) (C II) # Data in buffer ('ix' < 'cnt')?
while z # No
sub S POLLFD # Create 'poll' structure
st4 (S) # Store 'fd'
diff --git a/src64/sys/linux.defs.l b/src64/sys/linux.defs.l
@@ -1,4 +1,4 @@
-# 20may10abu
+# 05sep10abu
# (c) Software Lab. Alexander Burger
# errno
@@ -106,7 +106,8 @@
(equ WUNTRACED 2)
# poll
-(equ POLLFD 8)
+(equ POLLFD 8) # Should be multiple of 8
+(equ POLLFD_SH 3) # Shift size (log2 POLLFD)
(equ POLL_EVENTS 4) # 2
(equ POLL_REVENTS 6) # 2
(equ POLLIN 1)
diff --git a/src64/version.l b/src64/version.l
@@ -1,6 +1,6 @@
-# 04sep10abu
+# 05sep10abu
# (c) Software Lab. Alexander Burger
-(de *Version 3 0 3 18)
+(de *Version 3 0 3 19)
# vi:et:ts=3:sw=3