mirror of
https://github.com/Interlisp/maiko.git
synced 2026-04-25 03:55:16 +00:00
Compare commits
15 Commits
fgh_makefi
...
nhb-pcap-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a4a94344a | ||
|
|
9259716e9a | ||
|
|
519c13891b | ||
|
|
ee21e482a7 | ||
|
|
bbe011c583 | ||
|
|
54c81a3762 | ||
|
|
6c20a5c635 | ||
|
|
1195048b1b | ||
|
|
7a286a8f1f | ||
|
|
034c52b86f | ||
|
|
a26cafcbda | ||
|
|
5432d73819 | ||
|
|
a074c4a3c0 | ||
|
|
cdaa7b6889 | ||
|
|
eedc8a504a |
@@ -37,9 +37,12 @@ IF(NEED_LIB_M)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
find_package(PkgConfig REQUIRED)
|
CHECK_LIBRARY_EXISTS(c strlcat "" NO_NEED_FOR_LIBBSD)
|
||||||
pkg_check_modules(LIBBSD-OVERLAY REQUIRED IMPORTED_TARGET "libbsd-overlay")
|
IF(NOT NO_NEED_FOR_LIBBSD)
|
||||||
SET(MAIKO_LIBRARIES ${MAIKO_LIBRARIES} PkgConfig::LIBBSD-OVERLAY)
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(LIBBSD-OVERLAY REQUIRED IMPORTED_TARGET "libbsd-overlay")
|
||||||
|
SET(MAIKO_LIBRARIES ${MAIKO_LIBRARIES} PkgConfig::LIBBSD-OVERLAY)
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET (MAIKO_RELEASE 351 CACHE STRING "Release version to build. Release: 115, 200, 201, 210, 300, 350, 351")
|
SET (MAIKO_RELEASE 351 CACHE STRING "Release version to build. Release: 115, 200, 201, 210, 300, 350, 351")
|
||||||
@@ -559,7 +562,9 @@ if(NOT res EQUAL 0)
|
|||||||
message(FATAL_ERROR "machinetype script failed")
|
message(FATAL_ERROR "machinetype script failed")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(release_dir "${os_ver}.${machine_type}")INSTALL(TARGETS lde DESTINATION ${release_dir})
|
set(release_dir "${os_ver}.${machine_type}")
|
||||||
|
|
||||||
|
INSTALL(TARGETS lde DESTINATION ${release_dir})
|
||||||
|
|
||||||
IF(MAIKO_DISPLAY_X11)
|
IF(MAIKO_DISPLAY_X11)
|
||||||
INSTALL(TARGETS ldex ldeinit DESTINATION ${release_dir})
|
INSTALL(TARGETS ldex ldeinit DESTINATION ${release_dir})
|
||||||
|
|||||||
@@ -8,8 +8,11 @@ ifeq ($(USE_LIBBSD),T)
|
|||||||
# Use LIBBSD - but only if glibc < 2.38
|
# Use LIBBSD - but only if glibc < 2.38
|
||||||
# Because we only need strlcat, strlcpy and friends from libbsd
|
# Because we only need strlcat, strlcpy and friends from libbsd
|
||||||
# and they are included in glibc from 2.38 on.
|
# and they are included in glibc from 2.38 on.
|
||||||
GLIBC_VERSION := $(shell ldd --version | head -1 | sed -e "s/^.*\([0-9]\.[0-9][0-9]\)/\\1/")
|
GLIBC_VERSION := $(shell getconf GNU_LIBC_VERSION | sed 's/glibc //')
|
||||||
GLIBC_CHECK := $(shell echo "$(GLIBC_VERSION) >= 2.38" | bc)
|
GLIBC_CHECK := 0
|
||||||
|
ifneq ($(GLIBC_VERSION),)
|
||||||
|
GLIBC_CHECK := $(shell echo "$(GLIBC_VERSION) >= 2.38" | bc)
|
||||||
|
endif
|
||||||
ifneq ($(GLIBC_CHECK),1)
|
ifneq ($(GLIBC_CHECK),1)
|
||||||
include linux-libbsd.mk
|
include linux-libbsd.mk
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,36 +1,33 @@
|
|||||||
# Select whether to use clang or gcc
|
# Select whether to use clang or gcc
|
||||||
# Priority
|
# Priority
|
||||||
# 1. If -DUSE_GCC or -DUSE_CLANG on command line (but not both) use the requested compiler.
|
# 1. If USE_COMPILER=gcc or USE_COMPILER=clang on make command line use the requested compiler.
|
||||||
# 2. If one compiler is installed but not the other, use the installed compiler.
|
# 2. If clang is installed use it.
|
||||||
# 3. Use clang
|
# 3. Use gcc
|
||||||
|
|
||||||
EXISTS_GCC := $(shell command -v gcc)
|
EXISTS_GCC := $(shell /bin/sh -c "command -v gcc")
|
||||||
EXISTS_CLANG := $(shell command -v clang)
|
EXISTS_CLANG := $(shell /bin/sh -c "command -v clang")
|
||||||
ifeq ($(or $(EXISTS_GCC),$(EXISTS_CLANG)),)
|
ifeq ($(or $(EXISTS_GCC),$(EXISTS_CLANG)),)
|
||||||
$(error "Cannot find compiler: neither gcc nor clang. Exiting.")
|
$(error "Cannot find compiler: neither gcc nor clang. Exiting.")
|
||||||
endif
|
endif
|
||||||
ifneq ($(and $(USE_CLANG),$(USE_GCC)),)
|
|
||||||
$(error "Cannot use both USE_CLANG=T and USE_GCC=T. Exiting.")
|
|
||||||
endif
|
|
||||||
COMPILER :=
|
COMPILER :=
|
||||||
ifdef USE_CLANG
|
ifeq ($(USE_COMPILER),clang)
|
||||||
ifeq ($(EXISTS_CLANG),)
|
ifeq ($(EXISTS_CLANG),)
|
||||||
$(error "USE_CLANG=T given, but cannot find the clang compiler. Exiting")
|
$(error "USE_COMPILER=clang, but cannot find the clang compiler. Exiting")
|
||||||
endif
|
endif
|
||||||
COMPILER := clang
|
COMPILER := clang
|
||||||
endif
|
else ifeq ($(USE_COMPILER),gcc)
|
||||||
ifdef USE_GCC
|
|
||||||
ifeq ($(EXISTS_GCC),)
|
ifeq ($(EXISTS_GCC),)
|
||||||
$(error "USE_GCC=T given, but cannot find the gcc compiler. Exiting")
|
$(error "USE_COMPILER=gcc given, but cannot find the gcc compiler. Exiting")
|
||||||
endif
|
endif
|
||||||
COMPILER := gcc
|
COMPILER := gcc
|
||||||
|
else ifneq ($(EXISTS_CLANG),)
|
||||||
|
COMPILER := clang
|
||||||
|
else
|
||||||
|
COMPILER := gcc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(COMPILER),)
|
ifeq ($(COMPILER),)
|
||||||
ifneq ($(EXISTS_CLANG),)
|
$(error "Oops. Trying to select gcc or clang but should never get here")
|
||||||
COMPILER := clang
|
|
||||||
else
|
|
||||||
COMPILER := gcc
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(COMPILER),gcc)
|
ifeq ($(COMPILER),gcc)
|
||||||
|
|||||||
@@ -65,21 +65,28 @@ typedef struct closure_type {
|
|||||||
#endif /* BIGVM */
|
#endif /* BIGVM */
|
||||||
|
|
||||||
typedef struct interrupt_state { /* Interrupt-request mask to communicate with INTERRUPTED */
|
typedef struct interrupt_state { /* Interrupt-request mask to communicate with INTERRUPTED */
|
||||||
unsigned LogFileIO : 1; /* console msg arrived to print */
|
DLword LogFileIO : 1; /* console msg arrived to print */
|
||||||
unsigned ETHERInterrupt : 1; /* 10MB activity happened */
|
DLword ETHERInterrupt : 1; /* 10MB activity happened */
|
||||||
unsigned IOInterrupt : 1; /* I/O happened (not used yet) */
|
DLword IOInterrupt : 1; /* I/O happened (not used yet) */
|
||||||
unsigned gcdisabled : 1;
|
DLword gcdisabled : 1;
|
||||||
unsigned vmemfull : 1;
|
DLword vmemfull : 1;
|
||||||
unsigned stackoverflow : 1;
|
DLword stackoverflow : 1;
|
||||||
unsigned storagefull : 1;
|
DLword storagefull : 1;
|
||||||
unsigned waitinginterrupt : 1;
|
DLword waitinginterrupt : 1;
|
||||||
unsigned nil : 8; /* mask of ints being processed */
|
DLword P_LogFileIO : 1; /* interrupts awaiting processing, cleared by Lisp */
|
||||||
|
DLword P_ETHERInterrupt : 1;
|
||||||
|
DLword P_IOInterrupt : 1;
|
||||||
|
DLword P_gcdisabled : 1;
|
||||||
|
DLword P_vmemfull : 1;
|
||||||
|
DLword P_stackoverflow : 1;
|
||||||
|
DLword P_storagefull : 1;
|
||||||
|
DLword P_waitinginterrupt : 1;
|
||||||
DLword intcharcode;
|
DLword intcharcode;
|
||||||
} INTSTAT;
|
} INTSTAT;
|
||||||
|
|
||||||
typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
||||||
unsigned pendingmask : 8;
|
DLword pendingmask : 8;
|
||||||
unsigned handledmask : 8;
|
DLword handledmask : 8;
|
||||||
DLword nil;
|
DLword nil;
|
||||||
} INTSTAT2;
|
} INTSTAT2;
|
||||||
|
|
||||||
@@ -204,21 +211,28 @@ typedef struct closure_type {
|
|||||||
|
|
||||||
typedef struct interrupt_state { /* Interrupt-request mask to communicate with INTERRUPTED */
|
typedef struct interrupt_state { /* Interrupt-request mask to communicate with INTERRUPTED */
|
||||||
DLword intcharcode;
|
DLword intcharcode;
|
||||||
unsigned nil : 8;
|
DLword P_waitinginterrupt : 1; /* interrupts awaiting processing, cleared by Lisp */
|
||||||
unsigned waitinginterrupt : 1;
|
DLword P_storagefull : 1;
|
||||||
unsigned storagefull : 1;
|
DLword P_stackoverflow : 1;
|
||||||
unsigned stackoverflow : 1;
|
DLword P_vmemfull : 1;
|
||||||
unsigned vmemfull : 1;
|
DLword P_gcdisabled : 1;
|
||||||
unsigned gcdisabled : 1;
|
DLword P_IOInterrupt : 1;
|
||||||
unsigned IOInterrupt : 1; /* I/O happened (not used yet) */
|
DLword P_ETHERInterrupt : 1;
|
||||||
unsigned ETHERInterrupt : 1; /* 10MB activity happened */
|
DLword P_LogFileIO : 1;
|
||||||
unsigned LogFileIO : 1; /* console msg arrived to print */
|
DLword waitinginterrupt : 1;
|
||||||
|
DLword storagefull : 1;
|
||||||
|
DLword stackoverflow : 1;
|
||||||
|
DLword vmemfull : 1;
|
||||||
|
DLword gcdisabled : 1;
|
||||||
|
DLword IOInterrupt : 1; /* I/O happened (not used yet) */
|
||||||
|
DLword ETHERInterrupt : 1; /* 10MB activity happened */
|
||||||
|
DLword LogFileIO : 1; /* console msg arrived to print */
|
||||||
} INTSTAT;
|
} INTSTAT;
|
||||||
|
|
||||||
typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
||||||
DLword nil;
|
DLword nil;
|
||||||
unsigned handledmask : 8;
|
DLword handledmask : 8;
|
||||||
unsigned pendingmask : 8;
|
DLword pendingmask : 8;
|
||||||
} INTSTAT2;
|
} INTSTAT2;
|
||||||
|
|
||||||
struct state {
|
struct state {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h> /* for NAME_MAX */
|
#include <limits.h> /* for NAME_MAX */
|
||||||
#include <dirent.h> /* for MAXNAMLEN */
|
#include <dirent.h> /* for MAXNAMLEN */
|
||||||
|
#include <string.h> /* for strncpy in non-BYTESWAP case */
|
||||||
#include "lispemul.h" /* for DLword */
|
#include "lispemul.h" /* for DLword */
|
||||||
#include "commondefs.h" /* for error */
|
#include "commondefs.h" /* for error */
|
||||||
|
|
||||||
|
|||||||
@@ -297,12 +297,10 @@ static int recvPacket(void) {
|
|||||||
#if defined(BYTESWAP)
|
#if defined(BYTESWAP)
|
||||||
log_debug((" recvPacket() :: byte-swapping %d bytes at %p\n", bLen, (void *)ether_buf));
|
log_debug((" recvPacket() :: byte-swapping %d bytes at %p\n", bLen, (void *)ether_buf));
|
||||||
dblwordsSwap(ether_buf, bLen);
|
dblwordsSwap(ether_buf, bLen);
|
||||||
IOPage->dlethernet[2] = bLen;
|
|
||||||
#else
|
#else
|
||||||
log_debug((" recvPacket() :: %d bytes at %p\n", bLen, (void *)ether_buf));
|
log_debug((" recvPacket() :: %d bytes at %p\n", bLen, (void *)ether_buf));
|
||||||
IOPage->dlethernet[3] = bLen;
|
|
||||||
#endif
|
#endif
|
||||||
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = blen;
|
||||||
ether_bsize = 0;
|
ether_bsize = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ int *ether_debug(void) {
|
|||||||
estat[0] = 0;
|
estat[0] = 0;
|
||||||
if (ether_fd < 0) return (NIL);
|
if (ether_fd < 0) return (NIL);
|
||||||
printf("fd %d bsize %d buf %p icb %X in %d out %d\n ", ether_fd, ether_bsize, (void *)ether_buf,
|
printf("fd %d bsize %d buf %p icb %X in %d out %d\n ", ether_fd, ether_bsize, (void *)ether_buf,
|
||||||
IOPage->dlethernet[3], ether_in, ether_out);
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB, ether_in, ether_out);
|
||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
#endif /* MAIKO_ENABLE_ETHERNET */
|
||||||
|
|
||||||
return (estat);
|
return (estat);
|
||||||
@@ -542,7 +542,7 @@ LispPTR check_ether(void) {
|
|||||||
memcpy(ðer_buf[0], &nit_buf[nitpos], fromlen);
|
memcpy(ðer_buf[0], &nit_buf[nitpos], fromlen);
|
||||||
ether_bsize = 0; /* deactivate receiver */
|
ether_bsize = 0; /* deactivate receiver */
|
||||||
ether_in++;
|
ether_in++;
|
||||||
IOPage->dlethernet[3] = fromlen;
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = fromlen;
|
||||||
DBPRINT(
|
DBPRINT(
|
||||||
("Found packet len %d, at pos %d in buflen %d.\n", fromlen, nitpos, nitlen));
|
("Found packet len %d, at pos %d in buflen %d.\n", fromlen, nitpos, nitlen));
|
||||||
nitpos += fromlen;
|
nitpos += fromlen;
|
||||||
@@ -586,7 +586,7 @@ LispPTR check_ether(void) {
|
|||||||
memcpy(ðer_buf[0], nit_buf, data.len);
|
memcpy(ðer_buf[0], nit_buf, data.len);
|
||||||
ether_bsize = 0;
|
ether_bsize = 0;
|
||||||
ether_in++;
|
ether_in++;
|
||||||
IOPage->dlethernet[3] = data.len;
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = data.len;
|
||||||
((INTSTAT *)NativeAligned4FromLAddr(*INTERRUPTSTATE_word))->ETHERInterrupt = 1;
|
((INTSTAT *)NativeAligned4FromLAddr(*INTERRUPTSTATE_word))->ETHERInterrupt = 1;
|
||||||
ETHEREventCount++;
|
ETHEREventCount++;
|
||||||
Irq_Stk_Check = Irq_Stk_End = 0;
|
Irq_Stk_Check = Irq_Stk_End = 0;
|
||||||
@@ -649,7 +649,7 @@ LispPTR get_packet(void) {
|
|||||||
memcpy(ðer_buf[0], &nit_buf[nitpos], fromlen);
|
memcpy(ðer_buf[0], &nit_buf[nitpos], fromlen);
|
||||||
ether_bsize = 0; /* deactivate receiver */
|
ether_bsize = 0; /* deactivate receiver */
|
||||||
ether_in++;
|
ether_in++;
|
||||||
IOPage->dlethernet[3] = fromlen;
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = fromlen;
|
||||||
DBPRINT(("Found packet len %d, at pos %d in buflen %d.\n", fromlen, nitpos, nitlen));
|
DBPRINT(("Found packet len %d, at pos %d in buflen %d.\n", fromlen, nitpos, nitlen));
|
||||||
nitpos += fromlen;
|
nitpos += fromlen;
|
||||||
return (ATOM_T);
|
return (ATOM_T);
|
||||||
@@ -683,7 +683,7 @@ LispPTR get_packet(void) {
|
|||||||
memcpy(ðer_buf[0], nit_buf, data.len);
|
memcpy(ðer_buf[0], nit_buf, data.len);
|
||||||
ether_bsize = 0;
|
ether_bsize = 0;
|
||||||
ether_in++;
|
ether_in++;
|
||||||
IOPage->dlethernet[3] = data.len;
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = data.len;
|
||||||
return (ATOM_T);
|
return (ATOM_T);
|
||||||
}
|
}
|
||||||
} else if (errno != EWOULDBLOCK)
|
} else if (errno != EWOULDBLOCK)
|
||||||
|
|||||||
10
src/xinit.c
10
src/xinit.c
@@ -17,6 +17,8 @@
|
|||||||
#include <stdbool.h> // for false, bool, true
|
#include <stdbool.h> // for false, bool, true
|
||||||
#include <stdio.h> // for NULL
|
#include <stdio.h> // for NULL
|
||||||
#include <stdlib.h> // for exit
|
#include <stdlib.h> // for exit
|
||||||
|
#include <fcntl.h> // for fcntl, O_ASYNC, ...
|
||||||
|
#include <unistd.h> // for getpid
|
||||||
#include "adr68k.h" // for NativeAligned4FromLAddr
|
#include "adr68k.h" // for NativeAligned4FromLAddr
|
||||||
#include "dbprint.h" // for TPRINT
|
#include "dbprint.h" // for TPRINT
|
||||||
#include "devif.h" // for (anonymous), MRegion, DspInterface, OUTER_S...
|
#include "devif.h" // for (anonymous), MRegion, DspInterface, OUTER_S...
|
||||||
@@ -248,6 +250,7 @@ DspInterface X_init(DspInterface dsp, LispPTR lispbitmap, unsigned width_hint, u
|
|||||||
unsigned depth_hint)
|
unsigned depth_hint)
|
||||||
{
|
{
|
||||||
Screen *Xscreen;
|
Screen *Xscreen;
|
||||||
|
int xfd;
|
||||||
|
|
||||||
dsp->identifier = Display_Name; /* This is a hack. The display name */
|
dsp->identifier = Display_Name; /* This is a hack. The display name */
|
||||||
/* has to dealt with in a more */
|
/* has to dealt with in a more */
|
||||||
@@ -360,5 +363,12 @@ DspInterface X_init(DspInterface dsp, LispPTR lispbitmap, unsigned width_hint, u
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
XInitImage(&dsp->ScreenBitmap);
|
XInitImage(&dsp->ScreenBitmap);
|
||||||
|
|
||||||
|
#if defined(O_ASYNC)
|
||||||
|
xfd = ConnectionNumber(dsp->display_id);
|
||||||
|
if (fcntl(xfd, F_SETOWN, getpid()) == -1) perror("X_init: fcntl F_SETOWN error");
|
||||||
|
if (fcntl(xfd, F_SETFL, fcntl(xfd, F_GETFL, 0) | O_ASYNC) == -1) perror("X_init: fcntl F_SETFL O_ASYNC error");
|
||||||
|
#endif
|
||||||
|
|
||||||
return (dsp);
|
return (dsp);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user