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.
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.
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)
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.
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.