* Rewrite keyboard and async I/O handling to improve performance and reduce dependency on async I/O signals
Replaces the SIGIO handler, which used to process X events in the interrupt context, with
a stub routine that sets a flag to signal processing is required.
Actual event processing is moved to the main dispatch loop where Lisp periodic interrupts
are handled.
Removes the X connection file descriptor from the set of fds contributing to SIGIO events
and moves the processing of X events to where the Lisp periodic interrupt is handled in
the main dispatch loop. This code is already guarded by a check for XPending() so can
be called regardless of whether any file descriptors are known to be ready.
Actual processing of async I/O events and X events are handled by procedures
process_io_events() and process_Xevents() respectively. For the most part these are
a renaming of getsignaldata() and getXsignaldata().
The Lisp periodic timer (VTALRM) was set to operate with a 25000 us period (40 Hz),
but on modern hardware it is possible to run this timer with a period of 10000 us (100 Hz)
Incidentally, a bug was noted (and fixed) in the X event handling code for motion events:
Mouse motion without any keyboard activity should not add an entry to the keyboard event
ring buffer as these events do not represent a key state change.
Since the ring buffer is of limited size, when it is filled new events are ignored
until the buffered events are processed. This resulted in the loss of a key/mouse button
transition (up or down) if the mouse was moved about "too much" between keyboard events.
A few incidental cleanups were also made:
- KBDEventFlg initialization fixed (wrong semantic type)
- Event_Req renamed to IO_Signalled (more appropriate name)
- int_io_open() sets up process (self) to handle SIGIO generated by O_ASYNC operations
- LOCK_X_EVENTS turned off since X library calls can no longer happen in an interrupt context
* Use of O_ASYNC must depend on the symbol being defined (looking at you, Cygwin)
* Add SA_RESTART flag to sigaction for SIGVTALRM periodic interrupt
* LOCK_X_UPDATE is no longer needed and should not be defined by default for Solaris in version.h
"warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning" [-Wextra-semi-stmt]
occurred 254 times in xc.c when warnings were turned up.
Review this commit with "git diff -w ..." to make it easier to see changes other than indentation caused by
the addition of do { ... } while (0) around many macro definition bodies.
This was a machine running SunOS 4, which we no longer support.
It had an odd display controller and a compiler with issues that
required workarounds. Those compiler issues aren't an issue in
today's world, so we don't need to keep the workarounds present
for reference.
It had a bit of inline assembly, but that is still present in
other files for other platforms.
We no longer need to run a separate peephole optimization pass over the
compiler generated or hand-coded assembler for SunOS3 and SunOS4 on 68K or SPARC
We remove the preprocessor symbols and code controlled by them
SUN4_OS4_IL
SUN3_OS3_IL
SUN3_OS4_IL
and SUN3_OS3_OR_OS4_IL
Previously, we had a global `optable`, an alias to it, `table`,
and code to initialize it within `dispatch()`. This code would
initialize the whole thing to either `op_ufn` or `native_check`
and then fill in the entries for the individual opcodes.
Now, we have a function-static `optable` which is statically
initialized and placed (by the compiler) into read-only storage.
This eliminates having generated code within `dispatch()` that
initializes it.
Additionally, it was previously 512 elements long with the second
half of it being all `native_check` entries. We index it with a
byte though, so we only need 256 entries, and we can lose the
`native_check` stuff.
This no longer had anything to do with profiling and was
only doing some defines for the switch case block addresses,
which we no longer need since there's no longer optional
asm generated for them.
This feature was controlled by the compilation flag `OPDISP`
which would enable some bits of assembler on the x86 (ISC or DOS)
or some other specialized code on SPARC. On SPARC hardware, there
was a special compilation process that would preprocess the code
and generate dispatch tables.
We do this now when this feature is enabled using gcc's computed
gotos feature. This is available in clang and some other compilers.
Notably, it isn't present in Visual Studio.
This doesn't decrease our portability at all as this feature is
optional and it replaces specialized assembler code with C using
compiler extensions (making it cross-platform).
In doing this, we've removed a bunch of related code, however,
it is likely that other pieces yet remain and will be removed
in subsequent commits as we clean things up and refine them.
This feature remains disabled by default for now.
* Delete code related to NATIVETRAN feature.
This was obsolete work that had been done for generating
native code from the bytecode.
ClosesInterlisp/medley#89.
* Remove unused SaveD6.
This removes SYSVSIGNALS as we're always and only using POSIX
signals now.
Some platform differences have been papered over. We used to
only ignore SIGPIPE when using BSD signals, but we now ignore
it all the time.
While the SIGFPE code will now compile, it hasn't been updated
to work on modern OSes fully yet as it will need to enable
the correct FP exceptions.
This flag was for SunOS 3 and 4 on sun3 hardware (68k).
It enabled some unsafe optimizations via assembler. This hasn't
actually been built since the DOS port (since the header for this
was renamed, but the code in `xc.c` wasn't updated).
The optimizations here made assumptions that were specific to the
68k hardware and register allocation. They aren't likely to be
of much use moving forward, and we've got plenty of safe performance
improvements from the last 30 years of hardware advances.
* Remove static char *id = from all source files.
The same information is included in a comment in each source file.
* Remove unused template file 'id'
This also removes support for the DEC3100 keyboard, but leaves a
constant behind for it as I'm not sure about re-numbering.
[NBriggs: keyboard type numbers are stored within all sysouts. Do not renumber supported keyboards, do not reuse previously used keyboard numbers]
This also involves removing unnecessary forward declarations, inserting
includes for all cross-file function references, making some definitions
static if they are not otherwise used, correcting errors that were exposed
by having correct prototypes.
new file: inc/allocmdsdefs.h
new file: inc/arith2defs.h
new file: inc/arith3defs.h
new file: inc/arith4defs.h
new file: inc/array2defs.h
new file: inc/array3defs.h
new file: inc/array4defs.h
new file: inc/array5defs.h
new file: inc/array6defs.h
new file: inc/arraydefs.h
new file: inc/bbtsubdefs.h
new file: inc/bindefs.h
new file: inc/bindsdefs.h
new file: inc/bitbltdefs.h
new file: inc/bltdefs.h
new file: inc/byteswapdefs.h
new file: inc/car-cdrdefs.h
new file: inc/chardevdefs.h
new file: inc/commondefs.h
new file: inc/conspagedefs.h
new file: inc/dbgtooldefs.h
new file: inc/dirdefs.h
new file: inc/drawdefs.h
new file: inc/dskdefs.h
new file: inc/dspifdefs.h
new file: inc/dspsubrsdefs.h
new file: inc/eqfdefs.h
new file: inc/etherdefs.h
new file: inc/findkeydefs.h
new file: inc/fpdefs.h
new file: inc/fvardefs.h
new file: inc/gc2defs.h
new file: inc/gcarraydefs.h
new file: inc/gccodedefs.h
new file: inc/gcdefs.h
new file: inc/gcfinaldefs.h
new file: inc/gchtfinddefs.h
new file: inc/gcmain3defs.h
new file: inc/gcoflowdefs.h
new file: inc/gcrcelldefs.h
new file: inc/gcrdefs.h
new file: inc/gcscandefs.h
new file: inc/gvar2defs.h
new file: inc/hacksdefs.h
new file: inc/hardrtndefs.h
new file: inc/inetdefs.h
new file: inc/initdspdefs.h
new file: inc/initkbddefs.h
new file: inc/initsoutdefs.h
modified: inc/inlineC.h
new file: inc/intcalldefs.h
new file: inc/kbdsubrsdefs.h
new file: inc/keyeventdefs.h
new file: inc/keylibdefs.h
new file: inc/kprintdefs.h
new file: inc/ldsoutdefs.h
new file: inc/lineblt8defs.h
new file: inc/lisp2cdefs.h
modified: inc/lispemul.h
new file: inc/llcolordefs.h
new file: inc/llstkdefs.h
modified: inc/lnk-inlineC.h
new file: inc/loopsopsdefs.h
new file: inc/lowlev1defs.h
new file: inc/lowlev2defs.h
new file: inc/lsthandldefs.h
new file: inc/maindefs.h
new file: inc/misc7defs.h
new file: inc/miscndefs.h
new file: inc/mkatomdefs.h
new file: inc/mkcelldefs.h
new file: inc/mvsdefs.h
new file: inc/osmsgdefs.h
new file: inc/perrnodefs.h
new file: inc/returndefs.h
new file: inc/rpcdefs.h
new file: inc/rplconsdefs.h
new file: inc/shiftdefs.h
new file: inc/storagedefs.h
new file: inc/subr0374defs.h
new file: inc/subrdefs.h
new file: inc/sxhashdefs.h
new file: inc/testtooldefs.h
new file: inc/timerdefs.h
new file: inc/typeofdefs.h
new file: inc/ubf1defs.h
new file: inc/ubf2defs.h
new file: inc/ubf3defs.h
new file: inc/ufsdefs.h
new file: inc/unixcommdefs.h
new file: inc/unwinddefs.h
new file: inc/uraiddefs.h
new file: inc/usrsubrdefs.h
new file: inc/uutilsdefs.h
new file: inc/vars3defs.h
new file: inc/vmemsavedefs.h
new file: inc/xbbtdefs.h
new file: inc/xcdefs.h
new file: inc/xcursordefs.h
new file: inc/xinitdefs.h
new file: inc/xlspwindefs.h
new file: inc/xmkicondefs.h
new file: inc/xrdoptdefs.h
new file: inc/xscrolldefs.h
new file: inc/xwinmandefs.h
new file: inc/z2defs.h
modified: src/allocmds.c
modified: src/arith2.c
modified: src/arith3.c
modified: src/arith4.c
modified: src/array.c
modified: src/array2.c
modified: src/array3.c
modified: src/array4.c
modified: src/array5.c
modified: src/array6.c
modified: src/bbtsub.c
modified: src/bin.c
modified: src/binds.c
modified: src/bitblt.c
modified: src/blt.c
modified: src/byteswap.c
modified: src/car-cdr.c
modified: src/chardev.c
modified: src/common.c
modified: src/conspage.c
modified: src/dbgtool.c
modified: src/dir.c
modified: src/draw.c
modified: src/dsk.c
modified: src/dspif.c
modified: src/dspsubrs.c
modified: src/eqf.c
modified: src/ether.c
modified: src/findkey.c
modified: src/foreign.c
modified: src/fp.c
modified: src/fvar.c
modified: src/gc.c
modified: src/gc2.c
modified: src/gcarray.c
modified: src/gccode.c
modified: src/gcfinal.c
modified: src/gchtfind.c
modified: src/gcmain3.c
modified: src/gcoflow.c
modified: src/gcr.c
modified: src/gcrcell.c
modified: src/gcscan.c
modified: src/gvar2.c
modified: src/hacks.c
modified: src/hardrtn.c
modified: src/inet.c
modified: src/initdsp.c
modified: src/initkbd.c
modified: src/initsout.c
modified: src/intcall.c
modified: src/kbdsubrs.c
modified: src/keyevent.c
modified: src/keylib.c
modified: src/kprint.c
modified: src/ldsout.c
modified: src/lineblt8.c
modified: src/lisp2c.c
modified: src/llcolor.c
modified: src/llstk.c
modified: src/loopsops.c
modified: src/lowlev1.c
modified: src/lowlev2.c
modified: src/lsthandl.c
modified: src/main.c
modified: src/misc7.c
modified: src/miscn.c
modified: src/mkatom.c
modified: src/mkcell.c
modified: src/mvs.c
modified: src/osmsg.c
modified: src/perrno.c
modified: src/return.c
modified: src/rpc.c
modified: src/rplcons.c
modified: src/setsout.c
modified: src/shift.c
modified: src/storage.c
modified: src/subr.c
modified: src/subr0374.c
modified: src/sxhash.c
modified: src/testtool.c
modified: src/timer.c
modified: src/truecolor.c
modified: src/tstsout.c
modified: src/typeof.c
modified: src/ubf1.c
modified: src/ubf2.c
modified: src/ubf3.c
modified: src/ufn.c
modified: src/ufs.c
modified: src/unixcomm.c
modified: src/unwind.c
modified: src/uraid.c
modified: src/usrsubr.c
modified: src/uutils.c
modified: src/vars3.c
modified: src/vmemsave.c
modified: src/xbbt.c
modified: src/xc.c
modified: src/xcursor.c
modified: src/xinit.c
modified: src/xlspwin.c
modified: src/xmkicon.c
modified: src/xrdopt.c
modified: src/xscroll.c
modified: src/xwinman.c
modified: src/z2.c
Update files that depend on conspage functions to include conspage.h
Declare as static all functions in conspage.c that are not needed externally.
Add dependencies to makefile.
modified: bin/makefile-darwin.386-x
modified: bin/makefile-tail
new file: inc/conspage.h
modified: src/conspage.c
modified: src/mvs.c
modified: src/rplcons.c
modified: src/xc.c
modified: src/z2.c