%NANOSLEEP: work around a bug in some versions of #_nanosleep on
Darwin.  (The bug was introduced in an early prerelease of 10.5
and is still present in some versions of 10.6 but seems to be fixed
in later OS releases.)

An earlier attempt to work around the bug was incorrect; this version
tries to detect invalid "remaining seconds" by refusing to sleep for
more than ... oh, 30 years are so.  Very large numbers of remaining
seconds after an interrupt can be treated as "a negative 32-bit number
of remaining seconds, zero-extended", which can in turn be treated as
"we slept long enough."

(A consequence is that attempts to sleep for more than ~30 years will
sleep for ~30 years.  Let them report it ...)


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15453 8bdb8f1d-59ce-db11-9e41-0016172a54ae
In %MULTIPLY-AND-ADD: (thanks to uchida) don't try to keep node X in
imm reg imm0.

Fixes ticket:968 in the trunk.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15454 8bdb8f1d-59ce-db11-9e41-0016172a54ae
Fix #1012 - add %unbox-s8 vinsin to both x8664-vinsins.lisp and x8632-vinsins.lisp

git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15455 8bdb8f1d-59ce-db11-9e41-0016172a54ae
ARM code for issue #1012. ARM compiler doesn't use the new VINSIN with my example, so untested.

git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15456 8bdb8f1d-59ce-db11-9e41-0016172a54ae
Decide whether to use the libdispatch-based mechanism or one based
on #/performSelectorOnMainThread:... in the implementation of 
QUEUE-FOR-EVENT-PROCESS and CALL-IN-EVENT-PROCESS based on the runtime
value of GUI::*INTERRUPT-VIA-DISPATCH-QUEUE*.  Default to using the new
mechanism, for now.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15457 8bdb8f1d-59ce-db11-9e41-0016172a54ae
'arg_reg' not 'arg_z', near local_label(opt_supp) in .SPdestbind1.

Fixes ticket:1013 in the trunk.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15458 8bdb8f1d-59ce-db11-9e41-0016172a54ae
%%EQUALHASH processes final CDR.

Fixes ticket:1011 in trunk.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15459 8bdb8f1d-59ce-db11-9e41-0016172a54ae
avoid the code coverage temp reg when compiling for coverage.  Fixes ticket:975

git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15460 8bdb8f1d-59ce-db11-9e41-0016172a54ae
Drop the DARWIN64 definition; things that had been conditionalized
on DARWIN64 are now just conditionalized on DARWIN.

To work around a bug where mach_port_allocate_name() fails if its
last argument is > ~#x09800000, preallocate the first TCR_CLUSTER_SIZE
(=1K) TCRs in the executable's bss.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15461 8bdb8f1d-59ce-db11-9e41-0016172a54ae
Darwin-specific:
Give up on the idea of using mach_port_allocate_name(); it seems to be
too badly broken on 10.8.  Map tcr->exception_port via an otherwise
unused TCR slot, map exception_port->tcr via a simple hash table.
Keep the (relatively) new idea of clustered TCR allocation, but simplify
it a little (since there are no longer any constraints on TCR addresses.)
Be a little more careful about keeping the TCR 16-byte aligned.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15462 8bdb8f1d-59ce-db11-9e41-0016172a54ae
Suppress some compiler warnings.

map_tcr_cluster(): check for mmap() failure correctly.

Lose the (new) hash table used to map Mach ports to TCRs; use
mach_port_{set,get}_context() instead.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15463 8bdb8f1d-59ce-db11-9e41-0016172a54ae
Back out of attempts to use mach_port_{set,get}_context: not exported
on (at least) <=10.6.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15464 8bdb8f1d-59ce-db11-9e41-0016172a54ae
COPY-LIST: don't fight EGC so much if list is long

git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15465 8bdb8f1d-59ce-db11-9e41-0016172a54ae
Revert r15465.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15466 8bdb8f1d-59ce-db11-9e41-0016172a54ae
Try (again) to use mach_port_{get,set}_context instead of a hash table
to map from exception ports to TCRs.  These functions have exsted since
(at least) OSX 10.5 but the symbols have only been exported since sometime
after 10.6, so look up their addresses during initialization.


git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15467 8bdb8f1d-59ce-db11-9e41-0016172a54ae
fall back to hashing scheme on Leopard, because mach_port context functions aren't defined there

git-svn-id: http://svn.clozure.com/publicsvn/openmcl/trunk/source@15468 8bdb8f1d-59ce-db11-9e41-0016172a54ae