1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-13 23:27:12 +00:00

33 Commits

Author SHA1 Message Date
Nick Briggs
aa4df518a1
Release 201 corrections (#510)
* Fix compilation for maiko version 201

Version 201 does not have BIGVM, so SWA_FNHEAD requires swapx
which is defined in byteswapdefs.h

* Fix compilation for maiko version 201

Version 201 did not have NEWCDRCODING, so the implementation of
N_OP_rplcons requires definitions from gcdata.h and address.h

* Set up makeright etc. to allow for easier compilation of alternate versions

The makeright script and the makefile-* slices it depends are modified
to allow easily specifying the RELEASE version number of the Maiko emulator
to be built.  The default version remains 351, but can be changed with e.g.

RELEASE=201 ./makeright x

The object directories and executables are NOT named with the version.

* Remove unnecessary include of gcdata.h from bbtsub.c

* Users of gcdata.h should include gchtfinddefs.h explicitly if they use gcdata.h macros

* Correct modify_big_reference_count entry parameter type to reflect dependence on GCENTRY size differences between releases

* Add MAIKO_RELEASE to CMake options for building
2024-09-01 16:26:30 -07:00
Nick Briggs
377a6f3f47
Rewrite keyboard and async I/O handling to improve performance and reduce dependency on async I/O signals (#392)
* 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
2021-09-02 12:42:51 -07:00
Nick Briggs
e957e331c4
Lock X updates for all systems and lock around X cleanup at exit (#391)
* Lock X updates for all systems and lock around X cleanup at exit

All systems which could generate I/O interrupts on the X file descriptor need
to have locking enabled, or there is a high probability that the X library
will deadlock. This requirement may be removed in the future with restructuring
of the way that the interrupt driven I/O is handled.

Ensure that the appropriate XLOCK/XUNLOCK is done around the X window
closing code.

* Also lock X updates when building with CMake.
2021-08-26 16:29:10 -07:00
Bruce Mitchener
ec95bb7a51
Remove OEXT from makefile system. (#336)
This was originally here to make something in the Apollo toolchain
happy, but it hasn't been needed in ages, and was inconsistently
applied.
2021-02-09 02:48:09 +00:00
Bruce Mitchener
275c5b9c13
Clean up MAIKO_HANDLE_CONSOLE_MESSAGES some. (#331)
* `LOGINT` is only useful when `MAIKO_HANDLE_CONSOLE_MESSAGES`
  is set.
* Only define some variables if `MAIKO_HANDLE_CONSOLE_MESSAGES`
  is set. Flag them as static.
* Remove setting `LOGINT` from the build system as it isn't
  needed because we aren't handling console messages.
2021-01-31 21:22:13 -08:00
Nick Briggs
261069f131
Detect byte order from preprocessor definition (#330)
Rather than having to specify or omit -DBYTESWAP in the Makefile
fragment for each system we can detect whether the system requires
byte swapping  based on the __BYTE_ORDER__ C preprocessor definition.

Update CMakeLists.txt to account for this as well.
2021-01-31 16:56:35 -08:00
Bruce Mitchener
d4cbb6c9dc
Don't enable NOPIXRECT when XWINDOW is defined. (#287)
This used to be required, but has been fixed now.
2021-01-24 18:20:13 -08:00
Bruce Mitchener
2e9776edf2
Remove OLD_CURSOR from our builds. (#284)
This is no longer used under X11, which all of our builds are using.

Closes Interlisp/medley#84.
2021-01-24 17:53:06 -08:00
Bruce Mitchener
23a244a0fa
Remove some unused variables from makefiles. (#275)
Removed are:

* `FPFLAGS`
* `INLINE`
* `INLINEFLAGS`
* `BITBLTFILE`
* `BYTESWAPFILES`

A couple of other minor cleanups were also included.
2021-01-24 04:23:02 +00:00
Bruce Mitchener
85e8cb21ec
Remove special rules for building xc.c. (#273)
This also removes the special `DISP*` flags that were used for
building some files, including `xc.c`.
2021-01-23 18:29:37 +00:00
Bruce Mitchener
979c3ad6be
Remove flags for LINUX, OPENBSD, FREEBSD, MACOSX from build system. (#261)
We now can handle these via `inc/maiko/platform.h` and the
constants defined there.

This doesn't change `OS5` for Solaris yet as that's a much wider
set of changes.
2021-01-20 23:38:15 -08:00
Bruce Mitchener
db6b351397
Remove FORKCOMM define. (#238)
This code path was followed everywhere except DOS, so remove
it from the build system, and adjust the code.
2021-01-18 22:12:41 -08:00
Bruce Mitchener
5a8f20c0ca
Default NOFORN to defined. (#209)
The NOFORN flag controls foreign function interface code, which
was written using the dld_* APIs which haven't existed in years.

There was a GNU dld that provided this API, but it was withdrawn
in 2006.

If this code is to be re-enabled, it will have to be changed to
use the `dlopen` family of APIs.
2021-01-11 18:17:42 -08:00
Bruce Mitchener
01926fc232
NEW_STORAGE is no longer new. (#135)
* Always follow NEW_STORAGE code paths.

This removes the code paths for the pre-NEW_STORAGE code.

* Remove NEW_STORAGE from build system.

The code no longer refers to `NEW_STORAGE`, so we can remove
this from the build system.
2020-12-28 10:10:43 -08:00
Bruce Mitchener
9a21f5339a
Remove XV11R4 and related defines. (#113)
We no longer have anything predicated upon the version of X11 that
we're using (and these versions are all ancient anyway).
2020-12-21 22:11:39 -08:00
Bruce Mitchener
810e33125b
Update how we configure gcc / clang command lines. (#103)
* Move clang/gcc options into makefile-header.

This puts all of the shared options into a single place so that
we can easily update it.

* Add -fwrapv to the clang/gcc command lines.

This is a step along the way to fixing interlisp/medley#90.

Enabling `-fwrapv` will let overflow checks that rely upon undefined
behavior to work correctly. Without this, with modern versions of
clang and gcc, the overflow checks in the C code are eliminated
by the compiler, resulting in incorrect behavior on the part of
Maiko.

See the linked bug for details and discussion.

Hopefully, this usage of `-fwrapv` will go away once we're using
the correct compiler builtins to detect and handle overflow
correctly.
2020-12-19 20:16:31 -08:00
Bruce Mitchener
d4f72d96e1
Remove FSERROR define as it is always on. (#96)
The FSERROR define is on all the time now. It was not controlling
all of the functionality, with many places setting Lisp_errnno
outside of the code controlled by the define.
2020-12-17 09:33:20 -08:00
Bruce Mitchener
c728571c5f
Remove commented out CLXFLAGS from non-SunOS makefiles. (#83)
CLX was an alternate client library for X11, isn't really supported
by Maiko, and is unlikely to be in the future on these platforms.
2020-12-16 10:53:38 -08:00
Nick Briggs
6a336a186e
macOS installation of XQuartz when SIP is enabled does not link /usr/X11 to /opt/X11 (#73) 2020-12-15 13:07:18 -08:00
Bruce Mitchener
433a659063
Require termios on Unix. (#61)
Remove the USETERMIOS preprocessor definition as well.
2020-12-15 08:05:59 -08:00
Nick Briggs
cfc0046675 Rename gc.h to gcdata.h to avoid conflict with Boehm GC system include file, and adjust sources.
Remove duplicate external function definitions from gcdata.h

	renamed:    inc/gc.h -> inc/gcdata.h
	modified:   src/array2.c
	modified:   src/array4.c
	modified:   src/array6.c
	modified:   src/asmbbt.c
	modified:   src/asmbitblt.c
	modified:   src/bbtsub.c
	modified:   src/car-cdr.c
	modified:   src/conspage.c
	modified:   src/fvar.c
	modified:   src/gc.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/initsout.c
	modified:   src/loopsops.c
	modified:   src/mkcell.c
	modified:   src/rplcons.c
	modified:   src/storage.c
	modified:   src/xc.c
	modified:   src/z2.c
2020-09-05 16:39:21 -07:00
Nick Briggs
5c916cffb5 Remove obsoleted include files (replaced by xxxdefs.h files) and adjust dependencies in makefiles
modified:   bin/makefile-darwin.386-x
	modified:   bin/makefile-darwin.x86_64-x
	modified:   bin/makefile-init.386
	modified:   bin/makefile-sunos5.386-x
	modified:   bin/makefile-tail
	deleted:    inc/car-cdr.h
	deleted:    inc/chardev.h
	deleted:    inc/conspage.h
	deleted:    inc/dir.h
	deleted:    inc/dsk.h
	deleted:    inc/dspsubrs.h
	deleted:    inc/llstk.h
	deleted:    inc/storage.h
	deleted:    inc/ufs.h
	deleted:    inc/uraid.h
2020-09-05 12:59:08 -07:00
Nick Briggs
cd4c59dbb3 Be clear that the code depends on the default char being unsigned.
Be clear that the code is not clean for pointer aliasing.

	modified:   bin/makefile-darwin.386-x
	modified:   bin/makefile-darwin.x86_64-x
	modified:   bin/makefile-linux.386-x
	modified:   bin/makefile-linux.armv7l-x
	modified:   bin/makefile-linux.x86_64-x
	modified:   bin/makefile-sunos5.386-x
2020-08-21 12:18:03 -07:00
Nick Briggs
2a79b5e782 Turn down the compiler warnings for normal builds on macOS
Separate out the DEBUGFLAGS for compilation
Add ldex to the default targets
2020-07-16 20:41:50 -07:00
Nick Briggs
9772948e31 Change default to build 64-bit binaries for compatability with macOS Catalina and forward
modified:   bin/makefile-darwin.386-x
2020-07-13 19:19:51 -07:00
Nick Briggs
2563b05dc1 Change to default unsigned char for compilation. Possible after previous fixes to GETBYTE et al. 2018-11-15 16:14:24 -08:00
Nick Briggs
35b4ad4350 Fix ups for new llstk.h.
modified:   bin/makefile-darwin.386-x
	modified:   bin/makefile-tail
	new file:   inc/llstk.h
	modified:   src/gcfinal.c
	modified:   src/hardrtn.c
	modified:   src/llstk.c
	modified:   src/uraid.c
	modified:   src/xc.c
	modified:   src/xc.c.orig
2017-06-30 17:42:46 -07:00
Nick Briggs
0371f19167 Create conspage.h to declare functions defined in conspage.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
2017-06-29 22:33:35 -07:00
Nick Briggs
cfd0711a73 Create car-cdr.h to declare functions defined in car-cdr.c
Update files that depend on car-cdr functions to include car-cdr.h.
    Add dependencies to makefile.

	modified:   makefile-darwin.386-x
	modified:   makefile-init.386
	modified:   makefile-tail
	new file:   ../inc/car-cdr.h
	modified:   ../src/bbtsub.c
	modified:   ../src/car-cdr.c
	modified:   ../src/dsk.c
	modified:   ../src/gcarray.c
	modified:   ../src/gcrcell.c
	modified:   ../src/kprint.c
	modified:   ../src/loopsops.c
	modified:   ../src/lsthandl.c
	modified:   ../src/mvs.c
	modified:   ../src/storage.c
	modified:   ../src/sxhash.c
	modified:   ../src/vars3.c
	modified:   ../src/xc.c
	modified:   ../src/z2.c
2017-06-29 22:24:33 -07:00
Nick Briggs
e84246e1a8 Clean up compiler options, use gcc89 standard.
Remove extraneous dependencies for assembler optimized code in dispatch

	modified:   bin/makefile-darwin.386-x
2017-06-25 18:22:59 -07:00
Nick Briggs
7ef083b39b Remove unnecessary AIX define from MacOS version define. 2017-05-24 17:18:05 -07:00
Nick Briggs
f6a6440ef4 Try different optimization flags, correct DFLAGS, remove -lcrypt from LDFLAGS 2017-05-21 17:37:27 -07:00
Nick Briggs
478e89cc68 recognize darwin (MacOS) as osversion and add initial makefile based on Linux 2017-05-19 17:36:24 -07:00