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

186 Commits

Author SHA1 Message Date
Bruce Mitchener
c19b184820
Remove GetNumber. (#338)
This isn't used and if it were, it wouldn't compile. It calls
`ufn`, which doesn't get compiled in either (unless `C_ONLY`
is defined, which it isn't, and if it were, that wouldn't
compile either due to a missing `StkLim0`).

A subsequent PR will remove `ufn` and related code.
2021-02-09 03:10:38 +00:00
Nick Briggs
2aacca596b
Fix the unixfork/unixcomm code to deal with pid over 65535 (#333)
* ForkUnixShell() can be a static procedure

* Restructure SAFEREAD() to be a little clearer

* Convert unixjob type field defines to an enum and fix related unhandled switch cases.

* Use local declaration of loop variables in for-loop, removing register attributes

* Restructure SAFEREAD() to be a little clearer

* Send and receive 2 additional bytes for pid.

* Prefer standard C99 "inline" over "__inline__" for SAFEREAD
2021-02-08 18:26:56 -08:00
Nick Briggs
d482cc461c
Address older versions of C compiler which don't have __BYTE_ORDER__ (#335)
* Address older versions of C compiler which don't have __BYTE_ORDER__

* Checking for __GNUC__ is not sufficient to determine if builtins are available.

* Add makefile fragment for 32-bit PowerPC on Mac OSX build, and ignore the build directories.

* Add comment describing use of __BIG/LITTLE_ENDIAN__ definition
2021-02-06 20:51:42 -08:00
Nick Briggs
9957f5c305
Cleanup EVAL macro definition (#334)
Reformat and make use of PTRMASK & swapx() as appropriate.
It's likely that nnewframe() could be reworked to avoid needing
to unconditionally swapx() the result and, like native_newframe()
return the appropriate value as the result.
2021-02-05 00:20:26 +00: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
70db63449c
Remove support for the Sun386i. (#329)
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.
2021-01-31 04:02:40 +00:00
Nick Briggs
1f17665741
Fix off-by-one error in clipping_Xbitblt (#327)
The LowerRightX and LowerRightY were calculated as the X and Y coordinates of the
pixel to the right and below the last visible pixel, but are compared with the
last actually visible pixel in the source. They need an extra -1 offset to correct.

Add comments to explain what's going on.  Fix the signature of the function to reflect
that the "dummy" passed for the display region is a pointer not an integer.
2021-01-30 19:03:17 -08:00
Bruce Mitchener
4788031c15
Add an opcodes enum with names for each opcode. (#321)
This is based on the info in `medley/sources/LLCODE`.
2021-01-30 17:24:28 -08:00
Bruce Mitchener
b09663b3e9
Inline swapx and byte_swap_word. (#323)
This lets us remove `SWAP_WORDS` and some bits of assembly.
2021-01-29 23:18:09 -08:00
Bruce Mitchener
40aa5d392d
Remove SwitchDisplay and colordsp. (#317) 2021-01-29 19:56:07 -08:00
Nick Briggs
f7113d53ee
Remove provision for offline assembler peephole optimizations on SunOS3/4 (#304)
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
2021-01-26 16:44:40 -08:00
Bruce Mitchener
eba664771a
Fix tty.c to compile. (#180)
This removes a bit of the debug info printing, but other than
that, is pretty close to what it was before.

We also now build it in both the make and cmake build systems.
2021-01-26 17:42:17 +00:00
Bruce Mitchener
8cb1c53e3f
Remove Xbitblt.h (#302)
This unused file contained older, header-only versions of the
code in `xbbt.c`.
2021-01-25 21:55:02 -08:00
Bruce Mitchener
4a722565ab
Sprinkle some const on char * params. (#298)
This is enough to let us move `il_string` in `loopsops.c`
into read-only storage.
2021-01-25 21:04:36 -08:00
Nick Briggs
364420db88
Fix lispcmp bytecmp (#211)
* Correct signedness of 2nd parameter of lispcmp().

* Be clear that comparison of characters in bytecmp is unsigned since GETBYTE returns unsigned char.

* Make bytecmp() and lispcmp() helper functions static and removed from mkatomdefs.h.

* If no BYTESWAP we need to include <string.h> for memcmp()

* Use (uint8_t) rather than (unsigned char) in bytecmp when comparing to GETBYTE()
2021-01-25 09:57:55 -08:00
Bruce Mitchener
07aed60cc7
Remove bbtsub.h, duplicate of bbtsubdefs.h. (#294)
`bbtsubdefs.h` and `bbtsub.h` were close to the same. We only
need one.
2021-01-24 23:22:28 -08:00
Bruce Mitchener
0bcc8718de
Fix typo. (#292) 2021-01-25 07:02:47 +00:00
Nick Briggs
b151790c40
Cleanup for ERROR_EXIT/TIMER_EXIT/WARN style, remove unused typedef (#283)
Convert ERROR_EXIT, TIMER_EXIT, and WARN to "do {} while (0)" style and
  fix a few usage points that were missing trailing semi-colons.
Remove unused typedef for CFuncPtr.
2021-01-24 17:59:31 -08:00
Bruce Mitchener
db21b00a9f
Make sure OLD_CURSOR code is only for SUNDISPLAY. (#279)
This is work in progress on Interlisp/medley#84.
2021-01-24 16:58:18 -08:00
Bruce Mitchener
a45bce3133
Remove OPCODEFAIL, FIXTOS1 (#277)
These had been used on Sun3 in the ancient past, but not after
that in the current code.
2021-01-24 16:41:16 -08:00
Bruce Mitchener
cc060be1c7
Remove assembly fn call optimizations. (#276)
These were for old platforms and not used in recent history.

There's no NOASMFNCALL flag as there's no more asm fn call code.
2021-01-24 16:39:32 -08:00
Bruce Mitchener
9e9f8c4475
Remove profile.h (#272)
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.
2021-01-23 18:39:55 +00:00
Bruce Mitchener
b7e9529322
Begin to modernize optimized dispatch. (#271)
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.
2021-01-22 12:28:16 -08:00
Bruce Mitchener
61a0c02681
More SUNDISPLAY / NOPIXRECT fixes. (#269)
This fixes most of the remaining issues, apart from llcolor.
2021-01-22 11:59:11 -08:00
Bruce Mitchener
95b482d5d5
Use gcc / clang overflow builtins. (#142)
* Use gcc / clang overflow builtins.

This avoids expensive checks for overflow that employ undefined
behavior.

This is a step along the way towards replacing the old hand-written
assembler that did the same thing in terms of using the CPU's
overflow detection.

* Remove unimplemented SPARC asm for multiplication, divide, and remainder.

This wasn't implemented before, and for multiplication, it is now
implemented for gcc and friends using overflow detection.

* Remove USE_INLINE_ARITH.

Now that we have the compiler built-ins for detecting overflow,
we don't need custom assembly for it for each platform.

For now, we keep, but still don't use, the code that do a hot
path through the dispatch loop for some math. This code isn't
actually running or in use, but it is separate from how the
other inline arithmetic was being performed. These are the
`fast_op_*` functions that are implemented in assembler.
2021-01-21 00:27:31 -08:00
Bruce Mitchener
0010a02cb1
Disallow UNALIGNED_FETCH_OK on ARM, not LINUX. (#258)
UNALIGNED_FETCH_OK shouldn't be set for an entire OS, but
based on the CPU architecture.

Some ARM systems don't allow unaligned reads. x86 and x86_64
do, so update how we configure this.
2021-01-21 02:26:47 +00:00
Bruce Mitchener
addaad51fc
Remove SunOS4 removal of __inline__. (#253) 2021-01-20 17:28:06 +00:00
Bruce Mitchener
6c1bfeaf79
Use MAIKO_ARCH_SPARC rather than sparc. (#252) 2021-01-19 23:50:03 -08:00
Bruce Mitchener
85fa89ba88
Remove key checking code. (#251)
This wasn't actually hooked up any more, so it was pretty much
all dead code. The handling of this in the command line options
is gone.

In `bin/makefile-tail`, `DEVFILES` and `LIBFILES` became identical, so
`DEVFILES` went away.
2021-01-19 23:47:55 -08:00
Bruce Mitchener
0a057dec6b
Delete code related to NATIVETRAN feature. (#232)
* Delete code related to NATIVETRAN feature.

This was obsolete work that had been done for generating
native code from the bytecode.

Closes Interlisp/medley#89.

* Remove unused SaveD6.
2021-01-19 17:57:53 -08:00
Bruce Mitchener
c89b6fd611
Use the C99 floating point error code on Solaris. (#243)
Previously, we were building as C89 and the new code required
the C99 flag on Solaris with Sun Studio. Now that we build as
C99, this should work now and we can remove the special case
code.
2021-01-19 19:35:00 +00:00
Nick Briggs
26857f3131
Change icon, cursor images and masks to const uint8_t (#239)
The predefined cursors (image and mask) are better represented
as arrays of const uint8_t rather than char.  Likewise for the
window icon.  Track this change in the functions that take the
image and mask as arguments, casting only when we get to the
X library functions that take char*.
2021-01-19 10:16:08 -08:00
Bruce Mitchener
4c84412c84
Correct some ifdefs from ISC to RESWAPPEDCODESTREAM. (#227)
`RESWAPPEDCODESTREAM` was only used on ISC, so some `#ifdef`'s were
previously set up incorrectly.
2021-01-15 19:33:39 -08:00
Bruce Mitchener
3480ee9711
Fix typos. (#226) 2021-01-15 16:59:32 +00:00
Nick Briggs
ebc4a24d0b
Fix various spelling, grammatical, and punctuation errors (#222) 2021-01-13 23:08:35 -08:00
Bruce Mitchener
71a04ce117
Remove unused FileIOFlag, TimerFlag. (#221) 2021-01-13 10:58:58 -08:00
Bruce Mitchener
0fbf5e8281
Rename NOETHER to MAIKO_ENABLE_ETHERNET. (#219)
Like the renaming of NOFORN, this gets rid of some double
negatives. It also removes some patterns where we had:

```
    #ifdef NOETHER
    #else
    ...
    #endif
```

and replaces them with:

```
    #ifdef MAIKO_ENABLE_ETHERNET
    ...
    #endif
```
2021-01-13 17:54:54 +00:00
Bruce Mitchener
62a8d400ce
Use sig_atomic_t for FP_error when using FP exceptions. (#220)
`sig_atomic_t` is usually `int`, but is the typedef that one
should use for flags written to from a signal handler.
2021-01-13 17:52:53 +00:00
Bruce Mitchener
d3efbc3441
Remove HAS_GETHOSTID. (#218)
This is only true on DOS now. It was previously true on older
unsupported platforms, but they are gone now.
2021-01-12 20:10:21 -08:00
Bruce Mitchener
7145f0d380
Rename NOFORN to MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE. (#217)
This lets us get rid of double-negatives, which are confusing,
and starts a naming scheme that is easier to see when something
is a Maiko flag versus something else.
2021-01-12 20:04:23 -08:00
Bruce Mitchener
7b979dd789
Add maiko/platform.h to detect OS + CPU. (#216)
This also adds a bit to the `-info` output to say which OS and CPU
are being targeted.

This can be used in subsequent commits to drive whether or not
we need `BYTESWAP` and whether or not unaligned memory access
is okay.

We'll be able to remove per-platform defines from all of the
makefiles and cmake.
2021-01-13 03:01:49 +00:00
Bruce Mitchener
19329883d5
Add missing foreigndefs.h, includes to foreign.c. (#214) 2021-01-12 17:14:19 -08:00
Bruce Mitchener
5cb18c0710
Merge hacks.c into foreign.c. (#212)
This code was not really valid ANSI C in the way that it was
used, and it was only used by foreign.c, which is #ifdef'd out.
2021-01-11 22:45:49 -08:00
Bruce Mitchener
ec04803b53
Switch s_char uses to signed char. Remove s_char alias. (#208) 2021-01-11 19:00:33 -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
fa1adadd31
Remove SunOS 4 version of aref_switch. (#205)
When compiling for SunOS4, we would have a macro-ized version
of this function which required a slightly different call-site.

This removes all of that as it isn't used or needed.
2021-01-11 17:11:48 -08:00
Alex Segura
68d7908ee6
Support building on OpenBSD, x86-64 (#207)
* Support building on OpenBSD, x86-64

* Clean up OpenBSD Makefile

* Add OpenBSD to cmake build

* Use clang as CC for OpenBSD

Co-authored-by: Alex Segura <alex@lispm.dev>
2021-01-11 17:10:57 -08:00
Bruce Mitchener
0058cacc12
Remove I386 version of N_MakeFloat. (#204)
This used to differ, but the differences were dead code and
removed. We have no need for this extra bit of baggage.
2021-01-10 17:24:07 -08:00
Bruce Mitchener
2b5f8eae1c
Remove sysatms.h/c (#201)
The C file was empty, and the H file only had unused constants
in it.
2021-01-10 17:23:32 -08:00
Bruce Mitchener
0e3d3acd4e
Replace int_timer_on|off with int_(un)block. (#193)
Both were used, but one just called the other, so simplify
the API.
2021-01-08 21:38:54 -08:00