1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-18 17:07:24 +00:00

12 Commits

Author SHA1 Message Date
Nick Briggs
1c6d366e3c Catch more pointer problems in NativeAligned4FromLAddr 2023-07-22 15:37:14 -07:00
Nick Briggs
937a003bfb Correct format specification for printing DLword StackOffset (%tx -> %hx) 2023-02-17 17:01:27 -08:00
Nick Briggs
b85e7cac80 Use (void *) casts in adr68k.h functions, after ensuring correct pointer alignment, to eliminate spurious alignment warnings. 2023-02-17 17:01:27 -08:00
Nick Briggs
871bf5459c Fix a couple of sign-conversion warnings (int to LispPTR) in adr68k.h 2023-02-17 17:01:27 -08:00
Nick Briggs
c2070d9892 Remove definitions of Addr68k/StkOffset macros which have been replaced by inline functions. 2022-09-28 15:21:50 -07:00
Nick Briggs
d4226c20f2 Replace Addr68k related macros with NativeAligned inline functions
Addr68k_from_LADDR always produced a 2-byte aligned pointer which
  was frequently cast to a type requiring 4-byte alignment.
  This commit changes Addr68k_from_LADDR uses to one of two new
  inline procedures, NativeAligned2FromLAddr or NativeAligned4FromLAddr,
  which produce a result with the appropriate alignment for the context.
  This permits checking for cases where the Lisp address is not
  appropriately aligned for the usage context, and localizes compiler
  warnings to these two procedures.

  Similarly, the Addr68k_from_StkOffset macros are replaced by
  NativeAligned2FromStackOffset and NativeAligned4FromStackOffset.

  NativeAligned4FromLPage replaces Addr68k_from_LPAGE as page address
  will always be at least 4-byte aligned.

  LAddrFromNative, LPageFromNative, and StackOffsetFromNative complete
  the set, replacing LADDR_from_68k, LPAGE_from_68k, and
  StkOffset_from_68K (note K not k) respectively.
2022-09-01 14:11:54 -07:00
Nick Briggs
889adcaa35 Add NativeAligned4FromStackOffset() and LPageFromNative() before using them 2022-09-01 12:53:24 -07:00
Nick Briggs
215a22ea9f Introduce functions to convert between lisp addresses and native pointers
Instead of using a single macro that converts from a lisp pointer to
  a native pointer to a 2-byte aligned item then perhaps casting to objects
  that require 4-byte alignment... use separate functions for 2-byte and
  4-byte aligned pointer results.  The clients should be explicit about
  which alignment they require, and the conversion functions can check
  (perhaps in DEBUG mode) that the resulting pointer is on an appropriate
  boundary.

  This commit defines the functions but does not introduce any uses.
2022-09-01 12:53:23 -07:00
Nick Briggs
36ccd9a5f5
warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses] (#374)
Except where the expansion would be syntactically invalid,
for example "goto macroarg;" detection of which is a bug in clang-tidy,
so warn it off with a NOLINT...(bugprone-macro-parentheses)
2021-03-20 16:31:23 -07: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
a093d80fa5
Add include guards to all the include files in inc/ which were missing them. (#189)
As a prerequisite for cleaning up some other include issues, all the
include files in inc/ should have an include guard.  All the xxxdefs.h
were created with them, but most older files were not.
2021-01-07 03:06:42 +00:00
Nick Briggs
de170a64d9 Maiko sources matching state as of 020102 prior to initial patching for Mac OSX 2015-04-20 18:53:52 -07:00