1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-15 04:06:19 +00:00

Merge remote-tracking branch 'no-defun-allowed/master' into incorporate-wasm-changes

This commit is contained in:
Nick Briggs
2023-12-22 19:15:28 -08:00
8 changed files with 80 additions and 0 deletions

View File

@@ -73,6 +73,11 @@ extern int ether_fd;
extern DspInterface currentdsp;
#endif /* XWINDOW */
#ifdef MAIKO_OS_EMSCRIPTEN
/* We can't touch the system clock */
#define settimeofday(tv, tz)
#endif
#define LISP_UNIX_TIME_DIFF 29969152
#define LISP_ALTO_TIME_MASK 0x80000000
#define UNIX_ALTO_TIME_DIFF 2177452800U

View File

@@ -45,6 +45,11 @@
int flushing = 0;
#endif
#ifdef MAIKO_OS_EMSCRIPTEN
/* We don't have any shell */
#define getusershell() NULL
#endif
/* Used to communicate between Unix subprocesses and LISP */
static long StartTime; /* Time, for creating pipe filenames */

View File

@@ -33,6 +33,10 @@
#include <sys/time.h>
#endif /* DOS */
#ifdef __EMSCRIPTEN__
#include <emscripten.h> /* Defines emscripten_sleep */
#endif /* __EMSCRIPTEN__ */
#include "lispemul.h"
#include "emlglob.h"
#include "address.h"
@@ -183,6 +187,9 @@ static int pseudoTimerAsyncCountdown = MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDO
void dispatch(void) {
InstPtr pccache;
#ifdef __EMSCRIPTEN__
int cycles = 0;
#endif
#if defined(OPDISP)
static const void* optable[256] = {
@@ -261,6 +268,9 @@ op_ufn : {
/* DISPATCH "LOOP" */
nextopcode:
#ifdef __EMSCRIPTEN__
if (++cycles % 1000000 == 0) emscripten_sleep(1);
#endif
#ifdef MYOPTRACE
if ((struct fnhead *)NativeAligned4FromLAddr(0x2ed600) == FuncObj) {
quick_stack_check();