createcell68k(typecode) returns a pointer that is aligned for the typecode
argument. Changing the return type to "void *" puts the onus on the caller
to cast the result to an appropriately aligned object. All current uses
in the maiko source ask for 4-byte objects (TYPE_FIXP, TYPE_FLOATP).
* sort_fptovp() and twowords() can be static and are sometimes (depending on flags)
not needed at all
* roundup() macro is unused and can be removed
* maxpages can be unsigned (affects main.c)
* variables used for return values of system calls should be correctly declared
* pointers into Lisp_world should be DLword* rather than char*, and
computations must take that into account.
* ENOSPC and EDQUOT errors on write should return NOFILESPACE instead of FILECANNOTWRITE error.
Note that one might analyze the order of the variables in the bitblt inner loops and
adjust so that items accessed together are in the same cache-line.
The global variable holding the native address of the I/O page is spelled "IOPage"
The global variable "IOPage" is declared extern by "lspglob.h"
The structure pointed to by IOPage is named IOPAGE and is defined in "iopage.h"
If there is no direct reference to the IOPAGE struct do not include "iopage.h"
* Update struct DevRec methods to take a "void *" parameter
since they get called with different xxxInterface records
depending on whether they are a keyboard, mouse, or display.
Introduce GenericReturnVoid method implementation for use
where needed with DevRec methods. (see mouseif.c)
* Cast functions implementing DevRec methods as appropriate to match
the method signature.
* Update struct DspInterfaceRec methods cleardisplay,
bitblt_to_screen, mouse_invisible, and mouse_visible to declare
the parameters they require and all return unsigned long results
(though it's not clear that this is actually the correct type).
Requires updating dosmouse.c method implementations.
* Update GenericReturnT and GenericPanic method implementations
to have the signature required by the method slots they
are used in.
* Correct DOS-only section with incorrect arguments to device.exit
call for the mouse.
* Use include "dspifdefs.h" for prototypes for GenericReturnXXX method
implementations.
devif.h, mnxdefs.h:
Update MRegion to reflect that width/height are unsigned.
Update ...EventMask fields in XWINDOW section of DspInterfaceRec to match parameter
type used in XSelectInput() to which they are passed.
Add padding to explicitly align colors field (short among longs)
xbitmaps.h:
Reorder fields in LISP_CURSOR struct to avoid requiring padding for alignment
constraints, and adjust initialization to match.
Declare cursors static const.
Move Lisp_Icon from xbitmaps.h to xmkicon.c
xinit.c, xinitdefs.h
Replace bound() (xwinmandefs.h) with static inline unsigned ubound() in xinit.c
Change signature of X_init() to use unsigned values for width, height, depth.
Add casts where necessary to avoid implicit signedness conversions.
Add extern declarations for all globals defined in xinit.c
xwinman.c, xwinmandefs.h
Remove bound() from xwinmandefs.h and use static inline unsigned ubound() in xwinman.c
Change signature of lisp_Xconfigure() to use unsigned width and height parameters.
Make GravSize unsigned to match its usage context.
Add casts where necessary to avoid implicit signedness conversions.
Add missing break to correct switch case fall-through warning.
dspif.c
Change LispDisplayRequestedWidth/Height to unsigned to reflect context of use.
xlspwin.c
Eliminate declaration for unused XEvent report.
Move global variable gcv, used only locally, to local variable in the procedures where needed.
Change various variables used in width/height calculation to unsigned to match usage context.
Add casts where necessary to avoid implicit signedness conversions.
xmkicon.c
Move Lisp_Icon from xbitmaps.h to xmkicon.c.
Move global XImage IconImage to local in function where it is required.
Add cast where necessary to avoid implicit signedness conversions.
xrdopt.c
Remove incorrect casts for signedness causing implicit sign conversion warnings.
Add extern declarations for all globals defined in xrdopt.c
xscroll.c
Replace bound() (xwinmandefs.h) with static inline signed sbound() in xscroll.c
initdsp.c, initdspdefs.h
Change signedness of various display variables from int to unsigned.
Change signature of init_display2() to unsigned display_max.
Add extern declarations for some globals defined in initdsp.c
xbbt.c
Add explicit casts for type warnings from MRegion width/height change.
Add explicit casts for type warnings in arguments to XPutImage().
word_swap_page() should only touch each 32-bit word once to change
the byte order from ABCD to DCBA rather than twice doing a transform
of the entire region from ABCD to BADC and then again to DCBA
The compiler provided ntohl() usually gets favorable optimizations
applied, so use it for the byte reordering.
With word_swap_page() rewritten, byte_swap_word() is superfluous.
* added support for XNS networking via Dodo-Nethub
* NetHub connection now optional (only if -nh-host is given); released NetHub-related changes to 'ether.c' to the public domain
* Added file using-dodo-networking-with-maiko.md
Documentation for building and using the Dodo-networking addition to Maiko
* Added support for running Maiko unter cygwin/x86_64-x
* Migrate Addr68k/NativeAlignment{2,4} in Nethub code, move timer/async defines to platform.h
* added missing include <netinet/in.h> for FreeBSD
* updated 'compile-flags' with added flags
* splitted ether.c in 3 (_common, _sunos, _nethub)
* reworks/modifications for nbriggs' pull-request review comments
* addintional additions for nbriggs' pull-request review comments
* get the Lisp packet lengths with 'LispInt2CInt'
* renamed variables in dblwordsSwap to indicate it's about double-words
* fixed wrong preprocessor directive unnoticed by clang
* added networking choice option to cmake build, fix to printf warning
- for cmake specify the networking to use with -DMAIKO_NETWORK_TYPE=<type>
- with <type> one of: NONE, SUN_DLPI, SUN_NIT, NETHUB
- e.g.: cmake .. -DMAIKO_NETWORK_TYPE=NETHUB
* integrated improvement to sendPacket() proposed by nbriggs
* integrated fix for SIGBUS on 32-bit big-endian, provided by nbriggs
* MAIKO_ENABLE_ETHERNET should not be unconditionally set on Solaris systems
* Receiving an ethernet packet is an ether interrupt but not an i/o interrupt.
Co-authored-by: dev hawala <devhawala@x.y>
Co-authored-by: Nick Briggs <nicholas.h.briggs@gmail.com>
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.