mirror of
https://github.com/Interlisp/maiko.git
synced 2026-04-06 05:02:57 +00:00
Compare commits
6 Commits
debug-arra
...
maiko-2308
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fce08f92c | ||
|
|
2c55f7923c | ||
|
|
b441a28c34 | ||
|
|
09e73d4153 | ||
|
|
8e43a393bd | ||
|
|
4a9f5500c4 |
@@ -18,7 +18,7 @@ ENDIF()
|
|||||||
|
|
||||||
find_program(
|
find_program(
|
||||||
CLANG_TIDY_EXE
|
CLANG_TIDY_EXE
|
||||||
NAMES "clang-tidy" "clang-tidy13" "clang-tidy12" "clang-tidy11" "clang-tidy10"
|
NAMES "clang-tidy" "clang-tidy16" "clang-tidy15" "clang-tidy14" "clang-tidy13" "clang-tidy12" "clang-tidy11" "clang-tidy10"
|
||||||
DOC "Path to clang-tidy executable"
|
DOC "Path to clang-tidy executable"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -41,6 +41,10 @@ SET(MAIKO_DEFINITIONS
|
|||||||
"-DRELEASE=351"
|
"-DRELEASE=351"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SET(MAIKO_INIT_DEFINITIONS
|
||||||
|
"-DRELEASE=351" "-DINIT" "-DNOVERSION"
|
||||||
|
)
|
||||||
|
|
||||||
OPTION(MAIKO_DISPLAY_X11 "Use X11 for display." ON)
|
OPTION(MAIKO_DISPLAY_X11 "Use X11 for display." ON)
|
||||||
OPTION(MAIKO_DISPLAY_SDL "Use SDL for display." OFF)
|
OPTION(MAIKO_DISPLAY_SDL "Use SDL for display." OFF)
|
||||||
|
|
||||||
@@ -454,6 +458,18 @@ IF(MAIKO_DISPLAY_X11)
|
|||||||
TARGET_COMPILE_DEFINITIONS(ldex PUBLIC ${MAIKO_DEFINITIONS} ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
TARGET_COMPILE_DEFINITIONS(ldex PUBLIC ${MAIKO_DEFINITIONS} ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||||
TARGET_INCLUDE_DIRECTORIES(ldex PUBLIC inc)
|
TARGET_INCLUDE_DIRECTORIES(ldex PUBLIC inc)
|
||||||
TARGET_LINK_LIBRARIES(ldex ${MAIKO_LIBRARIES} ${MAIKO_DISPLAY_X11_LIBRARIES})
|
TARGET_LINK_LIBRARIES(ldex ${MAIKO_LIBRARIES} ${MAIKO_DISPLAY_X11_LIBRARIES})
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(ldeinit
|
||||||
|
src/main.c
|
||||||
|
vdate.c
|
||||||
|
${MAIKO_SRCS}
|
||||||
|
${MAIKO_HDRS}
|
||||||
|
${MAIKO_DISPLAY_X11_SRCS}
|
||||||
|
${MAIKO_DISPLAY_X11_HDRS}
|
||||||
|
)
|
||||||
|
TARGET_COMPILE_DEFINITIONS(ldeinit PUBLIC ${MAIKO_INIT_DEFINITIONS} ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(ldeinit PUBLIC inc)
|
||||||
|
TARGET_LINK_LIBRARIES(ldeinit ${MAIKO_LIBRARIES} ${MAIKO_DISPLAY_X11_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(MAIKO_DISPLAY_SDL)
|
IF(MAIKO_DISPLAY_SDL)
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
# #
|
# #
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
os=${LDEARCH:-`./config.guess`}
|
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||||
|
os=${LDEARCH:-`$SCRIPTPATH/config.guess`}
|
||||||
# o/s switch block
|
# o/s switch block
|
||||||
case "$os" in
|
case "$os" in
|
||||||
m68k-*) echo m68k ;;
|
m68k-*) echo m68k ;;
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ XFILES = $(OBJECTDIR)xmkicon.o \
|
|||||||
XFLAGS = -I/opt/X11/include -DXWINDOW
|
XFLAGS = -I/opt/X11/include -DXWINDOW
|
||||||
|
|
||||||
# OPTFLAGS is normally -O2.
|
# OPTFLAGS is normally -O2.
|
||||||
OPTFLAGS = -g -O2
|
OPTFLAGS = -O2
|
||||||
DEBUGFLAGS = -DARRAYCHECK -DDTDDEBUG # -DDEBUG -DOPTRACE
|
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351
|
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351
|
||||||
|
|
||||||
LDFLAGS = -L/opt/X11/lib -lX11 -lm
|
LDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ XFLAGS = -I/opt/X11/include -DXWINDOW
|
|||||||
|
|
||||||
# OPTFLAGS is normally -O2.
|
# OPTFLAGS is normally -O2.
|
||||||
OPTFLAGS = -O1 -g
|
OPTFLAGS = -O1 -g
|
||||||
DEBUGFLAGS = -DARRAYCHECK -DDTDDEBUG # -DDEBUG -DOPTRACE
|
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351
|
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351
|
||||||
|
|
||||||
LDFLAGS = -L/opt/X11/lib -lX11 -lm
|
LDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||||
|
|||||||
27
bin/makefile-init-openbsd.x86_64
Normal file
27
bin/makefile-init-openbsd.x86_64
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Options for OpenBSD, Intel x86_64 and X-Window
|
||||||
|
|
||||||
|
CC = clang -m64 $(CLANG_CFLAGS)
|
||||||
|
|
||||||
|
XFILES = $(OBJECTDIR)xmkicon.o \
|
||||||
|
$(OBJECTDIR)xbbt.o \
|
||||||
|
$(OBJECTDIR)dspif.o \
|
||||||
|
$(OBJECTDIR)xinit.o \
|
||||||
|
$(OBJECTDIR)xscroll.o \
|
||||||
|
$(OBJECTDIR)xcursor.o \
|
||||||
|
$(OBJECTDIR)xlspwin.o \
|
||||||
|
$(OBJECTDIR)xrdopt.o \
|
||||||
|
$(OBJECTDIR)xwinman.o
|
||||||
|
|
||||||
|
|
||||||
|
XFLAGS = -I/usr/X11R6/include -DXWINDOW
|
||||||
|
|
||||||
|
# OPTFLAGS is normally -O2.
|
||||||
|
OPTFLAGS = -O2 -g3
|
||||||
|
DFLAGS = $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||||
|
|
||||||
|
LDFLAGS = -L/usr/X11R6/lib -lX11 -lc -lm
|
||||||
|
LDELDFLAGS = -L/usr/X11R6/lib -lX11 -lc -lm
|
||||||
|
|
||||||
|
OBJECTDIR = ../$(RELEASENAME)/
|
||||||
|
|
||||||
|
default : ../$(OSARCHNAME)/ldeinit
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
os=${LDEARCH:-`./config.guess`}
|
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||||
|
os=${LDEARCH:-`$SCRIPTPATH/config.guess`}
|
||||||
case "$os" in
|
case "$os" in
|
||||||
m68k-*-amigaos) echo amigaos ;;
|
m68k-*-amigaos) echo amigaos ;;
|
||||||
sparc-sun-sunos*) echo sunos4 ;;
|
sparc-sun-sunos*) echo sunos4 ;;
|
||||||
|
|||||||
13
inc/adr68k.h
13
inc/adr68k.h
@@ -28,19 +28,11 @@
|
|||||||
*/
|
*/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
||||||
#include <execinfo.h>
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "lispemul.h"
|
#include "lispemul.h"
|
||||||
#include "lspglob.h"
|
#include "lspglob.h"
|
||||||
|
|
||||||
static inline void dobacktrace()
|
|
||||||
{
|
|
||||||
void* callstack[128];
|
|
||||||
int i, frames = backtrace(callstack, 128);
|
|
||||||
backtrace_symbols_fd(callstack, frames, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline LispPTR LAddrFromNative(void *NAddr)
|
static inline LispPTR LAddrFromNative(void *NAddr)
|
||||||
{
|
{
|
||||||
if ((uintptr_t)NAddr & 1) {
|
if ((uintptr_t)NAddr & 1) {
|
||||||
@@ -56,9 +48,8 @@ static inline DLword *NativeAligned2FromLAddr(LispPTR LAddr)
|
|||||||
|
|
||||||
static inline LispPTR *NativeAligned4FromLAddr(LispPTR LAddr)
|
static inline LispPTR *NativeAligned4FromLAddr(LispPTR LAddr)
|
||||||
{
|
{
|
||||||
if (LAddr & 1 || LAddr > 0x0FFFFFFF) {
|
if (LAddr & 1) {
|
||||||
printf("Misaligned/bad pointer in NativeAligned4FromLAddr 0x%x\n", LAddr);
|
printf("Misaligned pointer in NativeAligned4FromLAddr 0x%x\n", LAddr);
|
||||||
dobacktrace();
|
|
||||||
}
|
}
|
||||||
return (void *)(Lisp_world + LAddr);
|
return (void *)(Lisp_world + LAddr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,10 +156,8 @@ LispPTR findptrsbuffer(LispPTR ptr) {
|
|||||||
while (LAddrFromNative(bptr) != NIL) {
|
while (LAddrFromNative(bptr) != NIL) {
|
||||||
if (ptr == bptr->vmempage)
|
if (ptr == bptr->vmempage)
|
||||||
return (LAddrFromNative(bptr));
|
return (LAddrFromNative(bptr));
|
||||||
else {
|
else
|
||||||
if (bptr->sysnext & 0xF0000000) printf("findptrsbuffer: would have failed %p 0x%X\n", bptr, bptr->sysnext);
|
|
||||||
bptr = (struct buf *)NativeAligned4FromLAddr(bptr->sysnext);
|
bptr = (struct buf *)NativeAligned4FromLAddr(bptr->sysnext);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return (NIL);
|
return (NIL);
|
||||||
}
|
}
|
||||||
@@ -207,6 +205,8 @@ LispPTR checkarrayblock(LispPTR base, LispPTR free, LispPTR onfreelist) {
|
|||||||
{
|
{
|
||||||
bbase = (struct arrayblock *)NativeAligned4FromLAddr(base);
|
bbase = (struct arrayblock *)NativeAligned4FromLAddr(base);
|
||||||
btrailer = (struct arrayblock *)NativeAligned4FromLAddr(Trailer(base, bbase));
|
btrailer = (struct arrayblock *)NativeAligned4FromLAddr(Trailer(base, bbase));
|
||||||
|
bfwd = (struct arrayblock *)NativeAligned4FromLAddr(bbase->fwd);
|
||||||
|
bbwd = (struct arrayblock *)NativeAligned4FromLAddr(bbase->bkwd);
|
||||||
if (bbase->password != ARRAYBLOCKPASSWORD) {
|
if (bbase->password != ARRAYBLOCKPASSWORD) {
|
||||||
printarrayblock(base);
|
printarrayblock(base);
|
||||||
error("ARRAYBLOCK password wrong\n");
|
error("ARRAYBLOCK password wrong\n");
|
||||||
@@ -228,10 +228,7 @@ LispPTR checkarrayblock(LispPTR base, LispPTR free, LispPTR onfreelist) {
|
|||||||
} else if (!onfreelist || (bbase->arlen < MINARRAYBLOCKSIZE))
|
} else if (!onfreelist || (bbase->arlen < MINARRAYBLOCKSIZE))
|
||||||
/* Remaining tests only for free list. */
|
/* Remaining tests only for free list. */
|
||||||
return (NIL);
|
return (NIL);
|
||||||
|
else if ((bbwd->fwd != base) || (bfwd->bkwd != base)) {
|
||||||
bfwd = (struct arrayblock *)NativeAligned4FromLAddr(bbase->fwd);
|
|
||||||
bbwd = (struct arrayblock *)NativeAligned4FromLAddr(bbase->bkwd);
|
|
||||||
if ((bbwd->fwd != base) || (bfwd->bkwd != base)) {
|
|
||||||
error("ARRAYBLOCK links fouled\n");
|
error("ARRAYBLOCK links fouled\n");
|
||||||
} else {
|
} else {
|
||||||
fbl = FreeBlockChainN(bbase->arlen);
|
fbl = FreeBlockChainN(bbase->arlen);
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ retry:
|
|||||||
if (917505 == *(LispPTR *)ptr) error("N_OP_createcell E0001 error");
|
if (917505 == *(LispPTR *)ptr) error("N_OP_createcell E0001 error");
|
||||||
/* replace dtd_free with newcell's top DLword (it may keep next chain)*/
|
/* replace dtd_free with newcell's top DLword (it may keep next chain)*/
|
||||||
dtd68k->dtd_free = (*((LispPTR *)ptr)) & POINTERMASK;
|
dtd68k->dtd_free = (*((LispPTR *)ptr)) & POINTERMASK;
|
||||||
if (dtd68k->dtd_free & 0x8000001) error("bad entry on free chain(1).");
|
if (dtd68k->dtd_free & 0x8000001) error("bad entry on free chain.");
|
||||||
|
|
||||||
dtd68k->dtd_oldcnt++;
|
dtd68k->dtd_oldcnt++;
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ retry:
|
|||||||
return (tos);
|
return (tos);
|
||||||
} else {
|
} else {
|
||||||
dtd68k->dtd_free = initmdspage(alloc_mdspage(dtd68k->dtd_typeentry), dtd68k->dtd_size, NIL);
|
dtd68k->dtd_free = initmdspage(alloc_mdspage(dtd68k->dtd_typeentry), dtd68k->dtd_size, NIL);
|
||||||
if (dtd68k->dtd_free & 0x8000000) error("bad entry on free chain(2).");
|
if (dtd68k->dtd_free & 0x8000000) error("bad entry on free chain.");
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ retry:
|
|||||||
|
|
||||||
/* replace dtd_free with newcell's top DLword (it may keep next chain)*/
|
/* replace dtd_free with newcell's top DLword (it may keep next chain)*/
|
||||||
dtd68k->dtd_free = (*((LispPTR *)ptr)) & POINTERMASK;
|
dtd68k->dtd_free = (*((LispPTR *)ptr)) & POINTERMASK;
|
||||||
if (dtd68k->dtd_free & 0x8000000) error("bad entry on free chain(3).");
|
if (dtd68k->dtd_free & 0x8000000) error("bad entry on free chain.");
|
||||||
|
|
||||||
#ifdef DTDDEBUG
|
#ifdef DTDDEBUG
|
||||||
if ((dtd68k->dtd_free != 0) && (type != GetTypeNumber(dtd68k->dtd_free)))
|
if ((dtd68k->dtd_free != 0) && (type != GetTypeNumber(dtd68k->dtd_free)))
|
||||||
@@ -144,7 +144,7 @@ retry:
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
dtd68k->dtd_free = initmdspage(alloc_mdspage(dtd68k->dtd_typeentry), dtd68k->dtd_size, NIL);
|
dtd68k->dtd_free = initmdspage(alloc_mdspage(dtd68k->dtd_typeentry), dtd68k->dtd_size, NIL);
|
||||||
if (dtd68k->dtd_free & 0x8000000) error("bad entry on free chain(4).");
|
if (dtd68k->dtd_free & 0x8000000) error("bad entry on free chain.");
|
||||||
|
|
||||||
#ifdef DTDDEBUG
|
#ifdef DTDDEBUG
|
||||||
check_dtd_chain(type);
|
check_dtd_chain(type);
|
||||||
|
|||||||
@@ -531,5 +531,5 @@ void lisp_finish(void) {
|
|||||||
#ifdef DOS
|
#ifdef DOS
|
||||||
exit_host_filesystem();
|
exit_host_filesystem();
|
||||||
#endif /* DOS */
|
#endif /* DOS */
|
||||||
exit(1);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ void process_Xevents(DspInterface dsp)
|
|||||||
XNextEvent(dsp->display_id, &report);
|
XNextEvent(dsp->display_id, &report);
|
||||||
if (report.xany.window == dsp->DisplayWindow) /* Try the most important window first. */
|
if (report.xany.window == dsp->DisplayWindow) /* Try the most important window first. */
|
||||||
switch (report.type) {
|
switch (report.type) {
|
||||||
|
#ifndef INIT
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
*CLastUserActionCell68k = MiscStats->secondstmp;
|
*CLastUserActionCell68k = MiscStats->secondstmp;
|
||||||
*EmCursorX68K = (*((DLword *)EmMouseX68K)) =
|
*EmCursorX68K = (*((DLword *)EmMouseX68K)) =
|
||||||
@@ -235,6 +236,7 @@ void process_Xevents(DspInterface dsp)
|
|||||||
break;
|
break;
|
||||||
case EnterNotify: Mouse_Included = TRUE; break;
|
case EnterNotify: Mouse_Included = TRUE; break;
|
||||||
case LeaveNotify: Mouse_Included = FALSE; break;
|
case LeaveNotify: Mouse_Included = FALSE; break;
|
||||||
|
#endif
|
||||||
case Expose:
|
case Expose:
|
||||||
(dsp->bitblt_to_screen)(dsp, 0, report.xexpose.x + dsp->Visible.x,
|
(dsp->bitblt_to_screen)(dsp, 0, report.xexpose.x + dsp->Visible.x,
|
||||||
report.xexpose.y + dsp->Visible.y, report.xexpose.width,
|
report.xexpose.y + dsp->Visible.y, report.xexpose.width,
|
||||||
|
|||||||
Reference in New Issue
Block a user