Matt Birkholz [Mon, 3 Sep 2012 06:38:12 +0000 (23:38 -0700)]
Use ppoll() and pselect() when available.
Use them only when a test-select- primitive should block. The old
poll()/select() functions continue to be used when not blocking,
e.g. in uxsock.c's do_connect().
Process all queued X events, not just one, if I/O is ready.
X-DISPLAY-PROCESS-EVENTS may have the side effect of moving events
from the kernel's pipe buffer into Xlib's queue, in which case after
processing one event there may be more events pending in the queue
but no more I/O pending on the pipe. Before this change we failed to
report these other events in a timely fashion.
Do this both in Edwin's xterm.scm and the runtime's x11graph.scm.
Works on the Raspberry Pi and the BeagleBone, which seem to be,
remarkably enough, the first ARM platforms on which anyone has ever
tried to run MIT Scheme.
Ask Xlib for events before blocking on the display in x11graph.scm.
Fixes race whereby Xlib may have queued up events already before we
ask the OS about I/O on the underlying file descriptor. This can
cause us to fail to notice an event until a second one comes along,
so that, e.g., a newly created window will hang until you move the
mouse over it or similar.
Peter Feigl [Thu, 3 May 2012 07:45:45 +0000 (09:45 +0200)]
Fix basic debugging problems.
* Debugging
There are numerous problems, including no replies sent to messages and
incorrect replies.
- Added condition/report-string to the abort message.
- Added a DYNAMIC-WIND in the condition handler in the message handler
for emacs-rex to ensure that the :abort message is always written,
even when a restart is called.
- Added a global (fluid) binding *index* that is used to send the
correct message index in the :debug message.
There are many problems remaining, to be tackled in a later commit.
Peter Feigl [Thu, 3 May 2012 07:32:00 +0000 (09:32 +0200)]
Adding completion function swank:completions as an alias for swank:simple-completions.
* Completion
Trying to auto-complete in the REPL raises condition "Unbound variable:
swank:completions". It seems swank added swank:completions in addition
(or instead of?) swank:simple-completions.
Peter Feigl [Thu, 3 May 2012 07:31:24 +0000 (09:31 +0200)]
Add autodoc for procedures
* Autodoc
Actually implement swank:autodoc. It is called with a list form that contains the special symbol swank::%cursor-marker% somewhere to show the position of the cursor.
The new procedure FIND-STRING-BEFORE-SWANK-CURSOR-MARKER returns the symbol that starts the expression which contains the cursor as a string.
The new procedure PROCEDURE-PARAMETERS returns a list containing the function name and the list of parameters (as printed by PA) if symbol is bound to a function.
The new variable SWANK-EXTRA-DOCUMENTATION contains an (incomplete) list of "parameters" to special forms and macros.
Now we have working autodoc in the REPL and in Scheme buffers.
Peter Feigl [Thu, 3 May 2012 07:28:43 +0000 (09:28 +0200)]
Updating swank.scm to work with current slime-cvs
* Startup Problems [when using Emacs setting (slime-setup '(slime-fancy))]
- M-x slime raises condition "Unbound variable: swank:swank-require"
=> fixed by defining swank:swank-require to return '()
- M-x slime shows "error in process filter: Can't find suitable coding-system"
=> fixed by adding :encoding (:coding-systems ("utf-8-unix" "iso-latin-1-unix")) to the connection info
- M-x slime raises condition "Unbound variable :conding-system" (which is due to all parameters being evaluated)
=> fixed by adding QUOTE-SPECIAL and mapping it over the parameters (quoting all keywords [symbols that start with a colon] and T and NIL)
- Typing an expression raises condition "Unbound variable: swank:autodoc"
=> fixed by defining swank:autodoc to return (list ':not-available 't)
- Slime complains about mismatched versions
=> fixed by changing :version in swank:connection-info to "2012-05-02" which matches slime-cvs
Don't do mmap(MAP_FIXED) unless we know the address space is free.
Otherwise it will clobber whatever else was there, including, say,
the text segment of the microcode!
Matt Birkholz [Fri, 4 May 2012 20:58:14 +0000 (13:58 -0700)]
Guard against other threads unwinding block-on-io-descriptor.
This only arises when another thread uses within-continuation to
unwind block-on-io-descriptor. Such an unwinding can leave the
console-thread waiting for nothing. With no other io-registrations
nor runnable threads, the runtime busy-waits.
Matt Birkholz [Mon, 30 Apr 2012 04:04:44 +0000 (21:04 -0700)]
Fixed channel-open to unblock threads and update the io-registry...
...using a new procedure: %deregister-io-descriptor. Also tightened
up channel-read and channel-write to check, within an atomic section,
that the port has not been closed.
If a closed channel is left in the io-registry, wait-for-io piles up
error levels because test-select-registry returns an "illegal mode".
Matt Birkholz [Sat, 28 Apr 2012 18:45:46 +0000 (11:45 -0700)]
edwin: Reworked get-console-input-operations.
Fixed the loop(s) to NOT block when incomplete-pending. They must
busy-wait for half a second. Thus the command key prefix ESC is
correctly echoed.
Also followed the example of get-xterm-input-operations, using
set-interrupt-enables! to implement an atomic section within which the
Edwin thread can test all event sources and block iff they are all
empty. Thus ONE loop tests sources and matches special keys, and uses
the new procedure %channel-read, a version of channel-read that can be
unblocked by an interrupt or process status change.
Matt Birkholz [Thu, 8 Mar 2012 03:47:30 +0000 (20:47 -0700)]
svm: Use the svm1 machine to compile-everything.
This takes hours, but exercises the boot-compiler, which can compile
by-procedures. Added timestamps to the progress notes. The option to
cross-compile everything is available by defining FAST, e.g. `make
FAST=1'.
The (REGISTER (?...)) patterns work for the entire system, but these
rules provide the same generality as those in other machines' lapgens.
Presume that interpreter-call-temporaries can be allocated in any
order (punting let*).
Matt Birkholz [Wed, 29 Feb 2012 19:00:02 +0000 (12:00 -0700)]
Exit with non-zero status when Aborting!: out of memory...
...when run with --batch-mode. This correctly signals to make(1) that
there was an error.
I used nearest-cmdl/batch-mode? though I wonder what a "batch level"
is. Such a thing should probably cmdl-interrupt/abort-previous rather
than %exit, but this short-circuits the whole gc-clean recovery
effort. I find similar yuck (a call to %exit) in ttyio.scm's
operation/read-char.
Matt Birkholz [Sun, 26 Feb 2012 17:14:28 +0000 (10:14 -0700)]
Sorry; re-fixed Debug_Stack_Trace again.
The 20 year old code lies! STACK_LOC(0) *is* the top-of-stack.
(Free[0] is not a valid object, but that is a different register.)
So... the stack slot address must be printed *before* the _POP.
I tried to pop the last commit, but apparently we have
receive.denyNonFastForwards at Savannah.