mirror of
https://github.com/Interlisp/maiko.git
synced 2026-03-27 02:14:15 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef32f28eb8 | ||
|
|
a04dd61a35 | ||
|
|
8e78179a50 | ||
|
|
098aa9b2af | ||
|
|
d3e8df5b1c | ||
|
|
6e38d50829 | ||
|
|
71e2d9f3e0 | ||
|
|
82577ce951 | ||
|
|
2509a796ce | ||
|
|
cdffa541ef | ||
|
|
f5b17b0e63 | ||
|
|
c2070d9892 | ||
|
|
344351acba |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-11, ubuntu-22.04, ubuntu-18.04]
|
os: [macos-11, macos-12, ubuntu-22.04, ubuntu-20.04]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install X11 dependencies on MacOS
|
- name: Install X11 dependencies on MacOS
|
||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-11, ubuntu-22.04, ubuntu-20.04, ubuntu-18.04]
|
os: [macos-11, macos-12, ubuntu-22.04, ubuntu-20.04]
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -72,10 +72,30 @@ IF(MAIKO_DISPLAY_X11)
|
|||||||
)
|
)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
# according to: https://cmake.org/pipermail/cmake/2016-October/064342.html
|
||||||
|
# the following 2 lines should produce a dropdown-box in the cmake-gui
|
||||||
|
# but this will happen only after running the command line version of cmake,
|
||||||
|
# possibly after "clearing the cache" (i.e. starting with a fresh build directory)
|
||||||
|
SET(MAIKO_NETWORK_TYPE NONE CACHE STRING "Type of networking to use: one of: NONE, SUN_DLPI, SUN_NIT, NETHUB")
|
||||||
|
SET_PROPERTY(CACHE MAIKO_NETWORK_TYPE PROPERTY STRINGS NONE SUN_DLPI SUN_NIT NETHUB)
|
||||||
|
|
||||||
|
# configure networking implementation to use
|
||||||
|
IF(MAIKO_NETWORK_TYPE STREQUAL "NETHUB")
|
||||||
|
LIST(APPEND MAIKO_DEFINITIONS "-DMAIKO_ENABLE_NETHUB")
|
||||||
|
MESSAGE("-- Configured for NETHUB network support")
|
||||||
|
ELSEIF(MAIKO_NETWORK_TYPE STREQUAL "SUN_DLPI")
|
||||||
|
LIST(APPEND MAIKO_DEFINITIONS "-DMAIKO_ENABLE_ETHERNET -DUSE_DLPI")
|
||||||
|
MESSAGE("-- Configured for (SunOS) DLPI networking")
|
||||||
|
ELSEIF(MAIKO_NETWORK_TYPE STREQUAL "SUN_NIT")
|
||||||
|
LIST(APPEND MAIKO_DEFINITIONS "-DMAIKO_ENABLE_ETHERNET -DUSE_NIT")
|
||||||
|
MESSAGE("-- Configured for (SunOS) NIT networking")
|
||||||
|
ELSEIF(NOT MAIKO_NETWORK_TYPE STREQUAL "NONE")
|
||||||
|
MESSAGE(WARNING "Invalid option given for MAIKO_NETWORK_TYPE, must be one of:\nNONE, SUN_DLPI, SUN_NIT, NETHUB")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||||
LIST(APPEND MAIKO_DEFINITIONS
|
LIST(APPEND MAIKO_DEFINITIONS
|
||||||
"-DOS5"
|
"-DOS5"
|
||||||
"-DUSE_DLPI"
|
|
||||||
)
|
)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -142,7 +162,9 @@ SET(MAIKO_SRCS
|
|||||||
src/dspif.c
|
src/dspif.c
|
||||||
src/dspsubrs.c
|
src/dspsubrs.c
|
||||||
src/eqf.c
|
src/eqf.c
|
||||||
src/ether.c
|
src/ether_common.c
|
||||||
|
src/ether_sunos.c
|
||||||
|
src/ether_nethub.c
|
||||||
src/findkey.c
|
src/findkey.c
|
||||||
src/foreign.c
|
src/foreign.c
|
||||||
src/fp.c
|
src/fp.c
|
||||||
|
|||||||
18
bin/compile-flags
Executable file → Normal file
18
bin/compile-flags
Executable file → Normal file
@@ -134,6 +134,24 @@ PKTFILTER True if the ethernet packets are to be filtered before being
|
|||||||
passed to the Lisp ethernet handler. Available on Sun systems
|
passed to the Lisp ethernet handler. Available on Sun systems
|
||||||
for both the NIT and DLPI cases.
|
for both the NIT and DLPI cases.
|
||||||
|
|
||||||
|
MAIKO_ENABLE_NETHUB enables the support for Dodo Nethub networking for Dodo
|
||||||
|
XNS services, see documentation: using-dodo-networking-with-maiko.md
|
||||||
|
(implicitely disables USE_DLPI and USE_NIT)
|
||||||
|
|
||||||
|
MAIKO_EMULATE_TIMER_INTERRUPTS enables emulation of recurring timer interrupts for
|
||||||
|
platforms where SIGVTALRM/ITIMER_VIRTUAL or SIGALRM/ITIMER_REAL
|
||||||
|
do not work as expected (like cygwin)
|
||||||
|
timer is emulated by signaling an interrupt after a number of
|
||||||
|
executed instructions, by default 20.000 instructions, this can be
|
||||||
|
overriden by defining MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDOWN
|
||||||
|
with the number of instructions between 2 interrupts
|
||||||
|
additionally this adds the command line arguments -intr-emu-insns
|
||||||
|
for overriding the compiled in instruction interval
|
||||||
|
(not working if OPDISP (fast opcode dispatch) is used)
|
||||||
|
|
||||||
|
MAIKO_EMULATE_ASYNC_INTERRUPTS same as MAIKO_EMULATE_TIMER_INTERRUPTS, but also
|
||||||
|
signals an I/O interrupt after each instruction interval
|
||||||
|
|
||||||
|
|
||||||
bitbltsub.c:#ifdef GETBASE
|
bitbltsub.c:#ifdef GETBASE
|
||||||
testdisplay.c:#ifdef NOTUSED
|
testdisplay.c:#ifdef NOTUSED
|
||||||
|
|||||||
0
bin/config.guess
vendored
Executable file → Normal file
0
bin/config.guess
vendored
Executable file → Normal file
0
bin/copyright
Executable file → Normal file
0
bin/copyright
Executable file → Normal file
0
bin/dbxinit.txt
Executable file → Normal file
0
bin/dbxinit.txt
Executable file → Normal file
0
bin/environment-variables
Executable file → Normal file
0
bin/environment-variables
Executable file → Normal file
0
bin/machinetype
Executable file → Normal file
0
bin/machinetype
Executable file → Normal file
@@ -1,7 +1,7 @@
|
|||||||
# Options for Linux, Intel x86_64 and X-Window
|
# Options for cygwin
|
||||||
|
|
||||||
#CC = gcc -m64 $(GCC_CFLAGS)
|
CC = gcc -m64 $(GCC_CFLAGS) -DMAIKO_ENABLE_NETHUB
|
||||||
CC = clang -m64 $(CLANG_CFLAGS)
|
# CC = clang -m64 $(CLANG_CFLAGS) -DMAIKO_ENABLE_NETHUB
|
||||||
|
|
||||||
XFILES = $(OBJECTDIR)xmkicon.o \
|
XFILES = $(OBJECTDIR)xmkicon.o \
|
||||||
$(OBJECTDIR)xbbt.o \
|
$(OBJECTDIR)xbbt.o \
|
||||||
@@ -17,7 +17,8 @@ XFILES = $(OBJECTDIR)xmkicon.o \
|
|||||||
XFLAGS = -DXWINDOW
|
XFLAGS = -DXWINDOW
|
||||||
|
|
||||||
# OPTFLAGS is normally -O2.
|
# OPTFLAGS is normally -O2.
|
||||||
OPTFLAGS = -O2 -g3
|
OPTFLAGS = -O0 -g
|
||||||
|
|
||||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||||
|
|
||||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||||
|
|||||||
0
bin/makefile-header
Executable file → Normal file
0
bin/makefile-header
Executable file → Normal file
28
bin/makefile-init-cygwin.x86_64
Normal file
28
bin/makefile-init-cygwin.x86_64
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Options for cygwin
|
||||||
|
|
||||||
|
CC = gcc -m64 $(GCC_CFLAGS) -DMAIKO_ENABLE_NETHUB
|
||||||
|
# CC = clang -m64 $(CLANG_CFLAGS) -DMAIKO_ENABLE_NETHUB
|
||||||
|
|
||||||
|
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 = -DXWINDOW
|
||||||
|
|
||||||
|
# OPTFLAGS is normally -O2.
|
||||||
|
OPTFLAGS = -O0 -g
|
||||||
|
DEBUGFLAGFLAGS =
|
||||||
|
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||||
|
|
||||||
|
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||||
|
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||||
|
|
||||||
|
OBJECTDIR = ../$(RELEASENAME)/
|
||||||
|
|
||||||
|
default : ../$(OSARCHNAME)/ldeinit
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Options for Linux, Intel x86_64 and X-Window
|
# Options for Linux, Intel x86_64 and X-Window
|
||||||
|
|
||||||
#CC = gcc -m64 $(GCC_CFLAGS)
|
#CC = gcc -m64 $(GCC_CFLAGS)
|
||||||
CC = clang -m64 $(CLANG_CFLAGS)
|
CC = clang -m64 $(CLANG_CFLAGS) -DMAIKO_ENABLE_NETHUB
|
||||||
|
|
||||||
XFILES = $(OBJECTDIR)xmkicon.o \
|
XFILES = $(OBJECTDIR)xmkicon.o \
|
||||||
$(OBJECTDIR)xbbt.o \
|
$(OBJECTDIR)xbbt.o \
|
||||||
|
|||||||
@@ -115,7 +115,9 @@ DEVICES = $(OBJECTDIR)dspsubrs.o \
|
|||||||
$(OBJECTDIR)dir.o \
|
$(OBJECTDIR)dir.o \
|
||||||
$(OBJECTDIR)keyevent.o \
|
$(OBJECTDIR)keyevent.o \
|
||||||
$(OBJECTDIR)kbdsubrs.o \
|
$(OBJECTDIR)kbdsubrs.o \
|
||||||
$(OBJECTDIR)ether.o \
|
$(OBJECTDIR)ether_common.o \
|
||||||
|
$(OBJECTDIR)ether_sunos.o \
|
||||||
|
$(OBJECTDIR)ether_nethub.o \
|
||||||
$(OBJECTDIR)tty.o \
|
$(OBJECTDIR)tty.o \
|
||||||
$(OBJECTDIR)initkbd.o
|
$(OBJECTDIR)initkbd.o
|
||||||
|
|
||||||
@@ -472,12 +474,26 @@ $(OBJECTDIR)mouseif.o: $(SRCDIR)mouseif.c $(REQUIRED-INCS) $(INCDIR)lispemul.h \
|
|||||||
$(INCDIR)dbprint.h $(INCDIR)devif.h
|
$(INCDIR)dbprint.h $(INCDIR)devif.h
|
||||||
$(CC) $(RFLAGS) $(SRCDIR)mouseif.c -o $(OBJECTDIR)mouseif.o
|
$(CC) $(RFLAGS) $(SRCDIR)mouseif.c -o $(OBJECTDIR)mouseif.o
|
||||||
|
|
||||||
$(OBJECTDIR)ether.o: $(SRCDIR)ether.c $(REQUIRED-INCS) \
|
$(OBJECTDIR)ether_common.o: $(SRCDIR)ether_common.c $(REQUIRED-INCS) \
|
||||||
$(INCDIR)commondefs.h $(INCDIR)lispemul.h \
|
$(INCDIR)commondefs.h $(INCDIR)lispemul.h \
|
||||||
$(INCDIR)lispmap.h $(INCDIR)emlglob.h $(INCDIR)lsptypes.h $(INCDIR)lspglob.h \
|
$(INCDIR)lispmap.h $(INCDIR)emlglob.h $(INCDIR)lsptypes.h $(INCDIR)lspglob.h \
|
||||||
$(INCDIR)ifpage.h $(INCDIR)iopage.h $(INCDIR)miscstat.h $(INCDIR)adr68k.h \
|
$(INCDIR)ifpage.h $(INCDIR)iopage.h $(INCDIR)miscstat.h $(INCDIR)adr68k.h \
|
||||||
$(INCDIR)ether.h $(INCDIR)dbprint.h $(INCDIR)etherdefs.h
|
$(INCDIR)ether.h $(INCDIR)dbprint.h $(INCDIR)etherdefs.h
|
||||||
$(CC) $(RFLAGS) $(SRCDIR)ether.c -o $(OBJECTDIR)ether.o
|
$(CC) $(RFLAGS) $(SRCDIR)ether_common.c -o $(OBJECTDIR)ether_common.o
|
||||||
|
|
||||||
|
$(OBJECTDIR)ether_sunos.o: $(SRCDIR)ether_sunos.c $(REQUIRED-INCS) \
|
||||||
|
$(INCDIR)commondefs.h $(INCDIR)lispemul.h \
|
||||||
|
$(INCDIR)lispmap.h $(INCDIR)emlglob.h $(INCDIR)lsptypes.h $(INCDIR)lspglob.h \
|
||||||
|
$(INCDIR)ifpage.h $(INCDIR)iopage.h $(INCDIR)miscstat.h $(INCDIR)adr68k.h \
|
||||||
|
$(INCDIR)ether.h $(INCDIR)dbprint.h $(INCDIR)etherdefs.h
|
||||||
|
$(CC) $(RFLAGS) $(SRCDIR)ether_sunos.c -o $(OBJECTDIR)ether_sunos.o
|
||||||
|
|
||||||
|
$(OBJECTDIR)ether_nethub.o: $(SRCDIR)ether_nethub.c $(REQUIRED-INCS) \
|
||||||
|
$(INCDIR)commondefs.h $(INCDIR)lispemul.h \
|
||||||
|
$(INCDIR)lispmap.h $(INCDIR)emlglob.h $(INCDIR)lsptypes.h $(INCDIR)lspglob.h \
|
||||||
|
$(INCDIR)ifpage.h $(INCDIR)iopage.h $(INCDIR)miscstat.h $(INCDIR)adr68k.h \
|
||||||
|
$(INCDIR)ether.h $(INCDIR)dbprint.h $(INCDIR)etherdefs.h
|
||||||
|
$(CC) $(RFLAGS) $(SRCDIR)ether_nethub.c -o $(OBJECTDIR)ether_nethub.o
|
||||||
|
|
||||||
$(OBJECTDIR)findkey.o: $(SRCDIR)findkey.c $(REQUIRED-INCS) \
|
$(OBJECTDIR)findkey.o: $(SRCDIR)findkey.c $(REQUIRED-INCS) \
|
||||||
$(INCDIR)lispemul.h $(INCDIR)lispmap.h \
|
$(INCDIR)lispemul.h $(INCDIR)lispmap.h \
|
||||||
|
|||||||
0
bin/makeinitlde
Executable file → Normal file
0
bin/makeinitlde
Executable file → Normal file
0
bin/makeright
Executable file → Normal file
0
bin/makeright
Executable file → Normal file
0
bin/mkvdate
Executable file → Normal file
0
bin/mkvdate
Executable file → Normal file
0
bin/osversion
Executable file → Normal file
0
bin/osversion
Executable file → Normal file
0
bin/release-one
Executable file → Normal file
0
bin/release-one
Executable file → Normal file
0
bin/start-release
Executable file → Normal file
0
bin/start-release
Executable file → Normal file
0
bin/u2dnames.sed
Executable file → Normal file
0
bin/u2dnames.sed
Executable file → Normal file
0
bin/unix2dos.sed
Executable file → Normal file
0
bin/unix2dos.sed
Executable file → Normal file
86
docs/Using-Dodo-networking-with-Maiko.md
Normal file
86
docs/Using-Dodo-networking-with-Maiko.md
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# Using Dodo-networking with Maiko
|
||||||
|
|
||||||
|
The [Dodo XNS services](https://github.com/devhawala/dodo) provide an emulation for a usable
|
||||||
|
subset of the Xerox 8000 Network Services from the 1980-ies. Dodo uses its own virtual
|
||||||
|
network infrastructure - the Dodo *Nethub* - for avoiding the problems involved with
|
||||||
|
implementing the transmission of XNS protocol packets over (real or virtual) network
|
||||||
|
adapters of the diverse contemporary operating systems.
|
||||||
|
|
||||||
|
The Dodo Nethub provides a simple virtual network, a kind of *XNS-over-TCP/IP*,
|
||||||
|
where clients and servers connect with TCP/IP to the central Nethub program, which relays all
|
||||||
|
packets ingoing from one connection to the other connections.
|
||||||
|
|
||||||
|
The following sections describe the support for Dodo-networking added to
|
||||||
|
Maiko. The Dodo Nethub support was implemented and tested with Linux on the x86_64
|
||||||
|
architecture. However as only standard system calls for TCP/IP were used, adapting to other
|
||||||
|
platforms if necessary should be possible.
|
||||||
|
|
||||||
|
This extension allows Medley 3.51 running in a Maiko VM to use the XNS services
|
||||||
|
*Clearinghouse*, *Filing* and *Printing* provided by Dodo (using the *Mail* service may
|
||||||
|
also be possible, but this was not verified so far)
|
||||||
|
|
||||||
|
## Building Maiko with Dodo-networking support
|
||||||
|
|
||||||
|
As long as Dodo-networking support is not merged into the `master`-branch
|
||||||
|
of the primary Maiko repository, this networking option is only available in this
|
||||||
|
clone of the original Maiko repository in the branch `dodo-nethub-support`.
|
||||||
|
(however: this branch should already be checked out if this file is present)
|
||||||
|
|
||||||
|
The Dodo-networking support is enabled by defining `MAIKO_ENABLE_NETHUB`
|
||||||
|
when compiling Maiko. This can be done in the Makefile for the relevant platform
|
||||||
|
(file `bin/makefile-`*platform*) for example in the line where the compiler-command
|
||||||
|
variable is defined.
|
||||||
|
|
||||||
|
This is already done in the Makefile for the *Linux-x86_64-X* platform (file
|
||||||
|
`bin/makefile-linux.x86_64-x`), where the compiler-command defined as follows:
|
||||||
|
|
||||||
|
```
|
||||||
|
CC = clang -m64 $(CLANG_CFLAGS) -DMAIKO_ENABLE_NETHUB
|
||||||
|
```
|
||||||
|
|
||||||
|
After a complete (re-)build, this Maiko VM optionally allows to connect to a Dodo Nethub
|
||||||
|
and through this to use Dodo XNS services.
|
||||||
|
|
||||||
|
|
||||||
|
## Running Maiko with Dodo-networking
|
||||||
|
|
||||||
|
With Dodo-networking support compiled in, Maiko (i.e. the program `ldex`) accepts the
|
||||||
|
following additional commandline options:
|
||||||
|
|
||||||
|
- `-nh-host` *dodo-host*
|
||||||
|
the name or IP-address of the host where the Dodo Nethub program runs; no connection to
|
||||||
|
Dodo services will be opened if this option is not specified
|
||||||
|
Default: (*none*)
|
||||||
|
|
||||||
|
- `-nh-port` *port-number*
|
||||||
|
the port which the Dodo Nethub is listening to at *dodo-host*
|
||||||
|
Default: `3333`
|
||||||
|
|
||||||
|
- `-nh-mac` *machine-id*
|
||||||
|
the machine-id (aka. MAC-address) that this Maiko VM instance will use in the Dodo network;
|
||||||
|
the machine-id must be given as 48 bit hexadecimal value with a dash as byte-separator, i.e.
|
||||||
|
in the format *XX-XX-XX-XX-XX-XX* (with *XX* the hexcode for a single byte)
|
||||||
|
Default: `CA-FF-EE-12-34-56`
|
||||||
|
|
||||||
|
- `-nh-loglevel` *log-level*
|
||||||
|
the detail level of logging to `stdout`, one of:
|
||||||
|
`0`: log only main events (connect, disconnect or the like)
|
||||||
|
`1`: log network events each with a single line
|
||||||
|
`2`: detailled log of network events
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
So by default Maiko will not connect to a Dodo nethub and behave like a "standard" version
|
||||||
|
without networking support.
|
||||||
|
To use Dodo XNS services, the option `-nh-host` must be given to specify the location
|
||||||
|
of the Dodo nethub. In the simplest (and probably most usual) case where Dodo is run on the
|
||||||
|
same machine as Maiko/Medley, the value for option `-nh-host` will be *localhost*, so
|
||||||
|
adding the option `-nh-host localhost` when starting the Medley Lisp system will allow
|
||||||
|
to use the XNS services of a Dodo system running locally.
|
||||||
|
|
||||||
|
Specifying the *machine-id* is optional unless more than one Maiko/Medley instances are to use
|
||||||
|
Dodo XNS services concurrently: in this case, each Maiko VM *must* use a *unique* machine-id,
|
||||||
|
so at most one Maiko VM may omit the `-nh-mac` option.
|
||||||
|
However, each machine-id used by the Maiko VMs should have an entry in the `machine.cfg`
|
||||||
|
file of the Dodo installation, cloning or copying the low-level SPP-configuration of the
|
||||||
|
`maiko-Lisp-One` example entry in the `machine.cfg` of the Dodo `dist.zip`
|
||||||
|
distribution.
|
||||||
22
inc/adr68k.h
22
inc/adr68k.h
@@ -86,26 +86,4 @@ static inline LispPTR LPageFromNative(void *NAddr)
|
|||||||
}
|
}
|
||||||
return (((DLword *)NAddr) - Lisp_world) >> 8;
|
return (((DLword *)NAddr) - Lisp_world) >> 8;
|
||||||
}
|
}
|
||||||
/* translate 68k ptr to Lisp DLword address */
|
|
||||||
#define LADDR_from_68k(ptr68k) ((LispPTR)(((UNSIGNED)(ptr68k) - (UNSIGNED)Lisp_world) >>1))
|
|
||||||
|
|
||||||
|
|
||||||
/* translate 68k ptr to Lisp Page number */
|
|
||||||
#define LPAGE_from_68k(ptr68k) (LADDR_from_68k(ptr68k) >> 8)
|
|
||||||
|
|
||||||
|
|
||||||
/* Translate Lisp_address to 68K address */
|
|
||||||
/* Lisp_addr: word offset */
|
|
||||||
#define Addr68k_from_LADDR(Lisp_addr) (Lisp_world + (Lisp_addr))
|
|
||||||
|
|
||||||
|
|
||||||
/* translate LispPage to 68k address */
|
|
||||||
#define Addr68k_from_LPAGE(Lisp_page) (Addr68k_from_LADDR(((Lisp_page) << 8) ))
|
|
||||||
/* Stack Offset Macros */
|
|
||||||
|
|
||||||
#define StkOffset_from_68K(ptr68k)\
|
|
||||||
((LispPTR)(((UNSIGNED)(ptr68k) - (UNSIGNED)Stackspace) >>1))
|
|
||||||
|
|
||||||
#define Addr68k_from_StkOffset(stkoffset)\
|
|
||||||
(Stackspace + (stkoffset))
|
|
||||||
#endif /* ADR68K_H */
|
#endif /* ADR68K_H */
|
||||||
|
|||||||
12
inc/bb.h
12
inc/bb.h
@@ -738,7 +738,7 @@ int srcRshift;
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
#define new_bitblt_code \
|
#define new_bitblt_code \
|
||||||
{ \
|
do { \
|
||||||
variables \
|
variables \
|
||||||
some_init \
|
some_init \
|
||||||
while (num_lines_remaining-- > 0) \
|
while (num_lines_remaining-- > 0) \
|
||||||
@@ -778,7 +778,7 @@ next_line: \
|
|||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
} /* end line loop */ \
|
} /* end line loop */ \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -791,7 +791,7 @@ next_line: \
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
#define new_gray_bitblt_code \
|
#define new_gray_bitblt_code \
|
||||||
{ \
|
do { \
|
||||||
variables \
|
variables \
|
||||||
some_init \
|
some_init \
|
||||||
while (num_lines_remaining-- > 0) \
|
while (num_lines_remaining-- > 0) \
|
||||||
@@ -803,7 +803,7 @@ do_fpt: \
|
|||||||
next_line: \
|
next_line: \
|
||||||
do_gray_advance \
|
do_gray_advance \
|
||||||
} /* end line loop */ \
|
} /* end line loop */ \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -816,7 +816,7 @@ next_line: \
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
#define new_char_bitblt_code \
|
#define new_char_bitblt_code \
|
||||||
{ \
|
do { \
|
||||||
variables \
|
variables \
|
||||||
some_init \
|
some_init \
|
||||||
while (num_lines_remaining-- > 0) \
|
while (num_lines_remaining-- > 0) \
|
||||||
@@ -828,7 +828,7 @@ do_fpt: \
|
|||||||
next_line: \
|
next_line: \
|
||||||
F_do_advance \
|
F_do_advance \
|
||||||
} /* end line loop */ \
|
} /* end line loop */ \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ extern DLword *EmCursorX68K,*EmCursorY68K;
|
|||||||
/* Macro for locking and unlocking screen to prevent multiple updates */
|
/* Macro for locking and unlocking screen to prevent multiple updates */
|
||||||
|
|
||||||
#ifdef DOS
|
#ifdef DOS
|
||||||
#define LOCKSCREEN currentdsp->device.locked++;
|
#define LOCKSCREEN currentdsp->device.locked++
|
||||||
#define UNLOCKSCREEN currentdsp->device.locked--;
|
#define UNLOCKSCREEN currentdsp->device.locked--
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define LOCKSCREEN ScreenLocked = T;
|
#define LOCKSCREEN ScreenLocked = T
|
||||||
#define UNLOCKSCREEN ScreenLocked = NIL;
|
#define UNLOCKSCREEN ScreenLocked = NIL
|
||||||
|
|
||||||
#endif /* DOS */
|
#endif /* DOS */
|
||||||
#endif /* BITBLT_H */
|
#endif /* BITBLT_H */
|
||||||
|
|||||||
@@ -10,16 +10,6 @@ static inline unsigned int swapx(unsigned int word) {
|
|||||||
return (((word >> 16) & 0xffff) | ((word & 0xffff) << 16));
|
return (((word >> 16) & 0xffff) | ((word & 0xffff) << 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************/
|
|
||||||
/* */
|
|
||||||
/* Byte-swap a single 2-byte word */
|
|
||||||
/* */
|
|
||||||
/****************************************************************/
|
|
||||||
static inline unsigned short byte_swap_word(unsigned short word) {
|
|
||||||
return ((word >> 8) | (unsigned short)((word & 0xff) << 8));
|
|
||||||
}
|
|
||||||
|
|
||||||
void byte_swap_page(unsigned short *page, int wordcount);
|
|
||||||
void word_swap_page(unsigned short *page, int longwordcount);
|
void word_swap_page(unsigned short *page, int longwordcount);
|
||||||
void bit_reverse_region(unsigned short *top, int width, int height, int rasterwidth);
|
void bit_reverse_region(unsigned short *top, int width, int height, int rasterwidth);
|
||||||
#ifdef RESWAPPEDCODESTREAM
|
#ifdef RESWAPPEDCODESTREAM
|
||||||
|
|||||||
@@ -416,11 +416,11 @@ struct cadr_cell {
|
|||||||
/* When cadr() function is called, type check should be done. */
|
/* When cadr() function is called, type check should be done. */
|
||||||
|
|
||||||
#define S_N_CHECKANDCADR(sour, dest, tos) \
|
#define S_N_CHECKANDCADR(sour, dest, tos) \
|
||||||
{ \
|
do { \
|
||||||
LispPTR parm = sour; \
|
LispPTR parm = sour; \
|
||||||
if (GetTypeNumber(parm) != TYPE_LISTP) { \
|
if (GetTypeNumber(parm) != TYPE_LISTP) { \
|
||||||
ERROR_EXIT(tos); \
|
ERROR_EXIT(tos); \
|
||||||
} else \
|
} else \
|
||||||
(dest) = cadr(parm); \
|
(dest) = cadr(parm); \
|
||||||
}
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
0
inc/copyright
Executable file → Normal file
0
inc/copyright
Executable file → Normal file
0
inc/display.h
Executable file → Normal file
0
inc/display.h
Executable file → Normal file
@@ -14,4 +14,10 @@ LispPTR check_ether(void);
|
|||||||
void init_ifpage_ether(void);
|
void init_ifpage_ether(void);
|
||||||
void init_ether(void);
|
void init_ether(void);
|
||||||
LispPTR check_sum(LispPTR *args);
|
LispPTR check_sum(LispPTR *args);
|
||||||
|
|
||||||
|
void setNethubHost(char* host);
|
||||||
|
void setNethubPort(int port);
|
||||||
|
void setNethubMac(int m0, int m1, int m2, int m3, int m4, int m5);
|
||||||
|
void setNethubLogLevel(int ll);
|
||||||
|
void connectToHub();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
40
inc/gcdata.h
40
inc/gcdata.h
@@ -48,23 +48,23 @@
|
|||||||
|
|
||||||
/* IncAllocCnt is called only when *Reclaim_cnt_word != NIL */
|
/* IncAllocCnt is called only when *Reclaim_cnt_word != NIL */
|
||||||
|
|
||||||
#define IncAllocCnt(n) {\
|
#define IncAllocCnt(n) do { \
|
||||||
if ((*Reclaim_cnt_word -= (n)) <= S_POSITIVE) { \
|
if ((*Reclaim_cnt_word -= (n)) <= S_POSITIVE) { \
|
||||||
/* time for GC */\
|
/* time for GC */ \
|
||||||
Irq_Stk_Check = Irq_Stk_End = 0;\
|
Irq_Stk_Check = Irq_Stk_End = 0; \
|
||||||
*Reclaim_cnt_word = S_POSITIVE;\
|
*Reclaim_cnt_word = S_POSITIVE; \
|
||||||
};\
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/* DecAllocCnt only called when *Reclaim_cnt_word != NIL */
|
/* DecAllocCnt only called when *Reclaim_cnt_word != NIL */
|
||||||
|
|
||||||
#define DecAllocCnt(n) { *Reclaim_cnt_word += (n); }
|
#define DecAllocCnt(n) do { *Reclaim_cnt_word += (n); } while (0)
|
||||||
|
|
||||||
#define FreeLink(link) { \
|
#define FreeLink(link) do { \
|
||||||
GETGC(link) = 0; \
|
GETGC(link) = 0; \
|
||||||
GETGC((link)+1) = GETGC(HTcoll); \
|
GETGC((link)+1) = GETGC(HTcoll); \
|
||||||
GETGC(HTcoll) = ((link) - HTcoll); \
|
GETGC(HTcoll) = ((link) - HTcoll); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
/* Given the contents of an HTMAIN or HTCOLL entry,
|
/* Given the contents of an HTMAIN or HTCOLL entry,
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
#define GetLinkptr(entry) ((entry) & 0x0fffffffe)
|
#define GetLinkptr(entry) ((entry) & 0x0fffffffe)
|
||||||
|
|
||||||
|
|
||||||
#define DelLink(link, prev, entry) { \
|
#define DelLink(link, prev, entry) do { \
|
||||||
if ((prev) != (GCENTRY *)0) \
|
if ((prev) != (GCENTRY *)0) \
|
||||||
{ \
|
{ \
|
||||||
GETGC((GCENTRY *)(prev) + 1) = GETGC((GCENTRY *)(link) + 1); \
|
GETGC((GCENTRY *)(prev) + 1) = GETGC((GCENTRY *)(link) + 1); \
|
||||||
@@ -88,41 +88,41 @@
|
|||||||
GETGC((GCENTRY *)(entry)) = GETGC((GCENTRY *)(link)); \
|
GETGC((GCENTRY *)(entry)) = GETGC((GCENTRY *)(link)); \
|
||||||
FreeLink((GCENTRY *)(link)); \
|
FreeLink((GCENTRY *)(link)); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define RefCntP(ptr) (!(GetTypeEntry((ptr)) & TT_NOREF) && \
|
#define RefCntP(ptr) (!(GetTypeEntry((ptr)) & TT_NOREF) && \
|
||||||
(*GcDisabled_word != ATOM_T))
|
(*GcDisabled_word != ATOM_T))
|
||||||
|
|
||||||
#define GCLOOKUP(ptr, case) { \
|
#define GCLOOKUP(ptr, case) do { \
|
||||||
if (RefCntP(ptr)) { \
|
if (RefCntP(ptr)) { \
|
||||||
if (*Reclaim_cnt_word != NIL) \
|
if (*Reclaim_cnt_word != NIL) \
|
||||||
htfind(ptr, case); \
|
htfind(ptr, case); \
|
||||||
else \
|
else \
|
||||||
rec_htfind(ptr, case); \
|
rec_htfind(ptr, case); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define GCLOOKUPV(ptr, case, val) { \
|
#define GCLOOKUPV(ptr, case, val) do { \
|
||||||
if (RefCntP(ptr)) { \
|
if (RefCntP(ptr)) { \
|
||||||
if (*Reclaim_cnt_word != NIL) \
|
if (*Reclaim_cnt_word != NIL) \
|
||||||
(val) = htfind((ptr), (case)); \
|
(val) = htfind((ptr), (case)); \
|
||||||
else \
|
else \
|
||||||
(val) = rec_htfind((ptr), (case)); \
|
(val) = rec_htfind((ptr), (case)); \
|
||||||
} else (val) = NIL; \
|
} else (val) = NIL; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define REC_GCLOOKUP(ptr, case) { if (RefCntP(ptr)) rec_htfind(ptr, case); }
|
#define REC_GCLOOKUP(ptr, case) do { if (RefCntP(ptr)) rec_htfind(ptr, case); } while (0)
|
||||||
#define REC_GCLOOKUPV(ptr, case, val) { \
|
#define REC_GCLOOKUPV(ptr, case, val) do { \
|
||||||
if (RefCntP(ptr)) \
|
if (RefCntP(ptr)) \
|
||||||
(val) = rec_htfind((ptr), (case)); \
|
(val) = rec_htfind((ptr), (case)); \
|
||||||
else \
|
else \
|
||||||
(val) = NIL; \
|
(val) = NIL; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define FRPLPTR(old , new) { \
|
#define FRPLPTR(old , new) do { \
|
||||||
GCLOOKUP(new, ADDREF); \
|
GCLOOKUP(new, ADDREF); \
|
||||||
GCLOOKUP(old, DELREF); \
|
GCLOOKUP(old, DELREF); \
|
||||||
(old) = (new) ; }
|
(old) = (new) ; } while (0)
|
||||||
|
|
||||||
|
|
||||||
#ifndef BYTESWAP
|
#ifndef BYTESWAP
|
||||||
|
|||||||
0
inc/ifpage.h
Executable file → Normal file
0
inc/ifpage.h
Executable file → Normal file
0
inc/inln68k.h
Executable file → Normal file
0
inc/inln68k.h
Executable file → Normal file
0
inc/iopage.h
Executable file → Normal file
0
inc/iopage.h
Executable file → Normal file
0
inc/keysym.h
Executable file → Normal file
0
inc/keysym.h
Executable file → Normal file
0
inc/ldeXdefs.h
Executable file → Normal file
0
inc/ldeXdefs.h
Executable file → Normal file
0
inc/lispmap.h
Executable file → Normal file
0
inc/lispmap.h
Executable file → Normal file
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
/* DOS version of LispVersionToUnixVersion */
|
/* DOS version of LispVersionToUnixVersion */
|
||||||
#define LispVersionToUnixVersion(pathname, ver) \
|
#define LispVersionToUnixVersion(pathname, ver) \
|
||||||
{ \
|
do { \
|
||||||
\
|
\
|
||||||
char *cp; \
|
char *cp; \
|
||||||
char *vp; \
|
char *vp; \
|
||||||
@@ -43,5 +43,5 @@
|
|||||||
else ver = -1; \
|
else ver = -1; \
|
||||||
} \
|
} \
|
||||||
else ver = -1; \
|
else ver = -1; \
|
||||||
}
|
} while (0)
|
||||||
#endif /* LISPVER1_H */
|
#endif /* LISPVER1_H */
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
/* non-DOS version of LispVersionToUnixVersion */
|
/* non-DOS version of LispVersionToUnixVersion */
|
||||||
|
|
||||||
#define LispVersionToUnixVersion(pathname){ \
|
#define LispVersionToUnixVersion(pathname) do { \
|
||||||
\
|
\
|
||||||
char *lv_cp; \
|
char *lv_cp; \
|
||||||
char *lv_vp; \
|
char *lv_vp; \
|
||||||
@@ -70,5 +70,5 @@
|
|||||||
lv_vp--; /* Just for label */ \
|
lv_vp--; /* Just for label */ \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
#endif /* LISPVER2_H */
|
#endif /* LISPVER2_H */
|
||||||
|
|||||||
@@ -45,24 +45,24 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
/* For getfileinfo. For WDATE&RDATE */
|
/* For getfileinfo. For WDATE&RDATE */
|
||||||
/* 29969152 == (timer.c)LISP_UNIX_TIME_DIFF */
|
/* 29969152 == (timer.c)LISP_UNIX_TIME_DIFF */
|
||||||
|
|
||||||
#define StrNCpyFromCToLisp(lispbuf, cbuf ,len) { \
|
#define StrNCpyFromCToLisp(lispbuf, cbuf ,len) do { \
|
||||||
char *lf_sptr = (cbuf); \
|
char *lf_sptr = (cbuf); \
|
||||||
char *lf_dptr = (lispbuf); \
|
char *lf_dptr = (lispbuf); \
|
||||||
for(size_t lf_i=0;lf_i<(len);lf_i++)\
|
for(size_t lf_i=0;lf_i<(len);lf_i++)\
|
||||||
GETBYTE(lf_dptr++) = *lf_sptr++; \
|
GETBYTE(lf_dptr++) = *lf_sptr++; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define StrNCpyFromLispToC(cbuf , lispbuf, len) { \
|
#define StrNCpyFromLispToC(cbuf , lispbuf, len) do { \
|
||||||
char *lf_sptr = (lispbuf); \
|
char *lf_sptr = (lispbuf); \
|
||||||
char *lf_dptr = (cbuf); \
|
char *lf_dptr = (cbuf); \
|
||||||
for(size_t lf_i=0;lf_i<(len);lf_i++)\
|
for(size_t lf_i=0;lf_i<(len);lf_i++)\
|
||||||
*lf_dptr++ = GETBYTE(lf_sptr++); \
|
*lf_dptr++ = GETBYTE(lf_sptr++); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define FGetNum(ptr, place) { \
|
#define FGetNum(ptr, place) do { \
|
||||||
if(((ptr) & SEGMASK)== S_POSITIVE) {(place) = ((ptr) & 0xffff);}\
|
if(((ptr) & SEGMASK)== S_POSITIVE) {(place) = ((ptr) & 0xffff);}\
|
||||||
else if(((ptr) & SEGMASK)== S_NEGATIVE) {(place) = (int)((ptr)| 0xffff0000);}\
|
else if(((ptr) & SEGMASK)== S_NEGATIVE) {(place) = (int)((ptr)| 0xffff0000);}\
|
||||||
else {return(NIL);}}
|
else {return(NIL);}} while (0)
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
@@ -81,7 +81,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
#ifndef BYTESWAP
|
#ifndef BYTESWAP
|
||||||
#define LispStringToCString(Lisp, C, MaxLen) \
|
#define LispStringToCString(Lisp, C, MaxLen) \
|
||||||
{ \
|
do { \
|
||||||
OneDArray *lf_arrayp; \
|
OneDArray *lf_arrayp; \
|
||||||
char *lf_base, *lf_dp; \
|
char *lf_base, *lf_dp; \
|
||||||
short *lf_sbase; \
|
short *lf_sbase; \
|
||||||
@@ -108,10 +108,10 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
default: \
|
default: \
|
||||||
error("LispStringToCString: Not a character array.\n"); \
|
error("LispStringToCString: Not a character array.\n"); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
#else /* BYTESWAP == T CHANGED-BY-TAKE */
|
#else /* BYTESWAP == T CHANGED-BY-TAKE */
|
||||||
#define LispStringToCString(Lisp, C, MaxLen) \
|
#define LispStringToCString(Lisp, C, MaxLen) \
|
||||||
{ \
|
do { \
|
||||||
OneDArray *lf_arrayp; \
|
OneDArray *lf_arrayp; \
|
||||||
char *lf_base, *lf_dp; \
|
char *lf_base, *lf_dp; \
|
||||||
short *lf_sbase; \
|
short *lf_sbase; \
|
||||||
@@ -138,7 +138,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
default: \
|
default: \
|
||||||
error("LispStringToCString: Not a character array.\n"); \
|
error("LispStringToCString: Not a character array.\n"); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#endif /* BYTESWAP */
|
#endif /* BYTESWAP */
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
/* */
|
/* */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
#define LispStringLength(LispString, Length, FatP) \
|
#define LispStringLength(LispString, Length, FatP) \
|
||||||
{ \
|
do { \
|
||||||
OneDArray *lf_arrayp; \
|
OneDArray *lf_arrayp; \
|
||||||
lf_arrayp = (OneDArray *)(NativeAligned4FromLAddr(LispString)); \
|
lf_arrayp = (OneDArray *)(NativeAligned4FromLAddr(LispString)); \
|
||||||
switch(lf_arrayp->typenumber) \
|
switch(lf_arrayp->typenumber) \
|
||||||
@@ -171,7 +171,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
default: \
|
default: \
|
||||||
error("LispStringLength: Not a character array.\n"); \
|
error("LispStringLength: Not a character array.\n"); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -184,11 +184,11 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
/* */
|
/* */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
#define STRING_BASE(lstringp, cstringp) \
|
#define STRING_BASE(lstringp, cstringp) \
|
||||||
{ \
|
do { \
|
||||||
LispPTR *lf_naddress; \
|
LispPTR *lf_naddress; \
|
||||||
lf_naddress = (LispPTR *)(NativeAligned4FromLAddr(lstringp)); \
|
lf_naddress = (LispPTR *)(NativeAligned4FromLAddr(lstringp)); \
|
||||||
(cstringp) = (char *)(NativeAligned2FromLAddr(((OneDArray *)lf_naddress)->base)); \
|
(cstringp) = (char *)(NativeAligned2FromLAddr(((OneDArray *)lf_naddress)->base)); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
#define min(a, b) (((a) <= (b))?(a):(b))
|
#define min(a, b) (((a) <= (b))?(a):(b))
|
||||||
@@ -200,23 +200,23 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
|
|
||||||
#define UPLOWDIFF 0x20
|
#define UPLOWDIFF 0x20
|
||||||
|
|
||||||
#define DOWNCASE(name){ \
|
#define DOWNCASE(name) do { \
|
||||||
\
|
\
|
||||||
char *lf_cp; \
|
char *lf_cp; \
|
||||||
\
|
\
|
||||||
for(lf_cp = (name); *lf_cp!='\0'; ++lf_cp) \
|
for(lf_cp = (name); *lf_cp!='\0'; ++lf_cp) \
|
||||||
if((*lf_cp >= 'A') && (*lf_cp <= 'Z')) *lf_cp += UPLOWDIFF; \
|
if((*lf_cp >= 'A') && (*lf_cp <= 'Z')) *lf_cp += UPLOWDIFF; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define UPCASE(name){ \
|
#define UPCASE(name) do { \
|
||||||
\
|
\
|
||||||
char *lf_cp; \
|
char *lf_cp; \
|
||||||
\
|
\
|
||||||
for(lf_cp = (name); *lf_cp!='\0'; ++lf_cp) \
|
for(lf_cp = (name); *lf_cp!='\0'; ++lf_cp) \
|
||||||
if((*lf_cp >= 'a') && (*lf_cp <= 'z')) *lf_cp -= UPLOWDIFF; \
|
if((*lf_cp >= 'a') && (*lf_cp <= 'z')) *lf_cp -= UPLOWDIFF; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define DIR_OR_FILE_P(name, type){ \
|
#define DIR_OR_FILE_P(name, type) do { \
|
||||||
int lf_result; \
|
int lf_result; \
|
||||||
struct stat lf_statbuf; \
|
struct stat lf_statbuf; \
|
||||||
\
|
\
|
||||||
@@ -244,9 +244,9 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define DIRP(path, dir, buf){ \
|
#define DIRP(path, dir, buf) do { \
|
||||||
int lf_rval; \
|
int lf_rval; \
|
||||||
struct stat lf_statbuf; \
|
struct stat lf_statbuf; \
|
||||||
strcpy(buf, path); \
|
strcpy(buf, path); \
|
||||||
@@ -262,9 +262,9 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
*Lisp_errno = 60; \
|
*Lisp_errno = 60; \
|
||||||
return(0); \
|
return(0); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define FILEP(path, file, buf){ \
|
#define FILEP(path, file, buf) do { \
|
||||||
int lf_rval; \
|
int lf_rval; \
|
||||||
strcpy(buf, path); \
|
strcpy(buf, path); \
|
||||||
strcat(buf, file); \
|
strcat(buf, file); \
|
||||||
@@ -273,7 +273,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
strcat(path, file); \
|
strcat(path, file); \
|
||||||
return(1); \
|
return(1); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define STREQ(name1, name2)( \
|
#define STREQ(name1, name2)( \
|
||||||
(*(name1) == *(name2)) && (strcmp(name1, name2) == 0) \
|
(*(name1) == *(name2)) && (strcmp(name1, name2) == 0) \
|
||||||
@@ -281,7 +281,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
|
|
||||||
#define SPECIALFILEMARK (-1)
|
#define SPECIALFILEMARK (-1)
|
||||||
|
|
||||||
#define NumericStringP(str, truetag, falsetag) { \
|
#define NumericStringP(str, truetag, falsetag) do { \
|
||||||
char *lfn_cp; \
|
char *lfn_cp; \
|
||||||
\
|
\
|
||||||
/* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
|
/* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
|
||||||
@@ -291,7 +291,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
if(*lfn_cp < '0' || '9' < *lfn_cp) \
|
if(*lfn_cp < '0' || '9' < *lfn_cp) \
|
||||||
goto falsetag; /* NOLINT(bugprone-macro-parentheses) */ \
|
goto falsetag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
goto truetag; /* NOLINT(bugprone-macro-parentheses) */ \
|
goto truetag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Name: LispVersionToUnixVersion
|
* Name: LispVersionToUnixVersion
|
||||||
@@ -353,7 +353,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
* dealt with as version 1.
|
* dealt with as version 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define UnixVersionToLispVersion(pathname, vlessp){ \
|
#define UnixVersionToLispVersion(pathname, vlessp) do { \
|
||||||
\
|
\
|
||||||
char *start; \
|
char *start; \
|
||||||
char *end; \
|
char *end; \
|
||||||
@@ -408,7 +408,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
/* Dealt with as version 1 unless vlessp. */ \
|
/* Dealt with as version 1 unless vlessp. */ \
|
||||||
if (!(vlessp)) strcat(pathname, ";1"); \
|
if (!(vlessp)) strcat(pathname, ";1"); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Name: ConcDirAndName
|
* Name: ConcDirAndName
|
||||||
@@ -428,7 +428,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ConcDirAndName(dir, name, fname){ \
|
#define ConcDirAndName(dir, name, fname) do { \
|
||||||
\
|
\
|
||||||
char *lf_cp1, *lf_cp2; \
|
char *lf_cp1, *lf_cp2; \
|
||||||
\
|
\
|
||||||
@@ -464,7 +464,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
strcat(fname, "/"); \
|
strcat(fname, "/"); \
|
||||||
strcat(fname, name); \
|
strcat(fname, name); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Name: ConcNameAndVersion
|
* Name: ConcNameAndVersion
|
||||||
@@ -483,7 +483,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ConcNameAndVersion(name, ver, rname){ \
|
#define ConcNameAndVersion(name, ver, rname) do { \
|
||||||
if (*(ver) != '\0') { \
|
if (*(ver) != '\0') { \
|
||||||
strcpy(rname, name); \
|
strcpy(rname, name); \
|
||||||
strcat(rname, ".~"); \
|
strcat(rname, ".~"); \
|
||||||
@@ -492,7 +492,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
} else { \
|
} else { \
|
||||||
strcpy(rname, name); \
|
strcpy(rname, name); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define VERSIONLEN 16
|
#define VERSIONLEN 16
|
||||||
|
|
||||||
@@ -517,7 +517,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
/* Like "foo/fee.fee;3" or "/foo/foo;3" */
|
/* Like "foo/fee.fee;3" or "/foo/foo;3" */
|
||||||
/* AddDotNoExtension must be put after UnixVersionToLispVersion */
|
/* AddDotNoExtension must be put after UnixVersionToLispVersion */
|
||||||
|
|
||||||
#define AddDotNoExtension(file){ \
|
#define AddDotNoExtension(file) do { \
|
||||||
char *lf_cp; \
|
char *lf_cp; \
|
||||||
char *lf_cp1; \
|
char *lf_cp1; \
|
||||||
if( (strrchr(file,'.')== 0) && ((lf_cp=strrchr(file,';'))!=0) ){ \
|
if( (strrchr(file,'.')== 0) && ((lf_cp=strrchr(file,';'))!=0) ){ \
|
||||||
@@ -527,41 +527,41 @@ extern DLword *Lisp_world; /* To access LispSysout area */
|
|||||||
*lf_cp1 = *(lf_cp1-1); \
|
*lf_cp1 = *(lf_cp1-1); \
|
||||||
*lf_cp = '.'; \
|
*lf_cp = '.'; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/* An argument of RemoveDotNoExtension must be LispVersion convention */
|
/* An argument of RemoveDotNoExtension must be LispVersion convention */
|
||||||
/* Like "foo/fee.fee;3" or "/foo/foo.;3" */
|
/* Like "foo/fee.fee;3" or "/foo/foo.;3" */
|
||||||
/* RemoveDotNoExtension must be put before LispVersionToUnixVersion */
|
/* RemoveDotNoExtension must be put before LispVersionToUnixVersion */
|
||||||
|
|
||||||
#define RemoveDotNoExtension(file){ \
|
#define RemoveDotNoExtension(file) do { \
|
||||||
char *lf_cp; \
|
char *lf_cp; \
|
||||||
if( ((lf_cp=strrchr(file, ';'))!=0) && (*(lf_cp-1)=='.') ){ \
|
if( ((lf_cp=strrchr(file, ';'))!=0) && (*(lf_cp-1)=='.') ){ \
|
||||||
for(;*lf_cp!='\0';++lf_cp) \
|
for(;*lf_cp!='\0';++lf_cp) \
|
||||||
*(lf_cp-1) = *lf_cp; \
|
*(lf_cp-1) = *lf_cp; \
|
||||||
*(lf_cp-1) = '\0'; \
|
*(lf_cp-1) = '\0'; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
extern int errno;
|
extern int errno;
|
||||||
|
|
||||||
#define ChangeToVersionless(pathname){ \
|
#define ChangeToVersionless(pathname) do { \
|
||||||
char *lf_cp; \
|
char *lf_cp; \
|
||||||
if( (lf_cp=strrchr(pathname, ';')) != 0) \
|
if( (lf_cp=strrchr(pathname, ';')) != 0) \
|
||||||
*lf_cp = '\0'; \
|
*lf_cp = '\0'; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define UNLINK(x){ \
|
#define UNLINK(x) do { \
|
||||||
TIMEOUT(lf_rval=unlink(x)); \
|
TIMEOUT(lf_rval=unlink(x)); \
|
||||||
if(lf_rval == -1){ \
|
if(lf_rval == -1){ \
|
||||||
err_mess("unlink", errno); \
|
err_mess("unlink", errno); \
|
||||||
*Lisp_errno = errno; \
|
*Lisp_errno = errno; \
|
||||||
return(0); \
|
return(0); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define LINK(x,y){ \
|
#define LINK(x,y) do { \
|
||||||
TIMEOUT(lf_rval=link(x, y)); \
|
TIMEOUT(lf_rval=link(x, y)); \
|
||||||
if(lf_rval == -1){ \
|
if(lf_rval == -1){ \
|
||||||
if(errno == 2) \
|
if(errno == 2) \
|
||||||
@@ -572,9 +572,9 @@ extern int errno;
|
|||||||
return(0); \
|
return(0); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define RENAME(x,y){ \
|
#define RENAME(x,y) do { \
|
||||||
TIMEOUT(lf_rval=rename(x, y)); \
|
TIMEOUT(lf_rval=rename(x, y)); \
|
||||||
if(lf_rval == -1){ \
|
if(lf_rval == -1){ \
|
||||||
switch(errno){ \
|
switch(errno){ \
|
||||||
@@ -589,26 +589,26 @@ extern int errno;
|
|||||||
return(0); \
|
return(0); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define STAT(x,y){ \
|
#define STAT(x,y) do { \
|
||||||
TIMEOUT(lf_rval=stat(x, y)); \
|
TIMEOUT(lf_rval=stat(x, y)); \
|
||||||
if(lf_rval != 0){ \
|
if(lf_rval != 0){ \
|
||||||
err_mess("stat", errno); \
|
err_mess("stat", errno); \
|
||||||
*Lisp_errno = errno; \
|
*Lisp_errno = errno; \
|
||||||
return(-1); \
|
return(-1); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For file name length check
|
* For file name length check
|
||||||
*/
|
*/
|
||||||
#define FNAMETOOLONG 200
|
#define FNAMETOOLONG 200
|
||||||
|
|
||||||
#define FileNameTooLong(val) { \
|
#define FileNameTooLong(val) do { \
|
||||||
*Lisp_errno = FNAMETOOLONG; \
|
*Lisp_errno = FNAMETOOLONG; \
|
||||||
return((val)); \
|
return((val)); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
0
inc/lpkit.h
Executable file → Normal file
0
inc/lpkit.h
Executable file → Normal file
0
inc/lspglob.h
Executable file → Normal file
0
inc/lspglob.h
Executable file → Normal file
@@ -17,6 +17,8 @@
|
|||||||
# define MAIKO_OS_CYGWIN 1
|
# define MAIKO_OS_CYGWIN 1
|
||||||
# define MAIKO_OS_NAME "Cygwin"
|
# define MAIKO_OS_NAME "Cygwin"
|
||||||
# define MAIKO_OS_UNIX_LIKE 1
|
# define MAIKO_OS_UNIX_LIKE 1
|
||||||
|
# define MAIKO_EMULATE_TIMER_INTERRUPTS 1
|
||||||
|
# define MAIKO_EMULATE_ASYNC_INTERRUPTS 1
|
||||||
# define MAIKO_OS_DETECTED 1
|
# define MAIKO_OS_DETECTED 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
12
inc/my.h
12
inc/my.h
@@ -34,7 +34,7 @@
|
|||||||
/* from SMALLP or FIXP, if necessary. */
|
/* from SMALLP or FIXP, if necessary. */
|
||||||
/* */
|
/* */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
#define N_MakeFloat(arg, dest, tos){ \
|
#define N_MakeFloat(arg, dest, tos) do { \
|
||||||
switch (SEGMASK & (LispPTR)(arg)) { \
|
switch (SEGMASK & (LispPTR)(arg)) { \
|
||||||
case S_POSITIVE: \
|
case S_POSITIVE: \
|
||||||
(dest) = (float)(0xFFFF & (LispPTR)(arg)); \
|
(dest) = (float)(0xFFFF & (LispPTR)(arg)); \
|
||||||
@@ -53,11 +53,11 @@
|
|||||||
default: ERROR_EXIT(tos); \
|
default: ERROR_EXIT(tos); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define N_GetPos(arg, dest, tos){ \
|
#define N_GetPos(arg, dest, tos) do { \
|
||||||
if (((arg) & SEGMASK) == S_POSITIVE) \
|
if (((arg) & SEGMASK) == S_POSITIVE) \
|
||||||
(dest) = (arg) & 0xFFFF; \
|
(dest) = (arg) & 0xFFFF; \
|
||||||
else { \
|
else { \
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
if (((dest) = *((int *)NativeAligned4FromLAddr(arg))) & 0x80000000) \
|
if (((dest) = *((int *)NativeAligned4FromLAddr(arg))) & 0x80000000) \
|
||||||
ERROR_EXIT(tos); \
|
ERROR_EXIT(tos); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
static inline LispPTR
|
static inline LispPTR
|
||||||
aref_switch(unsigned type, LispPTR tos, LispPTR baseL, int index)
|
aref_switch(unsigned type, LispPTR tos, LispPTR baseL, int index)
|
||||||
@@ -117,7 +117,7 @@ aref_switch(unsigned type, LispPTR tos, LispPTR baseL, int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define aset_switch(type, tos) \
|
#define aset_switch(type, tos) \
|
||||||
{ \
|
do { \
|
||||||
switch (type) { \
|
switch (type) { \
|
||||||
case 38: /* pointer : 32 bits */ \
|
case 38: /* pointer : 32 bits */ \
|
||||||
GCLOOKUP(*(((int *)NativeAligned4FromLAddr(base)) + index), DELREF); \
|
GCLOOKUP(*(((int *)NativeAligned4FromLAddr(base)) + index), DELREF); \
|
||||||
@@ -178,5 +178,5 @@ aref_switch(unsigned type, LispPTR tos, LispPTR baseL, int index)
|
|||||||
default: /* Illegal or Unimplemented */ \
|
default: /* Illegal or Unimplemented */ \
|
||||||
ERROR_EXIT(tos); \
|
ERROR_EXIT(tos); \
|
||||||
}/* end switch typenumber */ \
|
}/* end switch typenumber */ \
|
||||||
}
|
} while (0)
|
||||||
#endif /* MY_H */
|
#endif /* MY_H */
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
#include "osmsgdefs.h" // for flush_pty
|
#include "osmsgdefs.h" // for flush_pty
|
||||||
|
|
||||||
#define OSMESSAGE_PRINT(print_exp) \
|
#define OSMESSAGE_PRINT(print_exp) \
|
||||||
{ \
|
do { \
|
||||||
flush_pty(); \
|
flush_pty(); \
|
||||||
print_exp; \
|
print_exp; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#endif /* OSMSG_H */
|
#endif /* OSMSG_H */
|
||||||
|
|||||||
23
inc/return.h
23
inc/return.h
@@ -65,21 +65,22 @@
|
|||||||
/** in CONTEXTSW , for exchanging context **/
|
/** in CONTEXTSW , for exchanging context **/
|
||||||
|
|
||||||
#define Midpunt(fxnum) \
|
#define Midpunt(fxnum) \
|
||||||
{ DLword midpunt; \
|
do { DLword midpunt; \
|
||||||
midpunt = LOLOC(LAddrFromNative(CURRENTFX)); \
|
midpunt = LOLOC(LAddrFromNative(CURRENTFX)); \
|
||||||
PVar=(DLword *) \
|
PVar=(DLword *) \
|
||||||
Addr68k_from_StkOffset( \
|
NativeAligned2FromStackOffset( \
|
||||||
(GETWORD(((DLword *)InterfacePage) + (fxnum)))) \
|
(GETWORD(((DLword *)InterfacePage) + (fxnum)))) \
|
||||||
+ FRAMESIZE; \
|
+ FRAMESIZE; \
|
||||||
GETWORD(((DLword *)InterfacePage) + (fxnum)) = midpunt ; \
|
GETWORD(((DLword *)InterfacePage) + (fxnum)) = midpunt ; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define CHECKFX \
|
#define CHECKFX \
|
||||||
if (((UNSIGNED)PVar -(UNSIGNED)CURRENTFX) != 20) \
|
do { if (((UNSIGNED)PVar -(UNSIGNED)CURRENTFX) != 20) \
|
||||||
{ printf("Invalid FX(0x%x) and PV(0x%x) \n", \
|
{ printf("Invalid FX(0x%x) and PV(0x%x) \n", \
|
||||||
LAddrFromNative(CURRENTFX),LAddrFromNative(PVar)); \
|
LAddrFromNative(CURRENTFX),LAddrFromNative(PVar)); \
|
||||||
}
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -87,17 +88,17 @@
|
|||||||
that it is called by CONTEXTSW in original LISP code **/
|
that it is called by CONTEXTSW in original LISP code **/
|
||||||
|
|
||||||
#define BEFORE_CONTEXTSW \
|
#define BEFORE_CONTEXTSW \
|
||||||
{ CurrentStackPTR += 2; \
|
do { CurrentStackPTR += 2; \
|
||||||
CURRENTFX->nextblock=StkOffset_from_68K(CurrentStackPTR); \
|
CURRENTFX->nextblock=StackOffsetFromNative(CurrentStackPTR); \
|
||||||
GETWORD(CurrentStackPTR)=STK_FSB_WORD; \
|
GETWORD(CurrentStackPTR)=STK_FSB_WORD; \
|
||||||
GETWORD(CurrentStackPTR+1)= (((UNSIGNED)EndSTKP-(UNSIGNED)(CurrentStackPTR))>>1); \
|
GETWORD(CurrentStackPTR+1)= (((UNSIGNED)EndSTKP-(UNSIGNED)(CurrentStackPTR))>>1); \
|
||||||
if (GETWORD(CurrentStackPTR+1) == 0) error("0-long free block."); \
|
if (GETWORD(CurrentStackPTR+1) == 0) error("0-long free block."); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define AFTER_CONTEXTSW \
|
#define AFTER_CONTEXTSW \
|
||||||
{ DLword *ac_ptr68k,*ac_freeptr; \
|
do { DLword *ac_ptr68k,*ac_freeptr; \
|
||||||
ac_ptr68k = (DLword*)Addr68k_from_StkOffset(CURRENTFX->nextblock); \
|
ac_ptr68k = (DLword*)NativeAligned2FromStackOffset(CURRENTFX->nextblock); \
|
||||||
if(GETWORD(ac_ptr68k) != STK_FSB_WORD) error("pre_moveframe: MP9316"); \
|
if(GETWORD(ac_ptr68k) != STK_FSB_WORD) error("pre_moveframe: MP9316"); \
|
||||||
CHECK_FX(CURRENTFX); \
|
CHECK_FX(CURRENTFX); \
|
||||||
ac_freeptr=ac_ptr68k; \
|
ac_freeptr=ac_ptr68k; \
|
||||||
@@ -109,5 +110,5 @@
|
|||||||
CHECK_FX(CURRENTFX); \
|
CHECK_FX(CURRENTFX); \
|
||||||
S_CHECK( EndSTKP > CurrentStackPTR, \
|
S_CHECK( EndSTKP > CurrentStackPTR, \
|
||||||
"End of stack isn't beyond current stk pointer."); \
|
"End of stack isn't beyond current stk pointer."); \
|
||||||
}
|
} while (0)
|
||||||
#endif /* RETURN_H */
|
#endif /* RETURN_H */
|
||||||
|
|||||||
0
inc/rs232c.h
Executable file → Normal file
0
inc/rs232c.h
Executable file → Normal file
54
inc/stack.h
54
inc/stack.h
@@ -305,51 +305,51 @@ typedef struct stackp {
|
|||||||
#define SLOWP(fx) (((FXBLOCK *)(fx))->slowp)
|
#define SLOWP(fx) (((FXBLOCK *)(fx))->slowp)
|
||||||
#define FASTP(fx) (!SLOWP(fx))
|
#define FASTP(fx) (!SLOWP(fx))
|
||||||
#define SET_FASTP_NIL(fx68k) \
|
#define SET_FASTP_NIL(fx68k) \
|
||||||
{ \
|
do { \
|
||||||
if (FASTP(fx68k)) { \
|
if (FASTP(fx68k)) { \
|
||||||
((FX *)(fx68k))->blink = StkOffset_from_68K(DUMMYBF(fx68k)); \
|
((FX *)(fx68k))->blink = StackOffsetFromNative(DUMMYBF(fx68k)); \
|
||||||
((FX *)(fx68k))->clink = ((FX *)(fx68k))->alink; \
|
((FX *)(fx68k))->clink = ((FX *)(fx68k))->alink; \
|
||||||
SLOWP(fx68k) = T; \
|
SLOWP(fx68k) = T; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define GETALINK(fx) ((((fx)->alink) & 0xfffe) - FRAMESIZE)
|
#define GETALINK(fx) ((((fx)->alink) & 0xfffe) - FRAMESIZE)
|
||||||
#define SETALINK(fx, val) \
|
#define SETALINK(fx, val) \
|
||||||
{ \
|
do { \
|
||||||
if (FASTP(fx)) { \
|
if (FASTP(fx)) { \
|
||||||
((FX *)(fx))->blink = LAddrFromNative(DUMMYBF(fx)); \
|
((FX *)(fx))->blink = LAddrFromNative(DUMMYBF(fx)); \
|
||||||
((FX *)(fx))->clink = ((FX *)(fx))->alink; \
|
((FX *)(fx))->clink = ((FX *)(fx))->alink; \
|
||||||
} \
|
} \
|
||||||
((FX *)(fx))->alink = (val) + FRAMESIZE + 1; \
|
((FX *)(fx))->alink = (val) + FRAMESIZE + 1; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define GETBLINK(fx) (SLOWP(fx) ? ((FX *)(fx))->blink : LOLOC(LAddrFromNative(DUMMYBF(fx))))
|
#define GETBLINK(fx) (SLOWP(fx) ? ((FX *)(fx))->blink : LOLOC(LAddrFromNative(DUMMYBF(fx))))
|
||||||
#define SETBLINK(fx, val) \
|
#define SETBLINK(fx, val) \
|
||||||
{ \
|
do { \
|
||||||
((FX *)(fx))->blink = (val); \
|
((FX *)(fx))->blink = (val); \
|
||||||
if (FASTP(fx)) { \
|
if (FASTP(fx)) { \
|
||||||
((FX *)(fx))->clink = ((FX *)(fx))->alink; \
|
((FX *)(fx))->clink = ((FX *)(fx))->alink; \
|
||||||
SLOWP(fx) = 1; \
|
SLOWP(fx) = 1; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define GETCLINK(fx) \
|
#define GETCLINK(fx) \
|
||||||
(SLOWP(fx) ? (((FX *)(fx))->clink - FRAMESIZE) : (((FX *)(fx))->alink - FRAMESIZE))
|
(SLOWP(fx) ? (((FX *)(fx))->clink - FRAMESIZE) : (((FX *)(fx))->alink - FRAMESIZE))
|
||||||
#define SETCLINK(fx, val) \
|
#define SETCLINK(fx, val) \
|
||||||
{ \
|
do { \
|
||||||
((FX *)(fx))->clink = (val) + FRAMESIZE; \
|
((FX *)(fx))->clink = (val) + FRAMESIZE; \
|
||||||
if (FASTP((fx))) { \
|
if (FASTP((fx))) { \
|
||||||
((FX *)(fx))->blink = LAddrFromNative(DUMMYBF(fx)); \
|
((FX *)(fx))->blink = LAddrFromNative(DUMMYBF(fx)); \
|
||||||
SLOWP(fx) = 1; \
|
SLOWP(fx) = 1; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define SETACLINK(fx, val) \
|
#define SETACLINK(fx, val) \
|
||||||
{ \
|
do { \
|
||||||
if (FASTP(fx)) { ((FX *)(fx))->blink = LAddrFromNative(DUMMYBF(fx)); } \
|
if (FASTP(fx)) { ((FX *)(fx))->blink = LAddrFromNative(DUMMYBF(fx)); } \
|
||||||
((FX *)(fx))->clink = (val) + FRAMESIZE; \
|
((FX *)(fx))->clink = (val) + FRAMESIZE; \
|
||||||
((FX *)(fx))->alink = ((FX *)(fx))->clink + 1; \
|
((FX *)(fx))->alink = ((FX *)(fx))->clink + 1; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#ifdef BIGVM
|
#ifdef BIGVM
|
||||||
#define SWAP_FNHEAD
|
#define SWAP_FNHEAD
|
||||||
@@ -364,16 +364,16 @@ typedef struct stackp {
|
|||||||
POINTERMASK))
|
POINTERMASK))
|
||||||
|
|
||||||
#define MAKEFREEBLOCK(ptr68k, size) \
|
#define MAKEFREEBLOCK(ptr68k, size) \
|
||||||
{ \
|
do { \
|
||||||
if ((size) <= 0) error("creating 0 long FSP"); \
|
if ((size) <= 0) error("creating 0 long FSP"); \
|
||||||
*((LispPTR *)(ptr68k)) = (STK_FSB_WORD << 16) | ((DLword)(size)); \
|
*((LispPTR *)(ptr68k)) = (STK_FSB_WORD << 16) | ((DLword)(size)); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define SETUPGUARDBLOCK(ptr68k, size) \
|
#define SETUPGUARDBLOCK(ptr68k, size) \
|
||||||
{ \
|
do { \
|
||||||
if ((size) <= 0) error("creating 0 long Guard block"); \
|
if ((size) <= 0) error("creating 0 long Guard block"); \
|
||||||
(*((LispPTR *)(ptr68k)) = (STK_GUARD_WORD << 16) | ((DLword)(size))); \
|
(*((LispPTR *)(ptr68k)) = (STK_GUARD_WORD << 16) | ((DLword)(size))); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
@@ -389,47 +389,47 @@ typedef struct stackp {
|
|||||||
#include "testtooldefs.h"
|
#include "testtooldefs.h"
|
||||||
|
|
||||||
#define S_CHECK(condition, msg) \
|
#define S_CHECK(condition, msg) \
|
||||||
{ \
|
do { \
|
||||||
if (!(condition)) { \
|
if (!(condition)) { \
|
||||||
printf("\n\nStack check failed: %s.\n\n", (msg)); \
|
printf("\n\nStack check failed: %s.\n\n", (msg)); \
|
||||||
error("S_Check.."); \
|
error("S_Check.."); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define S_WARN(condition, msg, scanptr) \
|
#define S_WARN(condition, msg, scanptr) \
|
||||||
{ \
|
do { \
|
||||||
if (!(condition)) { printf("\n\nStack check failed at %p: %s.\n\n", (scanptr), (msg)); } \
|
if (!(condition)) { printf("\n\nStack check failed at %p: %s.\n\n", (scanptr), (msg)); } \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define CHECK_BF(bf68k) check_BF(bf68k)
|
#define CHECK_BF(bf68k) check_BF(bf68k)
|
||||||
|
|
||||||
#define CHECK_FX(fx68k) check_FX(fx68k)
|
#define CHECK_FX(fx68k) check_FX(fx68k)
|
||||||
|
|
||||||
#define PreMoveFrameCheck(fx68k) \
|
#define PreMoveFrameCheck(fx68k) \
|
||||||
{ \
|
do { \
|
||||||
LispPTR *tos_on_stack; \
|
LispPTR *tos_on_stack; \
|
||||||
if (check_stack_rooms(fx68k) > 1000) { \
|
if (check_stack_rooms(fx68k) > 1000) { \
|
||||||
warn("moveframe:there is more than 100 words SPACE for FX"); \
|
warn("moveframe:there is more than 100 words SPACE for FX"); \
|
||||||
printf("# When calling "); \
|
printf("# When calling "); \
|
||||||
tos_on_stack = (LispPTR *)Addr68k_from_StkOffset((fx68k)->nextblock - 2); \
|
tos_on_stack = (LispPTR *)NativeAligned4FromStackOffset((fx68k)->nextblock - 2); \
|
||||||
print_atomname(*tos_on_stack); \
|
print_atomname(*tos_on_stack); \
|
||||||
printf("\n"); \
|
printf("\n"); \
|
||||||
stack_check(0); \
|
stack_check(0); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#else /* STACKCHECK */
|
#else /* STACKCHECK */
|
||||||
|
|
||||||
#define S_CHECK(condition, msg) \
|
#define S_CHECK(condition, msg) \
|
||||||
{}
|
do {} while (0)
|
||||||
#define S_WARN(condition, msg, scanptr) \
|
#define S_WARN(condition, msg, scanptr) \
|
||||||
{}
|
do {} while (0)
|
||||||
#define PreMoveFrameCheck(fx68k) \
|
#define PreMoveFrameCheck(fx68k) \
|
||||||
{}
|
do {} while (0)
|
||||||
#define CHECK_BF(bf68k) \
|
#define CHECK_BF(bf68k) \
|
||||||
{}
|
do {} while (0)
|
||||||
#define CHECK_FX(fx68k) \
|
#define CHECK_FX(fx68k) \
|
||||||
{}
|
do {} while (0)
|
||||||
|
|
||||||
#endif /* STACKCHECK */
|
#endif /* STACKCHECK */
|
||||||
|
|
||||||
|
|||||||
0
inc/subrs.h
Executable file → Normal file
0
inc/subrs.h
Executable file → Normal file
@@ -19,37 +19,37 @@ extern jmp_buf jmpbuf;
|
|||||||
extern unsigned int TIMEOUT_TIME;
|
extern unsigned int TIMEOUT_TIME;
|
||||||
|
|
||||||
#define SETJMP(x) \
|
#define SETJMP(x) \
|
||||||
{ \
|
do { \
|
||||||
if(setjmp(jmpbuf) != 0) return(x); \
|
if(setjmp(jmpbuf) != 0) return(x); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define TIMEOUT(exp) \
|
#define TIMEOUT(exp) \
|
||||||
{ \
|
do { \
|
||||||
alarm(TIMEOUT_TIME); \
|
alarm(TIMEOUT_TIME); \
|
||||||
INTRSAFE(exp); \
|
INTRSAFE(exp); \
|
||||||
alarm(0); \
|
alarm(0); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define TIMEOUT0(exp) \
|
#define TIMEOUT0(exp) \
|
||||||
{ \
|
do { \
|
||||||
alarm(TIMEOUT_TIME); \
|
alarm(TIMEOUT_TIME); \
|
||||||
INTRSAFE0(exp); \
|
INTRSAFE0(exp); \
|
||||||
alarm(0); \
|
alarm(0); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define S_TOUT(exp) \
|
#define S_TOUT(exp) \
|
||||||
alarm(TIMEOUT_TIME),\
|
alarm(TIMEOUT_TIME), \
|
||||||
(exp), \
|
(exp), \
|
||||||
alarm(0)
|
alarm(0)
|
||||||
|
|
||||||
#define ERRSETJMP(rval) \
|
#define ERRSETJMP(rval) \
|
||||||
{ \
|
do { \
|
||||||
if(setjmp(jmpbuf) != 0) \
|
if(setjmp(jmpbuf) != 0) \
|
||||||
{ \
|
{ \
|
||||||
*Lisp_errno = 100; \
|
*Lisp_errno = 100; \
|
||||||
return(rval); \
|
return(rval); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|||||||
28
inc/tosfns.h
28
inc/tosfns.h
@@ -202,9 +202,8 @@
|
|||||||
BCE_CURRENTFX->pc = ((UNSIGNED)PCMAC - (UNSIGNED)FuncObj) + FN_OPCODE_SIZE; \
|
BCE_CURRENTFX->pc = ((UNSIGNED)PCMAC - (UNSIGNED)FuncObj) + FN_OPCODE_SIZE; \
|
||||||
FN_STACK_CHECK; \
|
FN_STACK_CHECK; \
|
||||||
{ \
|
{ \
|
||||||
UNSIGNED newivar; \
|
IVARL = (DLword *)(CSTKPTR - (argcount) + 1); \
|
||||||
newivar = (UNSIGNED)(IVARL = (DLword *)(CSTKPTR - (argcount) + 1)); \
|
BCE_CURRENTFX->nextblock = NEXTBLOCK = StackOffsetFromNative(IVARL); \
|
||||||
BCE_CURRENTFX->nextblock = NEXTBLOCK = StkOffset_from_68K(newivar); \
|
|
||||||
} \
|
} \
|
||||||
HARD_PUSH(TOPOFSTACK); /* save TOS */ \
|
HARD_PUSH(TOPOFSTACK); /* save TOS */ \
|
||||||
if (LOCFNCELL->na >= 0) { \
|
if (LOCFNCELL->na >= 0) { \
|
||||||
@@ -218,7 +217,7 @@
|
|||||||
} /* if end */ \
|
} /* if end */ \
|
||||||
/* Set up BF */ \
|
/* Set up BF */ \
|
||||||
HARD_PUSH(BF_MARK32 | NEXTBLOCK); \
|
HARD_PUSH(BF_MARK32 | NEXTBLOCK); \
|
||||||
*((LispPTR *)CSTKPTR) = (FX_MARK << 16) | (StkOffset_from_68K(PVAR)); \
|
*((LispPTR *)CSTKPTR) = (FX_MARK << 16) | (StackOffsetFromNative(PVAR)); \
|
||||||
((struct frameex2 *)CSTKPTR)->fnheader = SWAP_FNHEAD(defcell_word); \
|
((struct frameex2 *)CSTKPTR)->fnheader = SWAP_FNHEAD(defcell_word); \
|
||||||
CSTKPTRL = (LispPTR *)(((DLword *)CSTKPTR) + FRAMESIZE); \
|
CSTKPTRL = (LispPTR *)(((DLword *)CSTKPTR) + FRAMESIZE); \
|
||||||
PVARL = (DLword *)CSTKPTR; \
|
PVARL = (DLword *)CSTKPTR; \
|
||||||
@@ -258,9 +257,8 @@
|
|||||||
BCE_CURRENTFX->pc = ((UNSIGNED)PCMAC - (UNSIGNED)FuncObj) + FNX_OPCODE_SIZE; \
|
BCE_CURRENTFX->pc = ((UNSIGNED)PCMAC - (UNSIGNED)FuncObj) + FNX_OPCODE_SIZE; \
|
||||||
FN_STACK_CHECK; \
|
FN_STACK_CHECK; \
|
||||||
{ \
|
{ \
|
||||||
UNSIGNED newivar; \
|
IVARL = (DLword *)(CSTKPTR - num_args + 1); \
|
||||||
newivar = (UNSIGNED)(IVARL = (DLword *)(CSTKPTR - num_args + 1)); \
|
BCE_CURRENTFX->nextblock = NEXTBLOCK = StackOffsetFromNative(IVARL); \
|
||||||
BCE_CURRENTFX->nextblock = NEXTBLOCK = StkOffset_from_68K(newivar); \
|
|
||||||
} \
|
} \
|
||||||
HARD_PUSH(TOPOFSTACK); /* save TOS */ \
|
HARD_PUSH(TOPOFSTACK); /* save TOS */ \
|
||||||
if (LOCFNCELL->na >= 0) { \
|
if (LOCFNCELL->na >= 0) { \
|
||||||
@@ -274,7 +272,7 @@
|
|||||||
} /* if end */ \
|
} /* if end */ \
|
||||||
/* Set up BF */ \
|
/* Set up BF */ \
|
||||||
HARD_PUSH(BF_MARK32 | NEXTBLOCK); \
|
HARD_PUSH(BF_MARK32 | NEXTBLOCK); \
|
||||||
*((LispPTR *)CSTKPTR) = (FX_MARK << 16) | (StkOffset_from_68K(PVAR)); \
|
*((LispPTR *)CSTKPTR) = (FX_MARK << 16) | (StackOffsetFromNative(PVAR)); \
|
||||||
((struct frameex2 *)CSTKPTR)->fnheader = SWAP_FNHEAD(defcell->defpointer); \
|
((struct frameex2 *)CSTKPTR)->fnheader = SWAP_FNHEAD(defcell->defpointer); \
|
||||||
CSTKPTRL = (LispPTR *)(((DLword *)CSTKPTR) + FRAMESIZE); \
|
CSTKPTRL = (LispPTR *)(((DLword *)CSTKPTR) + FRAMESIZE); \
|
||||||
PVARL = (DLword *)CSTKPTR; \
|
PVARL = (DLword *)CSTKPTR; \
|
||||||
@@ -372,9 +370,8 @@
|
|||||||
FN_STACK_CHECK; \
|
FN_STACK_CHECK; \
|
||||||
APPLY_POP_PUSH_TEST; \
|
APPLY_POP_PUSH_TEST; \
|
||||||
{ \
|
{ \
|
||||||
UNSIGNED newivar; \
|
IVARL = (DLword *)(CSTKPTR + (1 - fn_num_args - needpush)); \
|
||||||
newivar = (UNSIGNED)(IVARL = (DLword *)(CSTKPTR + (1 - fn_num_args - needpush))); \
|
BCE_CURRENTFX->nextblock = NEXTBLOCK = StackOffsetFromNative(IVARL); \
|
||||||
BCE_CURRENTFX->nextblock = NEXTBLOCK = StkOffset_from_68K(newivar); \
|
|
||||||
} \
|
} \
|
||||||
HARD_PUSH(TOPOFSTACK); /* save TOS */ \
|
HARD_PUSH(TOPOFSTACK); /* save TOS */ \
|
||||||
if (LOCFNCELL->na >= 0) { \
|
if (LOCFNCELL->na >= 0) { \
|
||||||
@@ -389,7 +386,7 @@
|
|||||||
/* Set up BF */ \
|
/* Set up BF */ \
|
||||||
HARD_PUSH(BF_MARK32 | NEXTBLOCK); \
|
HARD_PUSH(BF_MARK32 | NEXTBLOCK); \
|
||||||
} /* NEXTBLOCK BLOCK */ \
|
} /* NEXTBLOCK BLOCK */ \
|
||||||
*((LispPTR *)CSTKPTR) = (FX_MARK << 16) | (StkOffset_from_68K(PVAR)); \
|
*((LispPTR *)CSTKPTR) = (FX_MARK << 16) | (StackOffsetFromNative(PVAR)); \
|
||||||
((struct frameex2 *)CSTKPTR)->fnheader = SWAP_FNHEAD(defcell->defpointer); \
|
((struct frameex2 *)CSTKPTR)->fnheader = SWAP_FNHEAD(defcell->defpointer); \
|
||||||
CSTKPTRL = (LispPTR *)(((DLword *)CSTKPTR) + FRAMESIZE); \
|
CSTKPTRL = (LispPTR *)(((DLword *)CSTKPTR) + FRAMESIZE); \
|
||||||
PVARL = (DLword *)CSTKPTR; \
|
PVARL = (DLword *)CSTKPTR; \
|
||||||
@@ -441,9 +438,8 @@
|
|||||||
FN_STACK_CHECK; \
|
FN_STACK_CHECK; \
|
||||||
CSTKPTRL -= 2; \
|
CSTKPTRL -= 2; \
|
||||||
{ \
|
{ \
|
||||||
UNSIGNED newivar; \
|
IVARL = (DLword *)(CSTKPTR - num_args); \
|
||||||
newivar = (UNSIGNED)(IVARL = (DLword *)(CSTKPTR - num_args)); \
|
BCE_CURRENTFX->nextblock = NEXTBLOCK = StackOffsetFromNative(IVARL);\
|
||||||
BCE_CURRENTFX->nextblock = NEXTBLOCK = StkOffset_from_68K(newivar); \
|
|
||||||
} \
|
} \
|
||||||
if (LOCFNCELL->na >= 0) { \
|
if (LOCFNCELL->na >= 0) { \
|
||||||
int RESTARGS; \
|
int RESTARGS; \
|
||||||
@@ -456,7 +452,7 @@
|
|||||||
} /* if end */ \
|
} /* if end */ \
|
||||||
/* Set up BF */ \
|
/* Set up BF */ \
|
||||||
HARD_PUSH(BF_MARK32 | NEXTBLOCK); \
|
HARD_PUSH(BF_MARK32 | NEXTBLOCK); \
|
||||||
*((LispPTR *)CSTKPTR) = (FX_MARK << 16) | (StkOffset_from_68K(PVAR)); \
|
*((LispPTR *)CSTKPTR) = (FX_MARK << 16) | (StackOffsetFromNative(PVAR)); \
|
||||||
((struct frameex2 *)CSTKPTR)->fnheader = SWAP_FNHEAD(Fn_DefCell); \
|
((struct frameex2 *)CSTKPTR)->fnheader = SWAP_FNHEAD(Fn_DefCell); \
|
||||||
CSTKPTRL = (LispPTR *)(((DLword *)CSTKPTR) + FRAMESIZE); \
|
CSTKPTRL = (LispPTR *)(((DLword *)CSTKPTR) + FRAMESIZE); \
|
||||||
PVARL = (DLword *)CSTKPTR; \
|
PVARL = (DLword *)CSTKPTR; \
|
||||||
|
|||||||
@@ -218,17 +218,6 @@ typedef intptr_t INT;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************/
|
|
||||||
/* */
|
|
||||||
/********************************************************/
|
|
||||||
#ifdef OS5
|
|
||||||
/* Solaris, sort of SYSV-ish, but not really */
|
|
||||||
#define MAIKO_ENABLE_ETHERNET
|
|
||||||
#endif /* OS5 */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************/
|
/********************************************************/
|
||||||
/* */
|
/* */
|
||||||
/********************************************************/
|
/********************************************************/
|
||||||
|
|||||||
0
inc/xdefs.h
Executable file → Normal file
0
inc/xdefs.h
Executable file → Normal file
0
src/bbt68k.s
Executable file → Normal file
0
src/bbt68k.s
Executable file → Normal file
0
src/bbtSPARC.s
Executable file → Normal file
0
src/bbtSPARC.s
Executable file → Normal file
38
src/bbtsub.c
38
src/bbtsub.c
@@ -75,10 +75,12 @@ extern IOPAGE *IOPage68K;
|
|||||||
extern int kbd_for_makeinit;
|
extern int kbd_for_makeinit;
|
||||||
|
|
||||||
#define init_kbd_startup \
|
#define init_kbd_startup \
|
||||||
if (!kbd_for_makeinit) { \
|
do { \
|
||||||
|
if (!kbd_for_makeinit) { \
|
||||||
init_keyboard(0); \
|
init_keyboard(0); \
|
||||||
kbd_for_makeinit = 1; \
|
kbd_for_makeinit = 1; \
|
||||||
};
|
} \
|
||||||
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "devif.h"
|
#include "devif.h"
|
||||||
@@ -579,7 +581,7 @@ LispPTR n_new_cursorin(DLword *baseaddr, int dx, int dy, int w, int h) {
|
|||||||
|
|
||||||
#define BITBLTBITMAP_argnum 14
|
#define BITBLTBITMAP_argnum 14
|
||||||
#define PUNT_TO_BITBLTBITMAP \
|
#define PUNT_TO_BITBLTBITMAP \
|
||||||
{ \
|
do { \
|
||||||
if (BITBLTBITMAP_index == 0xffffffff) { \
|
if (BITBLTBITMAP_index == 0xffffffff) { \
|
||||||
BITBLTBITMAP_index = get_package_atom("\\PUNT.BITBLT.BITMAP", 19, "INTERLISP", 9, NIL); \
|
BITBLTBITMAP_index = get_package_atom("\\PUNT.BITBLT.BITMAP", 19, "INTERLISP", 9, NIL); \
|
||||||
if (BITBLTBITMAP_index == 0xffffffff) { \
|
if (BITBLTBITMAP_index == 0xffffffff) { \
|
||||||
@@ -590,7 +592,7 @@ LispPTR n_new_cursorin(DLword *baseaddr, int dx, int dy, int w, int h) {
|
|||||||
CurrentStackPTR += (BITBLTBITMAP_argnum - 1) * DLWORDSPER_CELL; \
|
CurrentStackPTR += (BITBLTBITMAP_argnum - 1) * DLWORDSPER_CELL; \
|
||||||
ccfuncall(BITBLTBITMAP_index, BITBLTBITMAP_argnum, 3); \
|
ccfuncall(BITBLTBITMAP_index, BITBLTBITMAP_argnum, 3); \
|
||||||
return (ATOM_T); \
|
return (ATOM_T); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
LispPTR BITBLTBITMAP_index;
|
LispPTR BITBLTBITMAP_index;
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
@@ -856,7 +858,7 @@ bad_arg:
|
|||||||
|
|
||||||
#define BLTSHADEBITMAP_argnum 8
|
#define BLTSHADEBITMAP_argnum 8
|
||||||
#define PUNT_TO_BLTSHADEBITMAP \
|
#define PUNT_TO_BLTSHADEBITMAP \
|
||||||
{ \
|
do { \
|
||||||
if (BLTSHADEBITMAP_index == 0xffffffff) { \
|
if (BLTSHADEBITMAP_index == 0xffffffff) { \
|
||||||
BLTSHADEBITMAP_index = get_package_atom("\\PUNT.BLTSHADE.BITMAP", 21, "INTERLISP", 9, NIL); \
|
BLTSHADEBITMAP_index = get_package_atom("\\PUNT.BLTSHADE.BITMAP", 21, "INTERLISP", 9, NIL); \
|
||||||
if (BLTSHADEBITMAP_index == 0xffffffff) { \
|
if (BLTSHADEBITMAP_index == 0xffffffff) { \
|
||||||
@@ -867,7 +869,7 @@ bad_arg:
|
|||||||
CurrentStackPTR += (BLTSHADEBITMAP_argnum - 1) * DLWORDSPER_CELL; \
|
CurrentStackPTR += (BLTSHADEBITMAP_argnum - 1) * DLWORDSPER_CELL; \
|
||||||
ccfuncall(BLTSHADEBITMAP_index, BLTSHADEBITMAP_argnum, 3); \
|
ccfuncall(BLTSHADEBITMAP_index, BLTSHADEBITMAP_argnum, 3); \
|
||||||
return (ATOM_T); \
|
return (ATOM_T); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
LispPTR BLTSHADEBITMAP_index;
|
LispPTR BLTSHADEBITMAP_index;
|
||||||
|
|
||||||
@@ -1195,7 +1197,7 @@ void bltchar(LispPTR *args)
|
|||||||
bitblt(srcbase, dstbase, sx, dx, w, h, srcbpl, dstbpl, backwardflg, src_comp, op, gray, num_gray,
|
bitblt(srcbase, dstbase, sx, dx, w, h, srcbpl, dstbpl, backwardflg, src_comp, op, gray, num_gray,
|
||||||
curr_gray_line);
|
curr_gray_line);
|
||||||
#else
|
#else
|
||||||
new_char_bitblt_code
|
new_char_bitblt_code;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DISPLAYBUFFER
|
#ifdef DISPLAYBUFFER
|
||||||
@@ -1238,7 +1240,7 @@ void bltchar(LispPTR *args)
|
|||||||
#define BLTCHAR_argnum 3
|
#define BLTCHAR_argnum 3
|
||||||
#ifndef INIT
|
#ifndef INIT
|
||||||
#define PUNT_TO_BLTCHAR \
|
#define PUNT_TO_BLTCHAR \
|
||||||
{ \
|
do { \
|
||||||
if ((BLTCHAR_index == 0)) { \
|
if ((BLTCHAR_index == 0)) { \
|
||||||
BLTCHAR_index = get_package_atom("\\MAIKO.PUNTBLTCHAR", 18, "INTERLISP", 9, NIL); \
|
BLTCHAR_index = get_package_atom("\\MAIKO.PUNTBLTCHAR", 18, "INTERLISP", 9, NIL); \
|
||||||
if (BLTCHAR_index == 0xffffffff) { \
|
if (BLTCHAR_index == 0xffffffff) { \
|
||||||
@@ -1249,10 +1251,10 @@ void bltchar(LispPTR *args)
|
|||||||
CurrentStackPTR += (BLTCHAR_argnum - 1) * DLWORDSPER_CELL; \
|
CurrentStackPTR += (BLTCHAR_argnum - 1) * DLWORDSPER_CELL; \
|
||||||
ccfuncall(BLTCHAR_index, BLTCHAR_argnum, 3); \
|
ccfuncall(BLTCHAR_index, BLTCHAR_argnum, 3); \
|
||||||
return; \
|
return; \
|
||||||
}
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define PUNT_TO_BLTCHAR \
|
#define PUNT_TO_BLTCHAR \
|
||||||
{ /* Version that is silent instead of erroring for init */ \
|
do { /* Version that is silent instead of erroring for init */ \
|
||||||
if ((BLTCHAR_index == 0)) { \
|
if ((BLTCHAR_index == 0)) { \
|
||||||
BLTCHAR_index = get_package_atom("\\MAIKO.PUNTBLTCHAR", 18, "INTERLISP", 9, NIL); \
|
BLTCHAR_index = get_package_atom("\\MAIKO.PUNTBLTCHAR", 18, "INTERLISP", 9, NIL); \
|
||||||
if (BLTCHAR_index == 0xffffffff) { \
|
if (BLTCHAR_index == 0xffffffff) { \
|
||||||
@@ -1263,12 +1265,12 @@ void bltchar(LispPTR *args)
|
|||||||
CurrentStackPTR += (BLTCHAR_argnum - 1) * DLWORDSPER_CELL; \
|
CurrentStackPTR += (BLTCHAR_argnum - 1) * DLWORDSPER_CELL; \
|
||||||
ccfuncall(BLTCHAR_index, BLTCHAR_argnum, 3); \
|
ccfuncall(BLTCHAR_index, BLTCHAR_argnum, 3); \
|
||||||
return; \
|
return; \
|
||||||
}
|
} while (0)
|
||||||
#endif /* INIT */
|
#endif /* INIT */
|
||||||
|
|
||||||
#define TEDIT_BLTCHAR_argnum 6
|
#define TEDIT_BLTCHAR_argnum 6
|
||||||
#define PUNT_TO_TEDIT_BLTCHAR \
|
#define PUNT_TO_TEDIT_BLTCHAR \
|
||||||
{ \
|
do { \
|
||||||
if (TEDIT_BLTCHAR_index == 0xffffffff) { \
|
if (TEDIT_BLTCHAR_index == 0xffffffff) { \
|
||||||
TEDIT_BLTCHAR_index = get_package_atom("\\TEDIT.BLTCHAR", 14, "INTERLISP", 9, NIL); \
|
TEDIT_BLTCHAR_index = get_package_atom("\\TEDIT.BLTCHAR", 14, "INTERLISP", 9, NIL); \
|
||||||
if (TEDIT_BLTCHAR_index == 0xffffffff) { \
|
if (TEDIT_BLTCHAR_index == 0xffffffff) { \
|
||||||
@@ -1279,10 +1281,10 @@ void bltchar(LispPTR *args)
|
|||||||
CurrentStackPTR += (TEDIT_BLTCHAR_argnum - 1) * DLWORDSPER_CELL; \
|
CurrentStackPTR += (TEDIT_BLTCHAR_argnum - 1) * DLWORDSPER_CELL; \
|
||||||
ccfuncall(TEDIT_BLTCHAR_index, TEDIT_BLTCHAR_argnum, 3); \
|
ccfuncall(TEDIT_BLTCHAR_index, TEDIT_BLTCHAR_argnum, 3); \
|
||||||
return; \
|
return; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define FGetNum(ptr, place) \
|
#define FGetNum(ptr, place) \
|
||||||
{ \
|
do { \
|
||||||
if (((ptr)&SEGMASK) == S_POSITIVE) { \
|
if (((ptr)&SEGMASK) == S_POSITIVE) { \
|
||||||
(place) = ((ptr)&0xffff); \
|
(place) = ((ptr)&0xffff); \
|
||||||
} else if (((ptr)&SEGMASK) == S_NEGATIVE) { \
|
} else if (((ptr)&SEGMASK) == S_NEGATIVE) { \
|
||||||
@@ -1290,9 +1292,9 @@ void bltchar(LispPTR *args)
|
|||||||
} else { \
|
} else { \
|
||||||
PUNT_TO_BLTCHAR; \
|
PUNT_TO_BLTCHAR; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
#define FGetNum2(ptr, place) \
|
#define FGetNum2(ptr, place) \
|
||||||
{ \
|
do { \
|
||||||
if (((ptr)&SEGMASK) == S_POSITIVE) { \
|
if (((ptr)&SEGMASK) == S_POSITIVE) { \
|
||||||
(place) = ((ptr)&0xffff); \
|
(place) = ((ptr)&0xffff); \
|
||||||
} else if (((ptr)&SEGMASK) == S_NEGATIVE) { \
|
} else if (((ptr)&SEGMASK) == S_NEGATIVE) { \
|
||||||
@@ -1300,7 +1302,7 @@ void bltchar(LispPTR *args)
|
|||||||
} else { \
|
} else { \
|
||||||
return (-1); \
|
return (-1); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
LispPTR *TOPWDS68k; /* Top of window stack's DS */
|
LispPTR *TOPWDS68k; /* Top of window stack's DS */
|
||||||
LispPTR BLTCHAR_index; /* Atom # for \PUNTBLTCHAR punt fn */
|
LispPTR BLTCHAR_index; /* Atom # for \PUNTBLTCHAR punt fn */
|
||||||
@@ -1406,7 +1408,7 @@ void newbltchar(LispPTR *args) {
|
|||||||
bitblt(srcbase, dstbase, sx, dx, w, h, srcbpl, dstbpl, backwardflg, src_comp, op, gray, num_gray,
|
bitblt(srcbase, dstbase, sx, dx, w, h, srcbpl, dstbpl, backwardflg, src_comp, op, gray, num_gray,
|
||||||
curr_gray_line);
|
curr_gray_line);
|
||||||
#else
|
#else
|
||||||
new_char_bitblt_code
|
new_char_bitblt_code;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DISPLAYBUFFER
|
#ifdef DISPLAYBUFFER
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl, LispPTR tos)
|
|||||||
if (!kbd_for_makeinit) {
|
if (!kbd_for_makeinit) {
|
||||||
init_keyboard(0);
|
init_keyboard(0);
|
||||||
kbd_for_makeinit = 1;
|
kbd_for_makeinit = 1;
|
||||||
};
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl, LispPTR tos)
|
|||||||
;
|
;
|
||||||
#endif /* SUNDISPLAY / DOS */
|
#endif /* SUNDISPLAY / DOS */
|
||||||
|
|
||||||
new_bitblt_code
|
new_bitblt_code;
|
||||||
|
|
||||||
#if DOS
|
#if DOS
|
||||||
flush_display_lineregion(dx, dstbase, w, h);
|
flush_display_lineregion(dx, dstbase, w, h);
|
||||||
|
|||||||
@@ -19,33 +19,18 @@
|
|||||||
/* */
|
/* */
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include "byteswapdefs.h"
|
#include "byteswapdefs.h"
|
||||||
#include "lsptypes.h"
|
#include "lsptypes.h"
|
||||||
|
|
||||||
/****************************************************************/
|
|
||||||
/* */
|
|
||||||
/* Byte-swap a region wordcount words long */
|
|
||||||
/* This does NOT swap words in a long-word! */
|
|
||||||
/* */
|
|
||||||
/****************************************************************/
|
|
||||||
void byte_swap_page(unsigned short *page, int wordcount) {
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < wordcount; i++) { *(page + i) = byte_swap_word(*(page + i)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************/
|
/****************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* Byte- & word-swap a region wordcount long-words long */
|
/* Byte- & word-swap a region wordcount long-words long */
|
||||||
/* */
|
/* */
|
||||||
/****************************************************************/
|
/****************************************************************/
|
||||||
void word_swap_page(unsigned short *page, int longwordcount) {
|
void word_swap_page(unsigned short *page, int longwordcount) {
|
||||||
int i;
|
unsigned int *longpage = (unsigned int *)page;
|
||||||
unsigned int *longpage;
|
for (int i = 0; i < longwordcount; i++) { *(longpage + i) = ntohl(*(longpage + i)); }
|
||||||
longpage = (unsigned int *)page;
|
|
||||||
for (i = 0; i < (longwordcount + longwordcount); i++) {
|
|
||||||
*(page + i) = byte_swap_word(*(page + i));
|
|
||||||
}
|
|
||||||
for (i = 0; i < longwordcount; i++) { *(longpage + i) = swapx(*(longpage + i)); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************/
|
/****************************************************************/
|
||||||
|
|||||||
@@ -65,23 +65,27 @@ jmp_buf BT_jumpbuf;
|
|||||||
#define BTMAXLINE 24
|
#define BTMAXLINE 24
|
||||||
/* DOS has a 25-line screen, and getchar discards ESC for some reason */
|
/* DOS has a 25-line screen, and getchar discards ESC for some reason */
|
||||||
#define BT_morep \
|
#define BT_morep \
|
||||||
if ((BT_temp != '!') && (++BT_lines > BTMAXLINE)) { \
|
do { \
|
||||||
printf("Press Return(Esc & Ret to quit, ! don't stop):"); \
|
if ((BT_temp != '!') && (++BT_lines > BTMAXLINE)) { \
|
||||||
BT_temp = getch(); \
|
printf("Press Return(Esc & Ret to quit, ! don't stop):"); \
|
||||||
fflush(stdin); \
|
BT_temp = getch(); \
|
||||||
BT_lines = 0; \
|
fflush(stdin); \
|
||||||
if (BT_temp == 27) longjmp(BT_jumpbuf, 1); \
|
BT_lines = 0; \
|
||||||
}
|
if (BT_temp == 27) longjmp(BT_jumpbuf, 1); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
#else /* DOS */
|
#else /* DOS */
|
||||||
#define BTMAXLINE 30
|
#define BTMAXLINE 30
|
||||||
#define BT_morep \
|
#define BT_morep \
|
||||||
if (++BT_lines > BTMAXLINE) { \
|
do { \
|
||||||
printf("Press Return(to quit Esc and Ret):"); \
|
if (++BT_lines > BTMAXLINE) { \
|
||||||
BT_temp = getchar(); \
|
printf("Press Return(to quit Esc and Ret):"); \
|
||||||
fflush(stdin); \
|
BT_temp = getchar(); \
|
||||||
BT_lines = 0; \
|
fflush(stdin); \
|
||||||
if (BT_temp == 27) longjmp(BT_jumpbuf, 1); \
|
BT_lines = 0; \
|
||||||
}
|
if (BT_temp == 27) longjmp(BT_jumpbuf, 1); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
#endif /* DOS */
|
#endif /* DOS */
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
20
src/dir.c
20
src/dir.c
@@ -69,7 +69,7 @@ extern int Dummy_errno;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define SetupMatch(tname, pname, text, pext, tver) \
|
#define SetupMatch(tname, pname, text, pext, tver) \
|
||||||
{ \
|
do { \
|
||||||
char *pp; \
|
char *pp; \
|
||||||
\
|
\
|
||||||
separate_version(tname, tver, 0); \
|
separate_version(tname, tver, 0); \
|
||||||
@@ -87,10 +87,10 @@ extern int Dummy_errno;
|
|||||||
*pp = '\0'; \
|
*pp = '\0'; \
|
||||||
strcpy(pext, pp + 1); \
|
strcpy(pext, pp + 1); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define MatchP(target, name, ver, matchtag, unmatchtag) \
|
#define MatchP(target, name, ver, matchtag, unmatchtag) \
|
||||||
{ \
|
do { \
|
||||||
char tname[MAXNAMLEN], text[MAXNAMLEN], tver[VERSIONLEN]; \
|
char tname[MAXNAMLEN], text[MAXNAMLEN], tver[VERSIONLEN]; \
|
||||||
char pname[MAXNAMLEN], pext[MAXNAMLEN]; \
|
char pname[MAXNAMLEN], pext[MAXNAMLEN]; \
|
||||||
\
|
\
|
||||||
@@ -105,10 +105,10 @@ extern int Dummy_errno;
|
|||||||
goto matchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
goto matchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
else \
|
else \
|
||||||
goto unmatchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
goto unmatchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define MatchP_Case(target, name, ver, matchtag, unmatchtag) \
|
#define MatchP_Case(target, name, ver, matchtag, unmatchtag) \
|
||||||
{ \
|
do { \
|
||||||
char tname[MAXNAMLEN], text[MAXNAMLEN], tver[VERSIONLEN]; \
|
char tname[MAXNAMLEN], text[MAXNAMLEN], tver[VERSIONLEN]; \
|
||||||
char pname[MAXNAMLEN], pext[MAXNAMLEN]; \
|
char pname[MAXNAMLEN], pext[MAXNAMLEN]; \
|
||||||
\
|
\
|
||||||
@@ -121,7 +121,7 @@ extern int Dummy_errno;
|
|||||||
goto matchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
goto matchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
else \
|
else \
|
||||||
goto unmatchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
goto unmatchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Name: match_pattern
|
* Name: match_pattern
|
||||||
@@ -232,7 +232,7 @@ int MAXFINFO;
|
|||||||
#define FINFOARRAYRSIZE 16
|
#define FINFOARRAYRSIZE 16
|
||||||
|
|
||||||
#define AllocFinfo(fp) \
|
#define AllocFinfo(fp) \
|
||||||
{ \
|
do { \
|
||||||
if (FreeFinfoList != (FINFO *)NULL) { \
|
if (FreeFinfoList != (FINFO *)NULL) { \
|
||||||
(fp) = FreeFinfoList; \
|
(fp) = FreeFinfoList; \
|
||||||
FreeFinfoList = (fp)->next; \
|
FreeFinfoList = (fp)->next; \
|
||||||
@@ -242,15 +242,15 @@ int MAXFINFO;
|
|||||||
free(fp); \
|
free(fp); \
|
||||||
(fp) = (FINFO *)NULL; \
|
(fp) = (FINFO *)NULL; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define FreeFinfo(fp) \
|
#define FreeFinfo(fp) \
|
||||||
{ \
|
do { \
|
||||||
FINFO *lastp; \
|
FINFO *lastp; \
|
||||||
for (lastp = fp; lastp->next != (FINFO *)NULL; lastp = lastp->next) {} \
|
for (lastp = fp; lastp->next != (FINFO *)NULL; lastp = lastp->next) {} \
|
||||||
lastp->next = FreeFinfoList; \
|
lastp->next = FreeFinfoList; \
|
||||||
FreeFinfoList = fp; \
|
FreeFinfoList = fp; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -85,10 +85,10 @@ extern LispPTR *KEYBUFFERING68k;
|
|||||||
/* of the handler, so let's do it once, correctly.) */
|
/* of the handler, so let's do it once, correctly.) */
|
||||||
/******************************************************/
|
/******************************************************/
|
||||||
#define ENABLE_KBD \
|
#define ENABLE_KBD \
|
||||||
{ \
|
do { \
|
||||||
outp(INTA00, ENDOFINTERRUPT); \
|
outp(INTA00, ENDOFINTERRUPT); \
|
||||||
outp(KBD_COMMAND_PORT, KBD_ENABLE); /* Turn kbd on again. */ \
|
outp(KBD_COMMAND_PORT, KBD_ENABLE); /* Turn kbd on again. */ \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
@@ -302,13 +302,13 @@ dostaking_mouse_up(int newx, int newy)
|
|||||||
currentmouse->Cursor.Last.width = w = currentdsp->Display.width - newx;
|
currentmouse->Cursor.Last.width = w = currentdsp->Display.width - newx;
|
||||||
} else {
|
} else {
|
||||||
currentmouse->Cursor.Last.width = w = 16;
|
currentmouse->Cursor.Last.width = w = 16;
|
||||||
};
|
}
|
||||||
|
|
||||||
if (currentdsp->Display.height < (newy + 16)) {
|
if (currentdsp->Display.height < (newy + 16)) {
|
||||||
currentmouse->Cursor.Last.height = h = currentdsp->Display.height - newy;
|
currentmouse->Cursor.Last.height = h = currentdsp->Display.height - newy;
|
||||||
} else {
|
} else {
|
||||||
currentmouse->Cursor.Last.height = h = 16;
|
currentmouse->Cursor.Last.height = h = 16;
|
||||||
};
|
}
|
||||||
|
|
||||||
srcbpl = currentdsp->Display.width;
|
srcbpl = currentdsp->Display.width;
|
||||||
dstbpl = 16;
|
dstbpl = 16;
|
||||||
|
|||||||
20
src/dsk.c
20
src/dsk.c
@@ -2811,7 +2811,7 @@ static int make_directory(char *dir)
|
|||||||
*/
|
*/
|
||||||
#ifdef DOS
|
#ifdef DOS
|
||||||
#define FindHighestVersion(varray, mentry, max_no) \
|
#define FindHighestVersion(varray, mentry, max_no) \
|
||||||
{ \
|
do { \
|
||||||
FileName *centry; \
|
FileName *centry; \
|
||||||
for (centry = varray, max_no = -1; centry->version_no != LASTVERSIONARRAY; centry++) { \
|
for (centry = varray, max_no = -1; centry->version_no != LASTVERSIONARRAY; centry++) { \
|
||||||
if (centry->version_no > max_no) { \
|
if (centry->version_no > max_no) { \
|
||||||
@@ -2819,10 +2819,10 @@ static int make_directory(char *dir)
|
|||||||
mentry = centry; \
|
mentry = centry; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define FindHighestVersion(varray, mentry, max_no) \
|
#define FindHighestVersion(varray, mentry, max_no) \
|
||||||
{ \
|
do { \
|
||||||
FileName *centry; \
|
FileName *centry; \
|
||||||
for (centry = (varray), (max_no) = 0; centry->version_no != LASTVERSIONARRAY; centry++) { \
|
for (centry = (varray), (max_no) = 0; centry->version_no != LASTVERSIONARRAY; centry++) { \
|
||||||
if (centry->version_no > (max_no)) { \
|
if (centry->version_no > (max_no)) { \
|
||||||
@@ -2830,7 +2830,7 @@ static int make_directory(char *dir)
|
|||||||
(mentry) = centry; \
|
(mentry) = centry; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
#endif /* DOS */
|
#endif /* DOS */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2859,7 +2859,7 @@ static int make_directory(char *dir)
|
|||||||
*/
|
*/
|
||||||
#ifdef DOS
|
#ifdef DOS
|
||||||
#define FindLowestVersion(varray, mentry, min_no) \
|
#define FindLowestVersion(varray, mentry, min_no) \
|
||||||
{ \
|
do { \
|
||||||
FileName *centry; \
|
FileName *centry; \
|
||||||
for (centry = varray, min_no = MAXVERSION; centry->version_no != LASTVERSIONARRAY; centry++) { \
|
for (centry = varray, min_no = MAXVERSION; centry->version_no != LASTVERSIONARRAY; centry++) { \
|
||||||
if (centry->version_no < min_no) { \
|
if (centry->version_no < min_no) { \
|
||||||
@@ -2867,10 +2867,10 @@ static int make_directory(char *dir)
|
|||||||
mentry = centry; \
|
mentry = centry; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define FindLowestVersion(varray, mentry, min_no) \
|
#define FindLowestVersion(varray, mentry, min_no) \
|
||||||
{ \
|
do { \
|
||||||
FileName *centry; \
|
FileName *centry; \
|
||||||
for (centry = (varray), (min_no) = MAXVERSION; centry->version_no != LASTVERSIONARRAY; centry++) { \
|
for (centry = (varray), (min_no) = MAXVERSION; centry->version_no != LASTVERSIONARRAY; centry++) { \
|
||||||
if (centry->version_no < (min_no) && centry->version_no != 0) { \
|
if (centry->version_no < (min_no) && centry->version_no != 0) { \
|
||||||
@@ -2878,7 +2878,7 @@ static int make_directory(char *dir)
|
|||||||
(mentry) = centry; \
|
(mentry) = centry; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
#endif /* DOS */
|
#endif /* DOS */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2906,7 +2906,7 @@ static int make_directory(char *dir)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define FindSpecifiedVersion(varray, sentry, ver_no) \
|
#define FindSpecifiedVersion(varray, sentry, ver_no) \
|
||||||
{ \
|
do { \
|
||||||
FileName *centry; \
|
FileName *centry; \
|
||||||
\
|
\
|
||||||
(sentry) = (FileName *)NULL; \
|
(sentry) = (FileName *)NULL; \
|
||||||
@@ -2915,7 +2915,7 @@ static int make_directory(char *dir)
|
|||||||
(sentry) = centry; \
|
(sentry) = centry; \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
0
src/dsp386.il
Executable file → Normal file
0
src/dsp386.il
Executable file → Normal file
0
src/dspSPARC.il
Executable file → Normal file
0
src/dspSPARC.il
Executable file → Normal file
@@ -165,12 +165,12 @@ void flip_cursor() {
|
|||||||
except those who want to try building loadups. */
|
except those who want to try building loadups. */
|
||||||
|
|
||||||
if (!for_makeinit) {
|
if (!for_makeinit) {
|
||||||
for (cnt = CURSORHEIGHT; (cnt--);) { GETWORD(word++) ^= 0xFFFF; };
|
for (cnt = CURSORHEIGHT; (cnt--);) { GETWORD(word++) ^= 0xFFFF; }
|
||||||
};
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
for (cnt = CURSORHEIGHT; (cnt--);) { GETWORD(word++) ^= 0xFFFF; };
|
for (cnt = CURSORHEIGHT; (cnt--);) { GETWORD(word++) ^= 0xFFFF; }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
20
src/ejlisp.c
20
src/ejlisp.c
@@ -37,7 +37,7 @@
|
|||||||
#define CHAR_SIZE CHAR_MAXLEN *(sizeof(char) / sizeof(int))
|
#define CHAR_SIZE CHAR_MAXLEN *(sizeof(char) / sizeof(int))
|
||||||
|
|
||||||
#define LStringToCString(Lisp, C, MaxLen, Len) \
|
#define LStringToCString(Lisp, C, MaxLen, Len) \
|
||||||
{ \
|
do { \
|
||||||
OneDArray *arrayp; \
|
OneDArray *arrayp; \
|
||||||
char *base; \
|
char *base; \
|
||||||
short *sbase; \
|
short *sbase; \
|
||||||
@@ -64,10 +64,10 @@
|
|||||||
\
|
\
|
||||||
default: error("LStringToCString can not handle\n"); \
|
default: error("LStringToCString can not handle\n"); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define CStringToLString(C, Lisp, Len) \
|
#define CStringToLString(C, Lisp, Len) \
|
||||||
{ \
|
do { \
|
||||||
OneDArray *arrayp; \
|
OneDArray *arrayp; \
|
||||||
char *base; \
|
char *base; \
|
||||||
short *sbase; \
|
short *sbase; \
|
||||||
@@ -93,18 +93,18 @@
|
|||||||
\
|
\
|
||||||
default: error("CStringToLString can not handle\n"); \
|
default: error("CStringToLString can not handle\n"); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define IntToFixp(C, Lisp) \
|
#define IntToFixp(C, Lisp) \
|
||||||
{ \
|
do { \
|
||||||
int *base; \
|
int *base; \
|
||||||
\
|
\
|
||||||
base = (int *)NativeAligned4FromLAddr((unsigned int)Lisp); \
|
base = (int *)NativeAligned4FromLAddr((unsigned int)Lisp); \
|
||||||
*base = C; \
|
*base = C; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define ZeroFix(C) \
|
#define ZeroFix(C) \
|
||||||
{ \
|
do { \
|
||||||
int k, j; \
|
int k, j; \
|
||||||
\
|
\
|
||||||
if (C[0] == 0 && C[1] != 0) { \
|
if (C[0] == 0 && C[1] != 0) { \
|
||||||
@@ -113,15 +113,15 @@
|
|||||||
} \
|
} \
|
||||||
C[j] = 0; \
|
C[j] = 0; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define EJLISP_SETJMP(x) \
|
#define EJLISP_SETJMP(x) \
|
||||||
{ \
|
do { \
|
||||||
if (setjmp(jmpbuf) != 0) { \
|
if (setjmp(jmpbuf) != 0) { \
|
||||||
ejlisp_buf = NULL; \
|
ejlisp_buf = NULL; \
|
||||||
return (x); \
|
return (x); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
typedef struct first_array {
|
typedef struct first_array {
|
||||||
unsigned int orig : 1;
|
unsigned int orig : 1;
|
||||||
|
|||||||
14
src/eqf.c
14
src/eqf.c
@@ -64,12 +64,14 @@ BIGNUM (integer that can't be represented bigger than 32 bits)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define IF_IMMEDIATE(arg, doit, doitsmall) \
|
#define IF_IMMEDIATE(arg, doit, doitsmall) \
|
||||||
switch (SEGMASK & (arg)) { \
|
do { \
|
||||||
case ATOM_OFFSET: doit; /* NOLINT(bugprone-macro-parentheses) */ \
|
switch (SEGMASK & (arg)) { \
|
||||||
case S_CHARACTER: doit; /* NOLINT(bugprone-macro-parentheses) */ \
|
case ATOM_OFFSET: doit; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
case S_POSITIVE: doitsmall; /* NOLINT(bugprone-macro-parentheses) */ \
|
case S_CHARACTER: doit; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
case S_NEGATIVE: doitsmall; /* NOLINT(bugprone-macro-parentheses) */ \
|
case S_POSITIVE: doitsmall; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
}
|
case S_NEGATIVE: doitsmall; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
204
src/ether_common.c
Normal file
204
src/ether_common.c
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
/* $Id: ether.c,v 1.4 2001/12/24 01:09:02 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* (C) Copyright 1989-1996 inclusive Venue. All Rights Reserved. */
|
||||||
|
/* Manufactured in the United States of America. */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "lsptypes.h"
|
||||||
|
#include "lspglob.h"
|
||||||
|
#include "adr68k.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* global variables exported to ether_*.c and possibly others
|
||||||
|
*/
|
||||||
|
|
||||||
|
int ether_fd = -1; /* file descriptor for ether socket */
|
||||||
|
|
||||||
|
u_char ether_host[6] = {0, 0, 0, 0, 0, 0}; /* 48 bit address of this node */
|
||||||
|
u_char broadcast[6] = {255, 255, 255, 255, 255, 255};
|
||||||
|
|
||||||
|
int ether_bsize = 0; /* if nonzero then a receive is pending */
|
||||||
|
u_char *ether_buf = NULL; /* address of receive buffer */
|
||||||
|
|
||||||
|
int ETHEREventCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* public procedures
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* i n i t _ i f p a g e _ e t h e r */
|
||||||
|
/* */
|
||||||
|
/* sets Lisp's idea of \my.nsaddress. Clears it if ether not */
|
||||||
|
/* enabled */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
|
||||||
|
void init_ifpage_ether() {
|
||||||
|
InterfacePage->nshost0 = (DLword)((ether_host[0] << 8) + ether_host[1]);
|
||||||
|
InterfacePage->nshost1 = (DLword)((ether_host[2] << 8) + ether_host[3]);
|
||||||
|
InterfacePage->nshost2 = (DLword)((ether_host[4] << 8) + ether_host[5]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define MASKWORD1 0xffff
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* c h e c k _ s u m */
|
||||||
|
/* */
|
||||||
|
/* Implements the CHECKSUM opcode; compute the checksum for an */
|
||||||
|
/* ethernet packet. */
|
||||||
|
/* */
|
||||||
|
/* args[0] LispPTR base; */
|
||||||
|
/* args[1] LispPTR nwords; */
|
||||||
|
/* args[2] LispPTR initsum; */
|
||||||
|
/* */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
|
||||||
|
LispPTR check_sum(LispPTR *args)
|
||||||
|
{
|
||||||
|
LispPTR checksum;
|
||||||
|
DLword *address;
|
||||||
|
int nwords;
|
||||||
|
|
||||||
|
address = (DLword *)NativeAligned2FromLAddr(*args++);
|
||||||
|
nwords = *args++;
|
||||||
|
|
||||||
|
if (*args != NIL)
|
||||||
|
checksum = (*args) & MASKWORD1;
|
||||||
|
else
|
||||||
|
checksum = 0;
|
||||||
|
|
||||||
|
for (; nwords > (S_POSITIVE); address++, nwords--) {
|
||||||
|
checksum = checksum + GETWORD(address);
|
||||||
|
if (checksum > 0xffff) checksum = (checksum & 0xffff) + 1; /* add carry */
|
||||||
|
|
||||||
|
if (checksum > 0x7fff) /* ROTATE LEFT 1 */
|
||||||
|
checksum = ((checksum & 0x7fff) << 1) | 1;
|
||||||
|
else
|
||||||
|
checksum = checksum << 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checksum == MASKWORD1)
|
||||||
|
return (S_POSITIVE); /* ret 0 */
|
||||||
|
else
|
||||||
|
return (S_POSITIVE | checksum);
|
||||||
|
|
||||||
|
} /*check_sum */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* dummy implementation of SUBRs if none of the networking options is compiled in
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(MAIKO_ENABLE_ETHERNET) && !defined(MAIKO_ENABLE_NETHUB)
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* e t h e r _ s u s p e n d */
|
||||||
|
/* */
|
||||||
|
/* Suspend receiving packets. */
|
||||||
|
/* 175/70/0 */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
LispPTR ether_suspend(LispPTR args[])
|
||||||
|
{
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* e t h e r _ r e s u m e */
|
||||||
|
/* */
|
||||||
|
/* resume nit socket to receive all types of packets 175/71/0 */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
LispPTR ether_resume(LispPTR args[])
|
||||||
|
{
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* e t h e r _ c t r l r */
|
||||||
|
/* */
|
||||||
|
/* return T if ether controller is available 175/72/0 */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
LispPTR ether_ctrlr(LispPTR args[])
|
||||||
|
{
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
/**********************************************************************
|
||||||
|
* ether_reset(args) 175/73/0
|
||||||
|
* reset ether controller and disable receipt of packets
|
||||||
|
**********************************************************************/
|
||||||
|
LispPTR ether_reset(LispPTR args[])
|
||||||
|
{
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* e t h e r _ g e t (175/74/2) */
|
||||||
|
/* */
|
||||||
|
/* Set up the Ethernet driver to receive a packet. The driver */
|
||||||
|
/* first tries to read any pending packet from the net, and if */
|
||||||
|
/* there is one, ether_get returns T. If there is no pending */
|
||||||
|
/* packet, the failing read sets us up to get an interrupt when */
|
||||||
|
/* a packet DOES arrive, and ether_get returns NIL. */
|
||||||
|
/* */
|
||||||
|
/* args[0] Length of the buffer we're passed */
|
||||||
|
/* args[1] LISP address of a packet buffer */
|
||||||
|
/* */
|
||||||
|
/* sets ether_buf to the buffer address, for check_ether's use */
|
||||||
|
/* sets ether_bsize to the buffer size. ether_bsize>0 means */
|
||||||
|
/* it's OK to read packets from the network on interrupt. */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
LispPTR ether_get(LispPTR args[])
|
||||||
|
{
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* ether_send(args) 175/75/2 max_words,buffer_addr
|
||||||
|
* send a packet
|
||||||
|
**********************************************************************/
|
||||||
|
LispPTR ether_send(LispPTR args[])
|
||||||
|
{
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* ether_setfilter(args) 175/76/1 filterbits
|
||||||
|
* check whether a packet has come. if does, notify iocb
|
||||||
|
**********************************************************************/
|
||||||
|
LispPTR ether_setfilter(LispPTR args[])
|
||||||
|
{
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* check_ether() 175/77/0
|
||||||
|
* checks an incoming packet
|
||||||
|
**********************************************************************/
|
||||||
|
LispPTR check_ether()
|
||||||
|
{
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
577
src/ether_nethub.c
Normal file
577
src/ether_nethub.c
Normal file
@@ -0,0 +1,577 @@
|
|||||||
|
/*******************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* Support for Dodo Nethub networking (see: https://github.com/devhawala/dodo) */
|
||||||
|
/* */
|
||||||
|
/* Copyright (c) 2022, Dr. Hans-Walter Latz. All rights reserved. */
|
||||||
|
/* Released to the Public Domain. */
|
||||||
|
/* */
|
||||||
|
/*******************************************************************************/
|
||||||
|
|
||||||
|
#if defined(MAIKO_ENABLE_NETHUB) && !defined(MAIKO_ENABLE_ETHERNET)
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#include <sys/poll.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
#include "commondefs.h"
|
||||||
|
#include "lispemul.h"
|
||||||
|
#include "lispmap.h"
|
||||||
|
#include "emlglob.h"
|
||||||
|
#include "lsptypes.h"
|
||||||
|
#include "lspglob.h"
|
||||||
|
#include "adr68k.h"
|
||||||
|
#include "ether.h"
|
||||||
|
#include "dbprint.h"
|
||||||
|
#include "etherdefs.h"
|
||||||
|
#include "ifpage.h"
|
||||||
|
#include "iopage.h"
|
||||||
|
#include "byteswapdefs.h"
|
||||||
|
#include "dbprint.h"
|
||||||
|
#include "timerdefs.h"
|
||||||
|
#include "lisp2cdefs.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
** --- ether implementation common data -------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
extern int ether_fd; /* file descriptor for ether socket */
|
||||||
|
extern u_char ether_host[6]; /* 48 bit address of this node */
|
||||||
|
extern u_char broadcast[6];
|
||||||
|
extern int ether_bsize; /* if nonzero then a receive is pending */
|
||||||
|
extern u_char *ether_buf; /* address of receive buffer */
|
||||||
|
extern LispPTR *PENDINGINTERRUPT68k;
|
||||||
|
extern fd_set LispReadFds;
|
||||||
|
|
||||||
|
/*
|
||||||
|
** --- nethub configuration data --------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
static char* nethubHost = NULL;
|
||||||
|
static int nethubPort = 3333;
|
||||||
|
static int mac0 = 0xCA;
|
||||||
|
static int mac1 = 0xFF;
|
||||||
|
static int mac2 = 0xEE;
|
||||||
|
static int mac3 = 0x12;
|
||||||
|
static int mac4 = 0x34;
|
||||||
|
static int mac5 = 0x56;
|
||||||
|
|
||||||
|
void setNethubHost(char* host) {
|
||||||
|
if (host && *host) {
|
||||||
|
nethubHost = host;
|
||||||
|
DBPRINT(("nh :: host now: '%s'\n", nethubHost));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setNethubPort(int port) {
|
||||||
|
if (port > 0 && port <= 65535) {
|
||||||
|
nethubPort = port;
|
||||||
|
DBPRINT(("nh :: port now: %d\n", nethubPort));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setNethubMac(int m0, int m1, int m2, int m3, int m4, int m5) {
|
||||||
|
if ( m0 >= 0 && m0 <= 255
|
||||||
|
&& m1 >= 0 && m1 <= 255
|
||||||
|
&& m2 >= 0 && m2 <= 255
|
||||||
|
&& m3 >= 0 && m3 <= 255
|
||||||
|
&& m4 >= 0 && m4 <= 255
|
||||||
|
&& m5 >= 0 && m5 <= 255) {
|
||||||
|
mac0 = m0;
|
||||||
|
mac1 = m1;
|
||||||
|
mac2 = m2;
|
||||||
|
mac3 = m3;
|
||||||
|
mac4 = m4;
|
||||||
|
mac5 = m5;
|
||||||
|
DBPRINT(("nh :: mac now: %02X-%02X-%02X-%02X-%02X-%02X\n", mac0, mac1, mac2, mac3, mac4, mac5));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** --- very simple logging --------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
static int loglevel = 0;
|
||||||
|
static int logcnt = 0;
|
||||||
|
|
||||||
|
void setNethubLogLevel(int ll) {
|
||||||
|
loglevel = ll;
|
||||||
|
DBPRINT(("nh :: loglevel now: %d\n", loglevel));
|
||||||
|
}
|
||||||
|
|
||||||
|
#define log_info(line) { if (loglevel == 1) \
|
||||||
|
{ printf("nh-info[%d]: ", logcnt++); printf line; }}
|
||||||
|
#define log_debug(line) { if (loglevel >= 2) \
|
||||||
|
{ printf("nh-debug[%d]: ", logcnt++); printf line; }}
|
||||||
|
#define log_all(line) { if (loglevel < 1) \
|
||||||
|
{ printf("nh[%d]: ", logcnt++); printf line; }}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** --- utilities ------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LONG_PTR_MASK ((long)(~((long)3)))
|
||||||
|
|
||||||
|
static void dblwordsSwap(u_char* basePtr, int forBytes) {
|
||||||
|
u_char* dblwordPtr = (u_char*)((long)basePtr & LONG_PTR_MASK);
|
||||||
|
int neededBytes = forBytes + (basePtr - dblwordPtr);
|
||||||
|
int dblwordCount = (neededBytes + 3) / 4;
|
||||||
|
word_swap_page((unsigned short*)dblwordPtr, dblwordCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** --- connect, disconnect and transmit packets -----------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
void connectToHub() {
|
||||||
|
if (nethubHost == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ether_fd > -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
log_debug(("connectToHub() - begin\n"));
|
||||||
|
|
||||||
|
ether_host[0] = mac0;
|
||||||
|
ether_host[1] = mac1;
|
||||||
|
ether_host[2] = mac2;
|
||||||
|
ether_host[3] = mac3;
|
||||||
|
ether_host[4] = mac4;
|
||||||
|
ether_host[5] = mac5;
|
||||||
|
|
||||||
|
log_debug((" resolving nethub hostname\n"));
|
||||||
|
|
||||||
|
struct hostent *host = gethostbyname(nethubHost);
|
||||||
|
if (host == NULL || host->h_addr_list == NULL) {
|
||||||
|
log_debug(("connectToHub(): hostname '%s' cannot be resolved\n", nethubHost));
|
||||||
|
log_info(("connectToHub(): hostname '%s' cannot be resolved\n", nethubHost));
|
||||||
|
log_all(("connectToHub(): hostname '%s' cannot be resolved\n", nethubHost));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
log_debug((" connecting to nethub\n"));
|
||||||
|
|
||||||
|
struct sockaddr_in hubaddr;
|
||||||
|
hubaddr.sin_family = AF_INET;
|
||||||
|
hubaddr.sin_addr.s_addr = *(in_addr_t *)host->h_addr_list[0];
|
||||||
|
hubaddr.sin_port = htons(nethubPort);
|
||||||
|
|
||||||
|
ether_fd = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
if (ether_fd < 0) {
|
||||||
|
log_info(("connectToHub(): FAILED to create AF_INET/SOCK_STREAM socket\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (connect(ether_fd, (struct sockaddr*)&hubaddr, sizeof(hubaddr)) < 0) {
|
||||||
|
perror("connectToHub() - connect failed");
|
||||||
|
close(ether_fd);
|
||||||
|
ether_fd = -1;
|
||||||
|
log_info(("connectToHub(): FAILED to connect to nethub\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log_debug((" connected to nethub, ether_fd = %d\n", ether_fd));
|
||||||
|
|
||||||
|
FD_SET(ether_fd, &LispReadFds);
|
||||||
|
log_debug((" added ether_fd to LispReadFds\n"));
|
||||||
|
|
||||||
|
log_debug(("connectToHub() - end\n\n"));
|
||||||
|
log_info(("connectToHub() - connected to nethub\n"));
|
||||||
|
log_all(("connectToHub() - connected to nethub\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void disconnectFromHub() {
|
||||||
|
if (ether_fd > -1) {
|
||||||
|
close(ether_fd);
|
||||||
|
ether_fd = -1;
|
||||||
|
log_debug(("disconnectFromHub() - disconnected from nethub\n"));
|
||||||
|
log_info(("disconnectFromHub() - disconnected from nethub\n"));
|
||||||
|
log_all(("disconnectFromHub() - disconnected from nethub\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Input:
|
||||||
|
* ether_fd: fd to read Nethub format packets from
|
||||||
|
* ether_bsize: size of ether_buf storage
|
||||||
|
* Output:
|
||||||
|
* ether_buf: buffer to copy XIP packet into
|
||||||
|
* ether_bsize: set to 0 if packet returned
|
||||||
|
* Returns:
|
||||||
|
* -1: failed/not connected
|
||||||
|
* 0: no packet available
|
||||||
|
* >0: number of bytes received and placed in ether_buf
|
||||||
|
*/
|
||||||
|
|
||||||
|
static int recvPacket() {
|
||||||
|
int rcvLen;
|
||||||
|
unsigned short bLen;
|
||||||
|
|
||||||
|
if (ether_fd < 0) {
|
||||||
|
log_debug((" recvPacket() :: not connected to hub !!!\n"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ether_bsize < 1) {
|
||||||
|
log_debug((" recvPacket() :: no receive buffer present -> return 0\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* start by reading the (network byte order) short value indicating the size of the
|
||||||
|
* XIP packet being received
|
||||||
|
*/
|
||||||
|
rcvLen = recv(ether_fd, &bLen, sizeof(bLen), MSG_DONTWAIT);
|
||||||
|
if (rcvLen < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
|
||||||
|
perror("recvPacket() :: recv(ether_fd, &bLen, sizeof(bLen), MSG_DONTWAIT)");
|
||||||
|
disconnectFromHub();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (rcvLen <= 0) {
|
||||||
|
log_debug((" recvPacket() :: no network packet available -> return 0\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bLen = ntohs(bLen);
|
||||||
|
log_debug((" recvPacket() :: received %d bytes, logical packet length = %d bytes\n", rcvLen, bLen));
|
||||||
|
|
||||||
|
if (bLen & 0x0001) {
|
||||||
|
log_debug(("recvPacket() ERROR :: odd byte length of logical packet -> disconnecting from nethub\n"));
|
||||||
|
log_info(("recvPacket() ERROR :: odd byte length of logical packet -> disconnecting from nethub\n"));
|
||||||
|
log_all(("recvPacket() ERROR :: odd byte length of logical packet -> disconnecting from nethub\n"));
|
||||||
|
disconnectFromHub();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (bLen > ether_bsize) {
|
||||||
|
log_debug((" recvPacket() ERROR :: logical packet larger than buffer -> disconnecting from nethub\n"));
|
||||||
|
log_info(("recvPacket() ERROR :: logical packet larger than buffer -> disconnecting from nethub\n"));
|
||||||
|
log_all(("recvPacket() ERROR :: logical packet larger than buffer -> disconnecting from nethub\n"));
|
||||||
|
disconnectFromHub();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* continue reading the XIP packet of the just determined size
|
||||||
|
*/
|
||||||
|
rcvLen = recv(ether_fd, ether_buf, bLen, MSG_DONTWAIT);
|
||||||
|
if (rcvLen < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
|
||||||
|
perror("recvPacket() :: recv(ether_fd, ether_buf, bLen, MSG_DONTWAIT)");
|
||||||
|
disconnectFromHub();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (rcvLen <= 0) {
|
||||||
|
log_debug((" recvPacket() :: no network packet available -> return 0\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bLen != rcvLen) {
|
||||||
|
log_debug((" recvPacket() WARNING :: packet size mismatch -> discard packet -> return 0\n"));
|
||||||
|
log_info(("recvPacket() WARNING :: packet size mismatch -> discard packet -> return 0\n"));
|
||||||
|
log_all(("recvPacket() WARNING :: packet size mismatch -> discard packet -> return 0\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bLen < 14) {
|
||||||
|
/* not even enough bytes for the ethernet header */
|
||||||
|
/* -> discard packet */
|
||||||
|
log_debug((" recvPacket() WARNING :: packet too small -> discard packet -> return 0\n"));
|
||||||
|
log_info(("recvPacket() WARNING :: packet too small -> discard packet -> return 0\n"));
|
||||||
|
log_all(("recvPacket() WARNING :: packet too small -> discard packet -> return 0\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( memcmp(ether_buf, ether_host, 6) != 0
|
||||||
|
&& memcmp(ether_buf, broadcast, 6) != 0) {
|
||||||
|
log_debug((" recvPacket() :: packet is not for us and not a broadcast, ignoring packet\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(BYTESWAP)
|
||||||
|
log_debug((" recvPacket() :: byte-swapping %d bytes at %p\n", bLen, (void *)ether_buf));
|
||||||
|
dblwordsSwap(ether_buf, bLen);
|
||||||
|
IOPage->dlethernet[2] = bLen;
|
||||||
|
#else
|
||||||
|
log_debug((" recvPacket() :: %d bytes at %p\n", bLen, (void *)ether_buf));
|
||||||
|
IOPage->dlethernet[3] = bLen;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ether_bsize = 0;
|
||||||
|
|
||||||
|
|
||||||
|
return bLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -1: failed/not connected; >= 0: packet bytes sent */
|
||||||
|
static int sendPacket(u_char *source, int sourceLen) {
|
||||||
|
struct msghdr msg = {0};
|
||||||
|
struct iovec iov[2];
|
||||||
|
uint16_t nhlength;
|
||||||
|
|
||||||
|
if (ether_fd < 0) {
|
||||||
|
log_debug((" sendPacket() :: not connected to hub !!!\n"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sourceLen < 14) {
|
||||||
|
log_debug((" sendPacket() :: invalid packet length: %d !!!\n", sourceLen));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sourceLen & 0x0001) {
|
||||||
|
log_debug((" sendPacket() :: packet length not even (mutiple of 2) !!!\n"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
nhlength = htons(sourceLen);
|
||||||
|
iov[0].iov_base = &nhlength;
|
||||||
|
iov[0].iov_len = 2;
|
||||||
|
iov[1].iov_base = source;
|
||||||
|
iov[1].iov_len = sourceLen;
|
||||||
|
msg.msg_iov = iov;
|
||||||
|
msg.msg_iovlen = 2;
|
||||||
|
|
||||||
|
int result = sendmsg(ether_fd, &msg, 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** --- SUBR implementations -------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* e t h e r _ s u s p e n d */
|
||||||
|
/* */
|
||||||
|
/* Suspend receiving packets. */
|
||||||
|
/* 175/70/0 */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
LispPTR ether_suspend(LispPTR args[])
|
||||||
|
{
|
||||||
|
if (nethubHost == NULL) {
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
log_debug(("ether_suspend() -- ignored!\n\n"));
|
||||||
|
log_info(("ether_suspend()\n"));
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* e t h e r _ r e s u m e */
|
||||||
|
/* */
|
||||||
|
/* resume nit socket to receive all types of packets 175/71/0 */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
LispPTR ether_resume(LispPTR args[])
|
||||||
|
{
|
||||||
|
if (nethubHost == NULL) {
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
log_debug(("ether_resume() - begin\n"));
|
||||||
|
int_io_open(ether_fd);
|
||||||
|
log_debug(("ether_resume() - end\n\n"));
|
||||||
|
log_info(("ether_resume()\n"));
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* e t h e r _ c t r l r */
|
||||||
|
/* */
|
||||||
|
/* return T if ether controller is available 175/72/0 */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
LispPTR ether_ctrlr(LispPTR args[])
|
||||||
|
{
|
||||||
|
if (nethubHost == NULL) {
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
log_debug(("ether_ctrlr() - begin\n"));
|
||||||
|
|
||||||
|
connectToHub();
|
||||||
|
|
||||||
|
if (ether_fd < 0) {
|
||||||
|
log_debug(("ether_ctrlr() - end -> NIL\n\n"));
|
||||||
|
log_info(("ether_ctrlr() -> NIL\n"));
|
||||||
|
return (NIL);
|
||||||
|
} else {
|
||||||
|
int_io_open(ether_fd);
|
||||||
|
log_debug(("ether_ctrlr() - end -> ATOM_T\n\n"));
|
||||||
|
log_info(("ether_ctrlr() -> ATOM_T\n"));
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* ether_reset(args) 175/73/0
|
||||||
|
* reset ether controller and disable receipt of packets
|
||||||
|
**********************************************************************/
|
||||||
|
LispPTR ether_reset(LispPTR args[])
|
||||||
|
{
|
||||||
|
if (nethubHost == NULL) {
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
log_debug(("ether_reset() - begin\n"));
|
||||||
|
|
||||||
|
if (ether_fd < 0) {
|
||||||
|
log_debug(("ether_reset() - end -> NIL\n\n"));
|
||||||
|
log_info(("ether_reset() -> NIL\n"));
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
ether_bsize = 0; /* deactivate receiver */
|
||||||
|
log_debug(("ether_reset() - end -> ATOM_T\n\n"));
|
||||||
|
log_info(("ether_reset() -> ATOM_T\n"));
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* e t h e r _ g e t (175/74/2) */
|
||||||
|
/* */
|
||||||
|
/* Set up the Ethernet driver to receive a packet. The driver */
|
||||||
|
/* first tries to read any pending packet from the net, and if */
|
||||||
|
/* there is one, ether_get returns T. If there is no pending */
|
||||||
|
/* packet, the failing read sets us up to get an interrupt when */
|
||||||
|
/* a packet DOES arrive, and ether_get returns NIL. */
|
||||||
|
/* */
|
||||||
|
/* args[0] Length of the buffer we're passed */
|
||||||
|
/* args[1] LISP address of a packet buffer */
|
||||||
|
/* */
|
||||||
|
/* sets ether_buf to the buffer address, for check_ether's use */
|
||||||
|
/* sets ether_bsize to the buffer size. ether_bsize>0 means */
|
||||||
|
/* it's OK to read packets from the network on interrupt. */
|
||||||
|
/* */
|
||||||
|
/************************************************************************/
|
||||||
|
LispPTR ether_get(LispPTR args[])
|
||||||
|
{
|
||||||
|
int receivedBytes;
|
||||||
|
u_char *target;
|
||||||
|
int maxByteCount;
|
||||||
|
|
||||||
|
if (nethubHost == NULL) {
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
log_debug(("ether_get() - begin\n"));
|
||||||
|
|
||||||
|
target = (u_char *)NativeAligned2FromLAddr(args[1]);
|
||||||
|
maxByteCount = 2 * LispIntToCInt(args[0]); /* words to bytes */
|
||||||
|
log_debug((" target = %p maxBytecount: %d bytes\n", (void *)target, maxByteCount));
|
||||||
|
|
||||||
|
ether_buf = target;
|
||||||
|
ether_bsize = maxByteCount;
|
||||||
|
|
||||||
|
receivedBytes = recvPacket();
|
||||||
|
|
||||||
|
log_debug(("ether_get() :: receivedBytes: %d bytes\n", receivedBytes));
|
||||||
|
if (receivedBytes <= 0) {
|
||||||
|
log_debug(("ether_get() - end -> NIL\n\n"));
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
log_debug(("ether_get() - end -> ATOM_T\n\n"));
|
||||||
|
log_info(("ether_get(): received packet, len = %d bytes\n", receivedBytes));
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* ether_send(args) 175/75/2 max_words,buffer_addr
|
||||||
|
* send a packet
|
||||||
|
**********************************************************************/
|
||||||
|
LispPTR ether_send(LispPTR args[])
|
||||||
|
{
|
||||||
|
if (nethubHost == NULL) {
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
log_debug(("ether_send() - begin\n"));
|
||||||
|
|
||||||
|
u_char *source = (u_char *)NativeAligned2FromLAddr(args[1]);
|
||||||
|
int byteCount = 2 * LispIntToCInt(args[0]); /* words to bytes */
|
||||||
|
|
||||||
|
log_debug((" source = %p , bytecount: %d bytes\n", (void *)source, byteCount));
|
||||||
|
|
||||||
|
#if defined(BYTESWAP)
|
||||||
|
dblwordsSwap(source, byteCount);
|
||||||
|
int bytesSent = sendPacket(source, byteCount);
|
||||||
|
dblwordsSwap(source, byteCount);
|
||||||
|
#else
|
||||||
|
int bytesSent = sendPacket(source, byteCount);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (bytesSent < 0) {
|
||||||
|
log_debug(("ether_send() - failed (bytesSent: %d bytes) -> NIL\n\n", bytesSent));
|
||||||
|
log_info(("ether_send(): FAILED to send packet, len = %d\n", byteCount));
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
log_debug(("ether_send() - end -> ATOM_T\n\n"));
|
||||||
|
log_info(("ether_send(): sent packet, len = %d\n", bytesSent));
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* ether_setfilter(args) 175/76/1 filterbits
|
||||||
|
* check whether a packet has come. if does, notify iocb
|
||||||
|
**********************************************************************/
|
||||||
|
LispPTR ether_setfilter(LispPTR args[])
|
||||||
|
{
|
||||||
|
log_debug(("ether_setfilter() - ????\n\n"));
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* check_ether() 175/77/0
|
||||||
|
* checks an incoming packet
|
||||||
|
**********************************************************************/
|
||||||
|
LispPTR check_ether()
|
||||||
|
{
|
||||||
|
int receivedBytes;
|
||||||
|
struct pollfd pfds[1];
|
||||||
|
|
||||||
|
if (ether_fd < 0) {
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
log_debug(("check_ether() - begin\n"));
|
||||||
|
pfds[0].fd = ether_fd;
|
||||||
|
pfds[0].events = POLLIN;
|
||||||
|
pfds[0].revents = 0;
|
||||||
|
poll(pfds, 1, 0);
|
||||||
|
if (!(pfds[0].revents & POLLIN)) {
|
||||||
|
log_debug(("check_ether() - poll end -> NIL\n\n"));
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
receivedBytes = recvPacket();
|
||||||
|
if (receivedBytes <= 0) {
|
||||||
|
log_debug(("check_ether() - data end -> NIL\n\n"));
|
||||||
|
return (NIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
((INTSTAT *)NativeAligned4FromLAddr(*INTERRUPTSTATE_word))->ETHERInterrupt = 1;
|
||||||
|
Irq_Stk_Check = Irq_Stk_End = 0; /* ??? */
|
||||||
|
*PENDINGINTERRUPT68k = (ATOM_T);
|
||||||
|
log_debug(("check_ether() :: raised LISP interrupt\n"));
|
||||||
|
log_debug(("check_ether() :: INTERRUPTSTATE_word = 0x%08X\n",
|
||||||
|
*((int*)NativeAligned4FromLAddr(*INTERRUPTSTATE_word))));
|
||||||
|
log_info(("check_ether(): received packet, len = %d bytes\n", receivedBytes));
|
||||||
|
log_debug(("check_ether() - end -> ATOM_T\n\n"));
|
||||||
|
return (ATOM_T);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* MAIKO_ENABLE_NETHUB */
|
||||||
|
|
||||||
@@ -7,6 +7,8 @@
|
|||||||
/* */
|
/* */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
|
#if defined(MAIKO_ENABLE_ETHERNET) && !defined(MAIKO_ENABLE_NETHUB)
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#if defined(USE_DLPI)
|
#if defined(USE_DLPI)
|
||||||
@@ -79,17 +81,17 @@
|
|||||||
#define NIOCSETF PFIOCSETF
|
#define NIOCSETF PFIOCSETF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int ether_fd = -1; /* file descriptor for ether socket */
|
extern int ether_fd; /* file descriptor for ether socket */
|
||||||
int ether_intf_type = 0;
|
static int ether_intf_type = 0;
|
||||||
u_char ether_host[6] = {0, 0, 0, 0, 0, 0}; /* 48 bit address of this node */
|
extern u_char ether_host[6]; /* 48 bit address of this node */
|
||||||
u_char broadcast[6] = {255, 255, 255, 255, 255, 255};
|
extern u_char broadcast[6];
|
||||||
int ether_bsize = 0; /* if nonzero then a receive is pending */
|
extern int ether_bsize; /* if nonzero then a receive is pending */
|
||||||
u_char *ether_buf; /* address of receive buffer */
|
extern u_char *ether_buf; /* address of receive buffer */
|
||||||
u_char nit_buf[3000]; /* the current chunk read from NIT (one packet) */
|
static u_char nit_buf[3000]; /* the current chunk read from NIT (one packet) */
|
||||||
extern LispPTR *PENDINGINTERRUPT68k;
|
extern LispPTR *PENDINGINTERRUPT68k;
|
||||||
extern fd_set LispReadFds;
|
extern fd_set LispReadFds;
|
||||||
|
|
||||||
int ETHEREventCount = 0;
|
extern int ETHEREventCount;
|
||||||
|
|
||||||
#define PacketTypeIP 0x0800
|
#define PacketTypeIP 0x0800
|
||||||
#define PacketTypeARP 0x0806
|
#define PacketTypeARP 0x0806
|
||||||
@@ -120,7 +122,6 @@ int ETHEREventCount = 0;
|
|||||||
ments of the stack and replaces them with its result. When
|
ments of the stack and replaces them with its result. When
|
||||||
both an action and operator are specified in the same short-
|
both an action and operator are specified in the same short-
|
||||||
word, the action is performed followed by the operation.
|
word, the action is performed followed by the operation.
|
||||||
|
|
||||||
The binary operator can also be from the set { ENF_COR,
|
The binary operator can also be from the set { ENF_COR,
|
||||||
ENF_CAND, ENF_CNOR, ENF_CNAND }. These are "short-circuit"
|
ENF_CAND, ENF_CNOR, ENF_CNAND }. These are "short-circuit"
|
||||||
operators, in that they terminate the execution of the
|
operators, in that they terminate the execution of the
|
||||||
@@ -132,7 +133,6 @@ int ETHEREventCount = 0;
|
|||||||
false; ENF_CNOR returns false if the result is true. Unlike
|
false; ENF_CNOR returns false if the result is true. Unlike
|
||||||
the other binary operators, these four do not leave a result
|
the other binary operators, these four do not leave a result
|
||||||
on the stack, even if they continue.
|
on the stack, even if they continue.
|
||||||
|
|
||||||
The short-circuit operators should be used when possible, to
|
The short-circuit operators should be used when possible, to
|
||||||
reduce the amount of time spent evaluating filters. When
|
reduce the amount of time spent evaluating filters. When
|
||||||
they are used, you should also arrange the order of the
|
they are used, you should also arrange the order of the
|
||||||
@@ -140,7 +140,6 @@ int ETHEREventCount = 0;
|
|||||||
possible; for example, checking the IP destination field of
|
possible; for example, checking the IP destination field of
|
||||||
a UDP packet is more likely to indicate failure than the
|
a UDP packet is more likely to indicate failure than the
|
||||||
packet type field.
|
packet type field.
|
||||||
|
|
||||||
The special action ENF_NOPUSH and the special operator
|
The special action ENF_NOPUSH and the special operator
|
||||||
ENF_NOP can be used to only perform the binary operation or
|
ENF_NOP can be used to only perform the binary operation or
|
||||||
to only push a value on the stack. Since both are (con-
|
to only push a value on the stack. Since both are (con-
|
||||||
@@ -148,7 +147,6 @@ int ETHEREventCount = 0;
|
|||||||
actually specifies the action followed by ENF_NOP, and indi-
|
actually specifies the action followed by ENF_NOP, and indi-
|
||||||
cating only an operation actually specifies ENF_NOPUSH fol-
|
cating only an operation actually specifies ENF_NOPUSH fol-
|
||||||
lowed by the operation.
|
lowed by the operation.
|
||||||
|
|
||||||
After executing the filter command list, a non-zero value
|
After executing the filter command list, a non-zero value
|
||||||
(true) left on top of the stack (or an empty stack) causes
|
(true) left on top of the stack (or an empty stack) causes
|
||||||
the incoming packet to be accepted and a zero value (false)
|
the incoming packet to be accepted and a zero value (false)
|
||||||
@@ -727,13 +725,13 @@ static int check_filter(u_char *buffer)
|
|||||||
case PacketTypeIP: return (0);
|
case PacketTypeIP: return (0);
|
||||||
case PacketTypeARP: return (0);
|
case PacketTypeARP: return (0);
|
||||||
default: return (1);
|
default: return (1);
|
||||||
};
|
}
|
||||||
/* my address */
|
/* my address */
|
||||||
if (ether_addr_equal(buffer, ether_host)) switch (((short *)buffer)[6]) {
|
if (ether_addr_equal(buffer, ether_host)) switch (((short *)buffer)[6]) {
|
||||||
case PacketTypeIP: return (0);
|
case PacketTypeIP: return (0);
|
||||||
case PacketTypeARP: return (0);
|
case PacketTypeARP: return (0);
|
||||||
default: return (1);
|
default: return (1);
|
||||||
};
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -746,23 +744,7 @@ static void init_uid() {
|
|||||||
rid = getuid();
|
rid = getuid();
|
||||||
setuid(rid);
|
setuid(rid);
|
||||||
}
|
}
|
||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
|
||||||
|
|
||||||
/************************************************************************/
|
|
||||||
/* i n i t _ i f p a g e _ e t h e r */
|
|
||||||
/* */
|
|
||||||
/* sets Lisp's idea of \my.nsaddress. Clears it if ether not */
|
|
||||||
/* enabled */
|
|
||||||
/* */
|
|
||||||
/************************************************************************/
|
|
||||||
|
|
||||||
void init_ifpage_ether() {
|
|
||||||
InterfacePage->nshost0 = (DLword)((ether_host[0] << 8) + ether_host[1]);
|
|
||||||
InterfacePage->nshost1 = (DLword)((ether_host[2] << 8) + ether_host[3]);
|
|
||||||
InterfacePage->nshost2 = (DLword)((ether_host[4] << 8) + ether_host[5]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MAIKO_ENABLE_ETHERNET
|
|
||||||
/* this needs to be a global so the name can be set by main() in Ctest */
|
/* this needs to be a global so the name can be set by main() in Ctest */
|
||||||
/* But MAIKO_ENABLE_ETHERNET doesn't support NIT, so dyke it out for MAIKO_ENABLE_ETHERNET */
|
/* But MAIKO_ENABLE_ETHERNET doesn't support NIT, so dyke it out for MAIKO_ENABLE_ETHERNET */
|
||||||
#if defined(USE_NIT)
|
#if defined(USE_NIT)
|
||||||
@@ -1085,49 +1067,4 @@ void init_ether() {
|
|||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
#endif /* MAIKO_ENABLE_ETHERNET */
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MASKWORD1 0xffff
|
#endif /* defined(MAIKO_ENABLE_ETHERNET) */
|
||||||
|
|
||||||
/************************************************************************/
|
|
||||||
/* */
|
|
||||||
/* c h e c k _ s u m */
|
|
||||||
/* */
|
|
||||||
/* Implements the CHECKSUM opcode; compute the checksum for an */
|
|
||||||
/* ethernet packet. */
|
|
||||||
/* */
|
|
||||||
/* args[0] LispPTR base; */
|
|
||||||
/* args[1] LispPTR nwords; */
|
|
||||||
/* args[2] LispPTR initsum; */
|
|
||||||
/* */
|
|
||||||
/* */
|
|
||||||
/************************************************************************/
|
|
||||||
|
|
||||||
LispPTR check_sum(LispPTR *args)
|
|
||||||
{
|
|
||||||
LispPTR checksum;
|
|
||||||
DLword *address;
|
|
||||||
int nwords;
|
|
||||||
|
|
||||||
address = (DLword *)NativeAligned2FromLAddr(*args++);
|
|
||||||
nwords = *args++;
|
|
||||||
|
|
||||||
if (*args != NIL)
|
|
||||||
checksum = (*args) & MASKWORD1;
|
|
||||||
else
|
|
||||||
checksum = 0;
|
|
||||||
|
|
||||||
for (; nwords > (S_POSITIVE); address++, nwords--) {
|
|
||||||
checksum = checksum + GETWORD(address);
|
|
||||||
if (checksum > 0xffff) checksum = (checksum & 0xffff) + 1; /* add carry */
|
|
||||||
|
|
||||||
if (checksum > 0x7fff) /* ROTATE LEFT 1 */
|
|
||||||
checksum = ((checksum & 0x7fff) << 1) | 1;
|
|
||||||
else
|
|
||||||
checksum = checksum << 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checksum == MASKWORD1)
|
|
||||||
return (S_POSITIVE); /* ret 0 */
|
|
||||||
else
|
|
||||||
return (S_POSITIVE | checksum);
|
|
||||||
|
|
||||||
} /*check_sum */
|
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
|
|
||||||
#define LStringToCString(Lisp, C, MaxLen, Len) \
|
#define LStringToCString(Lisp, C, MaxLen, Len) \
|
||||||
{ \
|
do { \
|
||||||
OneDArray *arrayp; \
|
OneDArray *arrayp; \
|
||||||
char *base; \
|
char *base; \
|
||||||
short *sbase; \
|
short *sbase; \
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
\
|
\
|
||||||
default: error("LStringToCString can not handle\n"); \
|
default: error("LStringToCString can not handle\n"); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
@@ -134,7 +134,7 @@ LispPTR call_c_fn(LispPTR *args) {
|
|||||||
*errorflag = 0;
|
*errorflag = 0;
|
||||||
|
|
||||||
/* Initialize the argvector */
|
/* Initialize the argvector */
|
||||||
for (i = 0; i < Max_Arg; i++) { intarg[i] = 0; };
|
for (i = 0; i < Max_Arg; i++) { intarg[i] = 0; }
|
||||||
|
|
||||||
/* Test the function addr. If it is 0 we can not execute. */
|
/* Test the function addr. If it is 0 we can not execute. */
|
||||||
if (fnaddr == 0) {
|
if (fnaddr == 0) {
|
||||||
@@ -329,7 +329,7 @@ LispPTR call_c_fn(LispPTR *args) {
|
|||||||
intarg[24], intarg[25], intarg[26], intarg[27], intarg[28], intarg[29],
|
intarg[24], intarg[25], intarg[26], intarg[27], intarg[28], intarg[29],
|
||||||
intarg[30], intarg[31]);
|
intarg[30], intarg[31]);
|
||||||
return (CIntToLispInt(tmp));
|
return (CIntToLispInt(tmp));
|
||||||
}; break;
|
} break;
|
||||||
case TYPE_CHARACTERP: {
|
case TYPE_CHARACTERP: {
|
||||||
int tmp;
|
int tmp;
|
||||||
tmp = ((PFC)fnaddr)(intarg[0], intarg[1], intarg[2], intarg[3], intarg[4], intarg[5],
|
tmp = ((PFC)fnaddr)(intarg[0], intarg[1], intarg[2], intarg[3], intarg[4], intarg[5],
|
||||||
@@ -339,7 +339,7 @@ LispPTR call_c_fn(LispPTR *args) {
|
|||||||
intarg[24], intarg[25], intarg[26], intarg[27], intarg[28], intarg[29],
|
intarg[24], intarg[25], intarg[26], intarg[27], intarg[28], intarg[29],
|
||||||
intarg[30], intarg[31]);
|
intarg[30], intarg[31]);
|
||||||
return (S_CHARACTER | tmp);
|
return (S_CHARACTER | tmp);
|
||||||
}; break;
|
} break;
|
||||||
case TYPE_FLOATP:
|
case TYPE_FLOATP:
|
||||||
fresult = ((PFF)fnaddr)(intarg[0], intarg[1], intarg[2], intarg[3], intarg[4], intarg[5],
|
fresult = ((PFF)fnaddr)(intarg[0], intarg[1], intarg[2], intarg[3], intarg[4], intarg[5],
|
||||||
intarg[6], intarg[7], intarg[8], intarg[9], intarg[10], intarg[11],
|
intarg[6], intarg[7], intarg[8], intarg[9], intarg[10], intarg[11],
|
||||||
@@ -416,7 +416,7 @@ LispPTR smashing_c_fn(LispPTR *args) {
|
|||||||
valueplace = (int *)NativeAligned4FromLAddr(args[1]);
|
valueplace = (int *)NativeAligned4FromLAddr(args[1]);
|
||||||
|
|
||||||
/* Initialize the argvector */
|
/* Initialize the argvector */
|
||||||
for (i = 0; i < Max_Arg; i++) { intarg[i] = 0; };
|
for (i = 0; i < Max_Arg; i++) { intarg[i] = 0; }
|
||||||
|
|
||||||
/* Test the function addr. If it is 0 we can not execute. */
|
/* Test the function addr. If it is 0 we can not execute. */
|
||||||
if (fnaddr == 0) {
|
if (fnaddr == 0) {
|
||||||
@@ -597,7 +597,7 @@ LispPTR smashing_c_fn(LispPTR *args) {
|
|||||||
intarg[30], intarg[31]);
|
intarg[30], intarg[31]);
|
||||||
*valueplace = tmp;
|
*valueplace = tmp;
|
||||||
return (NIL);
|
return (NIL);
|
||||||
}; break;
|
} break;
|
||||||
case TYPE_CHARACTERP:
|
case TYPE_CHARACTERP:
|
||||||
return (S_CHARACTER |
|
return (S_CHARACTER |
|
||||||
(((PFC)fnaddr)(intarg[0], intarg[1], intarg[2], intarg[3], intarg[4], intarg[5],
|
(((PFC)fnaddr)(intarg[0], intarg[1], intarg[2], intarg[3], intarg[4], intarg[5],
|
||||||
@@ -867,7 +867,7 @@ int put_c_basebyte(LispPTR *args) {
|
|||||||
GETBYTE((char *)(addr + (offset >> 3))) &= (~(1 << (0x7 & offset)));
|
GETBYTE((char *)(addr + (offset >> 3))) &= (~(1 << (0x7 & offset)));
|
||||||
} else {
|
} else {
|
||||||
GETBYTE((char *)(addr + (offset >> 3))) |= (1 << (0x7 & offset));
|
GETBYTE((char *)(addr + (offset >> 3))) |= (1 << (0x7 & offset));
|
||||||
};
|
}
|
||||||
break;
|
break;
|
||||||
case 1: /* byte */ GETBYTE((char *)(addr + offset)) = 0xFF & newval; break;
|
case 1: /* byte */ GETBYTE((char *)(addr + offset)) = 0xFF & newval; break;
|
||||||
case 2: /* word */
|
case 2: /* word */
|
||||||
@@ -917,7 +917,7 @@ int get_c_basebyte(LispPTR *args) {
|
|||||||
return (ATOM_T);
|
return (ATOM_T);
|
||||||
} else {
|
} else {
|
||||||
return (NIL);
|
return (NIL);
|
||||||
};
|
}
|
||||||
break;
|
break;
|
||||||
case 1: /* byte */ return ((0xFF & (GETBYTE((char *)(addr + offset)))) | S_POSITIVE); break;
|
case 1: /* byte */ return ((0xFF & (GETBYTE((char *)(addr + offset)))) | S_POSITIVE); break;
|
||||||
case 2: /* word */
|
case 2: /* word */
|
||||||
|
|||||||
@@ -492,7 +492,6 @@ LispPTR native_newframe(int slot)
|
|||||||
ppvar = (DLword *)newpfra2 - 1;
|
ppvar = (DLword *)newpfra2 - 1;
|
||||||
/* ppvar points to IVAR field in Basic frame */
|
/* ppvar points to IVAR field in Basic frame */
|
||||||
return (*((LispPTR *)achain) = STK_HI_RET(GETWORD(ppvar) + fvaroffset));
|
return (*((LispPTR *)achain) = STK_HI_RET(GETWORD(ppvar) + fvaroffset));
|
||||||
;
|
|
||||||
default: error("Stack corrupted: bad value in name table");
|
default: error("Stack corrupted: bad value in name table");
|
||||||
} /* end switch */
|
} /* end switch */
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ LispPTR aref1(LispPTR array, int index) {
|
|||||||
break;
|
break;
|
||||||
case 38: retval = (*(((LispPTR *)NativeAligned4FromLAddr(base)) + index)); break;
|
case 38: retval = (*(((LispPTR *)NativeAligned4FromLAddr(base)) + index)); break;
|
||||||
default: error("Not Implemented in gc's aref1 (other types)");
|
default: error("Not Implemented in gc's aref1 (other types)");
|
||||||
};
|
}
|
||||||
return (retval);
|
return (retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
20
src/gccode.c
20
src/gccode.c
@@ -151,8 +151,8 @@ LispPTR map_code_pointers(LispPTR codeblock, short int casep) {
|
|||||||
{
|
{
|
||||||
REC_GCLOOKUP(reclaimed, casep);
|
REC_GCLOOKUP(reclaimed, casep);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
if ((len = oplength[opnum]) >
|
if ((len = oplength[opnum]) >
|
||||||
LONGEST_OPCODE) { /* len > biggest possible marks an unknown opcode */
|
LONGEST_OPCODE) { /* len > biggest possible marks an unknown opcode */
|
||||||
char errtext[200];
|
char errtext[200];
|
||||||
@@ -164,7 +164,7 @@ LispPTR map_code_pointers(LispPTR codeblock, short int casep) {
|
|||||||
oplength[opnum] = len = (((UFN *)UFNTable) + (opnum))->byte_num;
|
oplength[opnum] = len = (((UFN *)UFNTable) + (opnum))->byte_num;
|
||||||
}
|
}
|
||||||
codeptr += len + 1;
|
codeptr += len + 1;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
@@ -190,20 +190,20 @@ LispPTR remimplicitkeyhash(LispPTR item, LispPTR ik_hash_table) {
|
|||||||
value = Getikvalue(base, index);
|
value = Getikvalue(base, index);
|
||||||
if (value != *Deleted_Implicit_Hash_Slot_word) {
|
if (value != *Deleted_Implicit_Hash_Slot_word) {
|
||||||
if (value != NIL) {
|
if (value != NIL) {
|
||||||
if (item == getikkey(value)) { goto found; };
|
if (item == getikkey(value)) { goto found; }
|
||||||
} else
|
} else
|
||||||
return (NIL);
|
return (NIL);
|
||||||
};
|
}
|
||||||
reprobe = Reprobefn(bits, limits);
|
reprobe = Reprobefn(bits, limits);
|
||||||
lp:
|
lp:
|
||||||
index = Fn16bits(index, reprobe) & limits;
|
index = Fn16bits(index, reprobe) & limits;
|
||||||
value = Getikvalue(base, index);
|
value = Getikvalue(base, index);
|
||||||
if (value != *Deleted_Implicit_Hash_Slot_word) {
|
if (value != *Deleted_Implicit_Hash_Slot_word) {
|
||||||
if (value != NIL) {
|
if (value != NIL) {
|
||||||
if (item == getikkey(value)) { goto found; };
|
if (item == getikkey(value)) { goto found; }
|
||||||
} else
|
} else
|
||||||
return (NIL);
|
return (NIL);
|
||||||
};
|
}
|
||||||
goto lp;
|
goto lp;
|
||||||
found:
|
found:
|
||||||
/*
|
/*
|
||||||
@@ -235,7 +235,7 @@ LispPTR reclaimcodeblock(LispPTR codebase) {
|
|||||||
if ((*Closure_Cache_Enabled_word != NIL) &&
|
if ((*Closure_Cache_Enabled_word != NIL) &&
|
||||||
(remimplicitkeyhash(codebase, *Closure_Cache_word) != NIL)) {
|
(remimplicitkeyhash(codebase, *Closure_Cache_word) != NIL)) {
|
||||||
return (T);
|
return (T);
|
||||||
};
|
}
|
||||||
fnbase = (struct fnhead *)NativeAligned4FromLAddr(codebase);
|
fnbase = (struct fnhead *)NativeAligned4FromLAddr(codebase);
|
||||||
REC_GCLOOKUP((POINTERMASK & fnbase->framename), DELREF);
|
REC_GCLOOKUP((POINTERMASK & fnbase->framename), DELREF);
|
||||||
if (fnbase->startpc != 0) map_code_pointers(codebase, DELREF);
|
if (fnbase->startpc != 0) map_code_pointers(codebase, DELREF);
|
||||||
@@ -260,7 +260,7 @@ int code_block_size(long unsigned int codeblock68k) {
|
|||||||
while (T) {
|
while (T) {
|
||||||
switch (opnum = Get_BYTE(codeptr)) {
|
switch (opnum = Get_BYTE(codeptr)) {
|
||||||
case ENDOFX: /* -X- */ return (codeptr - initcodeptr);
|
case ENDOFX: /* -X- */ return (codeptr - initcodeptr);
|
||||||
};
|
}
|
||||||
if ((len = oplength[opnum]) >
|
if ((len = oplength[opnum]) >
|
||||||
LONGEST_OPCODE) { /* len > biggest possible marks an unknown opcode */
|
LONGEST_OPCODE) { /* len > biggest possible marks an unknown opcode */
|
||||||
char errtext[200];
|
char errtext[200];
|
||||||
@@ -272,5 +272,5 @@ int code_block_size(long unsigned int codeblock68k) {
|
|||||||
oplength[opnum] = len = (((UFN *)UFNTable) + (opnum))->byte_num;
|
oplength[opnum] = len = (((UFN *)UFNTable) + (opnum))->byte_num;
|
||||||
}
|
}
|
||||||
codeptr += len + 1;
|
codeptr += len + 1;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ int integerlength(unsigned int n) {
|
|||||||
n = (n >> 1);
|
n = (n >> 1);
|
||||||
} while (n != 1);
|
} while (n != 1);
|
||||||
return (cnt);
|
return (cnt);
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/************* The above procedure is common !! **************************/
|
/************* The above procedure is common !! **************************/
|
||||||
@@ -146,7 +146,7 @@ LispPTR findptrsbuffer(LispPTR ptr) {
|
|||||||
return (LAddrFromNative(bptr));
|
return (LAddrFromNative(bptr));
|
||||||
else
|
else
|
||||||
bptr = (struct buf *)NativeAligned4FromLAddr(bptr->sysnext);
|
bptr = (struct buf *)NativeAligned4FromLAddr(bptr->sysnext);
|
||||||
};
|
}
|
||||||
return (NIL);
|
return (NIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,8 +229,8 @@ LispPTR checkarrayblock(LispPTR base, LispPTR free, LispPTR onfreelist) {
|
|||||||
rbase = (struct arrayblock *)NativeAligned4FromLAddr(*rover & POINTERMASK);
|
rbase = (struct arrayblock *)NativeAligned4FromLAddr(*rover & POINTERMASK);
|
||||||
} while (((*rover = rbase->fwd) & POINTERMASK) != (*tmprover & POINTERMASK));
|
} while (((*rover = rbase->fwd) & POINTERMASK) != (*tmprover & POINTERMASK));
|
||||||
return (NIL);
|
return (NIL);
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
return (NIL);
|
return (NIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,11 +299,11 @@ LispPTR linkblock(LispPTR base) {
|
|||||||
tmpbase = (struct arrayblock *)NativeAligned4FromLAddr(fbbase->bkwd);
|
tmpbase = (struct arrayblock *)NativeAligned4FromLAddr(fbbase->bkwd);
|
||||||
tmpbase->fwd = base;
|
tmpbase->fwd = base;
|
||||||
fbbase->bkwd = base;
|
fbbase->bkwd = base;
|
||||||
};
|
}
|
||||||
*freeblock = base;
|
*freeblock = base;
|
||||||
checkarrayblock(base, T, T);
|
checkarrayblock(base, T, T);
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
return (base);
|
return (base);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,10 +357,10 @@ LispPTR arrayblockmerger(LispPTR base, LispPTR nbase) {
|
|||||||
narlens = minblocksize;
|
narlens = minblocksize;
|
||||||
arlens += shaveback;
|
arlens += shaveback;
|
||||||
secondbite += shaveback;
|
secondbite += shaveback;
|
||||||
};
|
}
|
||||||
linkblock(makefreearrayblock(nbase + 2 * secondbite, narlens));
|
linkblock(makefreearrayblock(nbase + 2 * secondbite, narlens));
|
||||||
narlens = 0;
|
narlens = 0;
|
||||||
};
|
}
|
||||||
return (linkblock(makefreearrayblock(base, arlens + narlens)));
|
return (linkblock(makefreearrayblock(base, arlens + narlens)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -457,7 +457,7 @@ LispPTR reclaimarrayblock(LispPTR ptr) {
|
|||||||
((ARRAYBLOCKPASSWORD != base->password) || (base->inuse == NIL))) {
|
((ARRAYBLOCKPASSWORD != base->password) || (base->inuse == NIL))) {
|
||||||
error("Bad array block reclaimed--continue with 'q' but save state ASAP. \n");
|
error("Bad array block reclaimed--continue with 'q' but save state ASAP. \n");
|
||||||
return (T);
|
return (T);
|
||||||
};
|
}
|
||||||
#endif /* ARRAYCHECK */
|
#endif /* ARRAYCHECK */
|
||||||
|
|
||||||
switch (base->gctype) {
|
switch (base->gctype) {
|
||||||
@@ -472,12 +472,12 @@ LispPTR reclaimarrayblock(LispPTR ptr) {
|
|||||||
tmpptr += 2;
|
tmpptr += 2;
|
||||||
} while (tmpptr != btrailer);
|
} while (tmpptr != btrailer);
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
case CODEBLOCK_GCT:
|
case CODEBLOCK_GCT:
|
||||||
reclaim_p = ((reclaimcodeblock(ptr) == NIL) ? T : NIL);
|
reclaim_p = ((reclaimcodeblock(ptr) == NIL) ? T : NIL);
|
||||||
|
|
||||||
/* default: No Action */
|
/* default: No Action */
|
||||||
};
|
}
|
||||||
if (reclaim_p == T)
|
if (reclaim_p == T)
|
||||||
mergeforward(mergebackward(makefreearrayblock(ptr - ARRAYBLOCKHEADERWORDS, base->arlen)));
|
mergeforward(mergebackward(makefreearrayblock(ptr - ARRAYBLOCKHEADERWORDS, base->arlen)));
|
||||||
return (T);
|
return (T);
|
||||||
|
|||||||
@@ -32,21 +32,21 @@
|
|||||||
|
|
||||||
/* GetLink gets a new entry from the GC collision table */
|
/* GetLink gets a new entry from the GC collision table */
|
||||||
#define GetLink(var) \
|
#define GetLink(var) \
|
||||||
{ \
|
do { \
|
||||||
GCENTRY linkoff; \
|
GCENTRY linkoff; \
|
||||||
linkoff = GETGC(HTcoll); \
|
linkoff = GETGC(HTcoll); \
|
||||||
if (linkoff == 0) { \
|
if (linkoff == 0) { \
|
||||||
if ((linkoff = GETGC((GCENTRY *)HTcoll + 1)) >= HTCOLLMAX) { \
|
if ((linkoff = GETGC((GCENTRY *)HTcoll + 1)) >= HTCOLLMAX) { \
|
||||||
disablegc1(NIL); \
|
disablegc1(NIL); \
|
||||||
return (NIL); \
|
return (NIL); \
|
||||||
}; \
|
} \
|
||||||
GETGC((GCENTRY *)HTcoll + 1) = linkoff + 2; \
|
GETGC((GCENTRY *)HTcoll + 1) = linkoff + 2; \
|
||||||
(var) = (GCENTRY *)(HTcoll + linkoff); \
|
(var) = (GCENTRY *)(HTcoll + linkoff); \
|
||||||
} else { \
|
} else { \
|
||||||
GETGC(HTcoll) = GETGC((GCENTRY *)(HTcoll + linkoff + 1)); \
|
GETGC(HTcoll) = GETGC((GCENTRY *)(HTcoll + linkoff + 1)); \
|
||||||
(var) = (GCENTRY *)(HTcoll + linkoff); \
|
(var) = (GCENTRY *)(HTcoll + linkoff); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#ifdef BIGVM
|
#ifdef BIGVM
|
||||||
#define HTCNTSHIFT 17 /* amount to shift to get hash table count */
|
#define HTCNTSHIFT 17 /* amount to shift to get hash table count */
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
* Thus STKREF case is not needed.
|
* Thus STKREF case is not needed.
|
||||||
*/
|
*/
|
||||||
#define NewEntry(entry, hiptr, casep, ptr) \
|
#define NewEntry(entry, hiptr, casep, ptr) \
|
||||||
{ \
|
do { \
|
||||||
switch (casep) { \
|
switch (casep) { \
|
||||||
case ADDREF: \
|
case ADDREF: \
|
||||||
GETGC(entry) = (hiptr) | (2 << HTCNTSHIFT); /* set count = 2 */ \
|
GETGC(entry) = (hiptr) | (2 << HTCNTSHIFT); /* set count = 2 */ \
|
||||||
@@ -94,14 +94,14 @@
|
|||||||
default: error("GC error: new entry touches stack bit"); \
|
default: error("GC error: new entry touches stack bit"); \
|
||||||
return NIL; /* NOT REACHED */ \
|
return NIL; /* NOT REACHED */ \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RecNewEntry is called in the course of the reclamation.
|
* RecNewEntry is called in the course of the reclamation.
|
||||||
* Does not maintain the allocation count.
|
* Does not maintain the allocation count.
|
||||||
*/
|
*/
|
||||||
#define RecNewEntry(entry, hiptr, casep, ptr) \
|
#define RecNewEntry(entry, hiptr, casep, ptr) \
|
||||||
{ \
|
do { \
|
||||||
switch (casep) { \
|
switch (casep) { \
|
||||||
case ADDREF: \
|
case ADDREF: \
|
||||||
GETGC(entry) = (hiptr) | (2 << HTCNTSHIFT); /* set count = 2 */ \
|
GETGC(entry) = (hiptr) | (2 << HTCNTSHIFT); /* set count = 2 */ \
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
default: error("GC error: new entry when turning off stack bit"); \
|
default: error("GC error: new entry when turning off stack bit"); \
|
||||||
return NIL; /* NOT REACHED */ \
|
return NIL; /* NOT REACHED */ \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/* ModEntry is a macro to modify an old gc hash table entry.
|
/* ModEntry is a macro to modify an old gc hash table entry.
|
||||||
entry is a pointer to the entry
|
entry is a pointer to the entry
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
* Thus STKREF and UNSTKREF cases are not needed.
|
* Thus STKREF and UNSTKREF cases are not needed.
|
||||||
*/
|
*/
|
||||||
#define ModEntry(entry, contents, ptr, casep, remove) \
|
#define ModEntry(entry, contents, ptr, casep, remove) \
|
||||||
{ \
|
do { \
|
||||||
if (((contents) & HTCNTMASK) == HTCNTMASK) { /* overflow; return non-zero */ \
|
if (((contents) & HTCNTMASK) == HTCNTMASK) { /* overflow; return non-zero */ \
|
||||||
modify_big_reference_count(entry, casep, ptr); \
|
modify_big_reference_count(entry, casep, ptr); \
|
||||||
return NIL; \
|
return NIL; \
|
||||||
@@ -161,14 +161,14 @@
|
|||||||
} \
|
} \
|
||||||
GETGC(entry) = contents; \
|
GETGC(entry) = contents; \
|
||||||
return NIL; \
|
return NIL; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RecModEntry is called in the course of the reclamation.
|
* RecModEntry is called in the course of the reclamation.
|
||||||
* Does not maintain the allocation count.
|
* Does not maintain the allocation count.
|
||||||
*/
|
*/
|
||||||
#define RecModEntry(entry, contents, ptr, casep, remove) \
|
#define RecModEntry(entry, contents, ptr, casep, remove) \
|
||||||
{ \
|
do { \
|
||||||
if (((contents) & HTCNTMASK) == HTCNTMASK) { /* overflow; return non-zero */ \
|
if (((contents) & HTCNTMASK) == HTCNTMASK) { /* overflow; return non-zero */ \
|
||||||
modify_big_reference_count(entry, casep, ptr); \
|
modify_big_reference_count(entry, casep, ptr); \
|
||||||
return NIL; \
|
return NIL; \
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
if (((contents) & HTCNTSTKMASK) == (1 << HTCNTSHIFT)) goto remove; \
|
if (((contents) & HTCNTSTKMASK) == (1 << HTCNTSHIFT)) goto remove; \
|
||||||
GETGC(entry) = contents; \
|
GETGC(entry) = contents; \
|
||||||
return NIL; \
|
return NIL; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
@@ -231,7 +231,7 @@ void enter_big_reference_count(LispPTR ptr) {
|
|||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
++oventry;
|
++oventry;
|
||||||
};
|
}
|
||||||
|
|
||||||
if (tmp == NIL) {
|
if (tmp == NIL) {
|
||||||
if (Evenp(LAddrFromNative(oventry + 1), DLWORDSPER_PAGE)) {
|
if (Evenp(LAddrFromNative(oventry + 1), DLWORDSPER_PAGE)) {
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ LispPTR gcscanstack(void) {
|
|||||||
#endif /* BIGVM */
|
#endif /* BIGVM */
|
||||||
Stkref(fn_head);
|
Stkref(fn_head);
|
||||||
fnheader = (struct fnhead *)NativeAligned4FromLAddr(fn_head);
|
fnheader = (struct fnhead *)NativeAligned4FromLAddr(fn_head);
|
||||||
};
|
}
|
||||||
{
|
{
|
||||||
int pcou;
|
int pcou;
|
||||||
LispPTR *pvars;
|
LispPTR *pvars;
|
||||||
@@ -230,8 +230,8 @@ LispPTR gcscanstack(void) {
|
|||||||
if
|
if
|
||||||
Boundp(BIND_BITS(value)) Stkref(value);
|
Boundp(BIND_BITS(value)) Stkref(value);
|
||||||
++pvars;
|
++pvars;
|
||||||
}; /* for */
|
} /* for */
|
||||||
}; /* int pcou */
|
} /* int pcou */
|
||||||
|
|
||||||
{
|
{
|
||||||
UNSIGNED qtemp;
|
UNSIGNED qtemp;
|
||||||
@@ -264,7 +264,7 @@ LispPTR gcscanstack(void) {
|
|||||||
(((struct fnhead *)qtemp)->ntsize) * 2);
|
(((struct fnhead *)qtemp)->ntsize) * 2);
|
||||||
} else
|
} else
|
||||||
Stkref(nametable);
|
Stkref(nametable);
|
||||||
}; /* frameex->validnametable */
|
} /* frameex->validnametable */
|
||||||
|
|
||||||
obasicframe = basicframe;
|
obasicframe = basicframe;
|
||||||
basicframe =
|
basicframe =
|
||||||
@@ -286,7 +286,7 @@ LispPTR gcscanstack(void) {
|
|||||||
if
|
if
|
||||||
Boundp(BIND_BITS(value)) Stkref(value);
|
Boundp(BIND_BITS(value)) Stkref(value);
|
||||||
basicframe++;
|
basicframe++;
|
||||||
}; /* while */
|
} /* while */
|
||||||
|
|
||||||
if (ntend != 0) {
|
if (ntend != 0) {
|
||||||
obasicframe = basicframe;
|
obasicframe = basicframe;
|
||||||
@@ -303,7 +303,7 @@ LispPTR gcscanstack(void) {
|
|||||||
qtemp = next;
|
qtemp = next;
|
||||||
ntend = 0;
|
ntend = 0;
|
||||||
goto scantemps;
|
goto scantemps;
|
||||||
};
|
}
|
||||||
|
|
||||||
obasicframe = basicframe;
|
obasicframe = basicframe;
|
||||||
basicframe = (Bframe *)next;
|
basicframe = (Bframe *)next;
|
||||||
@@ -317,10 +317,10 @@ LispPTR gcscanstack(void) {
|
|||||||
error(debugStr);
|
error(debugStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}; /* LOCAL regs qtemp next */
|
} /* LOCAL regs qtemp next */
|
||||||
}; /* local regs fnheader frameex */
|
} /* local regs fnheader frameex */
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
case STK_GUARD: /* stack's tail ? */ {
|
case STK_GUARD: /* stack's tail ? */ {
|
||||||
if ((UNSIGNED)basicframe >= (UNSIGNED)scanend68K)
|
if ((UNSIGNED)basicframe >= (UNSIGNED)scanend68K)
|
||||||
return (NIL);
|
return (NIL);
|
||||||
@@ -336,9 +336,9 @@ LispPTR gcscanstack(void) {
|
|||||||
(void *)basicframe, (void *)obasicframe);
|
(void *)basicframe, (void *)obasicframe);
|
||||||
error(debugStr);
|
error(debugStr);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
case STK_FSB: {
|
case STK_FSB: {
|
||||||
obasicframe = basicframe;
|
obasicframe = basicframe;
|
||||||
basicframe = (Bframe *)((DLword *)basicframe + basicframe->ivar);
|
basicframe = (Bframe *)((DLword *)basicframe + basicframe->ivar);
|
||||||
@@ -353,25 +353,25 @@ LispPTR gcscanstack(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
default: /* must be basic frame !! */
|
default: /* must be basic frame !! */
|
||||||
{
|
{
|
||||||
LispPTR bf_word;
|
LispPTR bf_word;
|
||||||
while (STK_BF != BF_FLAGS(bf_word = *((LispPTR *)basicframe))) {
|
while (STK_BF != BF_FLAGS(bf_word = *((LispPTR *)basicframe))) {
|
||||||
Stkref(PTR_BITS(bf_word));
|
Stkref(PTR_BITS(bf_word));
|
||||||
basicframe++;
|
basicframe++;
|
||||||
};
|
}
|
||||||
basicframe++;
|
basicframe++;
|
||||||
};
|
}
|
||||||
|
|
||||||
/* **** NOTE THIS CODE DOES NOT COMPILE CORRECTLY ON THE SUN 4
|
/* **** NOTE THIS CODE DOES NOT COMPILE CORRECTLY ON THE SUN 4
|
||||||
{LispPTR bf_word;
|
{LispPTR bf_word;
|
||||||
while(STK_BF != BF_FLAGS(
|
while(STK_BF != BF_FLAGS(
|
||||||
bf_word = *((LispPTR *)basicframe++)))
|
bf_word = *((LispPTR *)basicframe++)))
|
||||||
{ Stkref(PTR_BITS(bf_word));
|
{ Stkref(PTR_BITS(bf_word));
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
**** */
|
**** */
|
||||||
}; /* switch */
|
} /* switch */
|
||||||
}; /* while(1) */
|
} /* while(1) */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,14 +37,16 @@
|
|||||||
#include "lsptypes.h" // for dtd, GetDTD, TYPE_LISTP
|
#include "lsptypes.h" // for dtd, GetDTD, TYPE_LISTP
|
||||||
|
|
||||||
#define Increment_Allocation_Count(n) \
|
#define Increment_Allocation_Count(n) \
|
||||||
if (*Reclaim_cnt_word != NIL) { \
|
do { \
|
||||||
if (*Reclaim_cnt_word > (n)) \
|
if (*Reclaim_cnt_word != NIL) { \
|
||||||
(*Reclaim_cnt_word) -= (n); \
|
if (*Reclaim_cnt_word > (n)) \
|
||||||
else { \
|
(*Reclaim_cnt_word) -= (n); \
|
||||||
*Reclaim_cnt_word = NIL; \
|
else { \
|
||||||
doreclaim(); \
|
*Reclaim_cnt_word = NIL; \
|
||||||
} \
|
doreclaim(); \
|
||||||
}
|
} \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
DLword gc_handleoverflow(DLword arg) {
|
DLword gc_handleoverflow(DLword arg) {
|
||||||
struct htoverflow *cell;
|
struct htoverflow *cell;
|
||||||
@@ -58,14 +60,14 @@ DLword gc_handleoverflow(DLword arg) {
|
|||||||
cell->ptr = 0;
|
cell->ptr = 0;
|
||||||
cell->pcase = 0;
|
cell->pcase = 0;
|
||||||
++cell; /* (\ADDBASE CELL WORDSPERCELL) */
|
++cell; /* (\ADDBASE CELL WORDSPERCELL) */
|
||||||
};
|
}
|
||||||
ptr = (struct dtd *)GetDTD(TYPE_LISTP);
|
ptr = (struct dtd *)GetDTD(TYPE_LISTP);
|
||||||
/* same as "extern struct dtd *ListpDTD" */
|
/* same as "extern struct dtd *ListpDTD" */
|
||||||
if ((cellcnt = ptr->dtd_cnt0) > 1024) {
|
if ((cellcnt = ptr->dtd_cnt0) > 1024) {
|
||||||
Increment_Allocation_Count(cellcnt);
|
Increment_Allocation_Count(cellcnt);
|
||||||
ptr->dtd_oldcnt += cellcnt;
|
ptr->dtd_oldcnt += cellcnt;
|
||||||
ptr->dtd_cnt0 = 0;
|
ptr->dtd_cnt0 = 0;
|
||||||
};
|
}
|
||||||
return (arg);
|
return (arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +84,7 @@ DLword gcmaptable(DLword arg) {
|
|||||||
cell->ptr = 0;
|
cell->ptr = 0;
|
||||||
cell->pcase = 0;
|
cell->pcase = 0;
|
||||||
++cell; /* (\ADDBASE CELL WORDSPERCELL) */
|
++cell; /* (\ADDBASE CELL WORDSPERCELL) */
|
||||||
};
|
}
|
||||||
for (typnum = 1; typnum <= *MaxTypeNumber_word; ++typnum)
|
for (typnum = 1; typnum <= *MaxTypeNumber_word; ++typnum)
|
||||||
/* applied alltype */
|
/* applied alltype */
|
||||||
{
|
{
|
||||||
@@ -91,7 +93,7 @@ DLword gcmaptable(DLword arg) {
|
|||||||
ptr->dtd_oldcnt += cellcnt;
|
ptr->dtd_oldcnt += cellcnt;
|
||||||
ptr->dtd_cnt0 = 0;
|
ptr->dtd_cnt0 = 0;
|
||||||
Increment_Allocation_Count(cellcnt);
|
Increment_Allocation_Count(cellcnt);
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
return (arg);
|
return (arg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,6 +149,6 @@ void disablegc1(int noerror) {
|
|||||||
if ((noerror == NIL) && (*GcDisabled_word == NIL)) {
|
if ((noerror == NIL) && (*GcDisabled_word == NIL)) {
|
||||||
gcinterruptstate->gcdisabled = T;
|
gcinterruptstate->gcdisabled = T;
|
||||||
*PENDINGINTERRUPT_word = ATOM_T;
|
*PENDINGINTERRUPT_word = ATOM_T;
|
||||||
};
|
}
|
||||||
*GcDisabled_word = ATOM_T;
|
*GcDisabled_word = ATOM_T;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,16 +87,18 @@
|
|||||||
|
|
||||||
#define TODO_LIMIT 1000
|
#define TODO_LIMIT 1000
|
||||||
#define ADD_TO_DO(ptr, offset) \
|
#define ADD_TO_DO(ptr, offset) \
|
||||||
if (do_count < TODO_LIMIT) { \
|
do { \
|
||||||
if ((ptr) & 0xF0000000) error("illegal ptr in addtodo"); \
|
if (do_count < TODO_LIMIT) { \
|
||||||
to_do[do_count] = (ptr); \
|
if ((ptr) & 0xF0000000) error("illegal ptr in addtodo"); \
|
||||||
to_do_offset[do_count] = offset; \
|
to_do[do_count] = (ptr); \
|
||||||
todo_uses++; \
|
to_do_offset[do_count] = offset; \
|
||||||
/*REC_GCLOOKUP((ptr), ADDREF);*/ \
|
todo_uses++; \
|
||||||
do_count++; \
|
/*REC_GCLOOKUP((ptr), ADDREF);*/ \
|
||||||
} else { /* error("GC missing some to-do's"); */ \
|
do_count++; \
|
||||||
todo_misses++; \
|
} else { /* error("GC missing some to-do's"); */ \
|
||||||
}
|
todo_misses++; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
unsigned todo_uses = 0;
|
unsigned todo_uses = 0;
|
||||||
unsigned todo_misses = 0;
|
unsigned todo_misses = 0;
|
||||||
@@ -156,7 +158,7 @@ lp:
|
|||||||
ptr = (ConsCell *)NativeAligned4FromLAddr(tmpcell);
|
ptr = (ConsCell *)NativeAligned4FromLAddr(tmpcell);
|
||||||
tmpptr = tmpcell;
|
tmpptr = tmpcell;
|
||||||
code = ptr->cdr_code;
|
code = ptr->cdr_code;
|
||||||
};
|
}
|
||||||
if (index != -1) /* car part */
|
if (index != -1) /* car part */
|
||||||
index = -1;
|
index = -1;
|
||||||
else {
|
else {
|
||||||
@@ -166,7 +168,7 @@ lp:
|
|||||||
ptr->cdr_code = code;
|
ptr->cdr_code = code;
|
||||||
donext = tmpptr;
|
donext = tmpptr;
|
||||||
goto doval;
|
goto doval;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
REC_GCLOOKUPV(cdr(tmpptr), DELREF, val);
|
REC_GCLOOKUPV(cdr(tmpptr), DELREF, val);
|
||||||
if (code <= CDR_MAXINDIRECT) {
|
if (code <= CDR_MAXINDIRECT) {
|
||||||
@@ -176,10 +178,10 @@ lp:
|
|||||||
tmpcell = POINTER_PAGEBASE(tmpptr) + ((code - CDR_INDIRECT) << 1);
|
tmpcell = POINTER_PAGEBASE(tmpptr) + ((code - CDR_INDIRECT) << 1);
|
||||||
#endif /* NEWCDRCODING */
|
#endif /* NEWCDRCODING */
|
||||||
freelistcell(tmpcell);
|
freelistcell(tmpcell);
|
||||||
};
|
}
|
||||||
freelistcell(tmpptr);
|
freelistcell(tmpptr);
|
||||||
goto doval;
|
goto doval;
|
||||||
};
|
}
|
||||||
case TYPE_ARRAYBLOCK:
|
case TYPE_ARRAYBLOCK:
|
||||||
if ((index == -1) && reclaimarrayblock(tmpptr))
|
if ((index == -1) && reclaimarrayblock(tmpptr))
|
||||||
goto trynext;
|
goto trynext;
|
||||||
@@ -208,7 +210,7 @@ lp:
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
default:;
|
default:;
|
||||||
};
|
}
|
||||||
normal:
|
normal:
|
||||||
typdtd = (struct dtd *)GetDTD(typ);
|
typdtd = (struct dtd *)GetDTD(typ);
|
||||||
ptrfield = typdtd->dtd_ptrs;
|
ptrfield = typdtd->dtd_ptrs;
|
||||||
@@ -217,7 +219,7 @@ normal:
|
|||||||
ptrfield = cdr(ptrfield);
|
ptrfield = cdr(ptrfield);
|
||||||
while ((car(ptrfield) & 0x0ffff) != index) ptrfield = cdr(ptrfield);
|
while ((car(ptrfield) & 0x0ffff) != index) ptrfield = cdr(ptrfield);
|
||||||
index = -1;
|
index = -1;
|
||||||
};
|
}
|
||||||
while (ptrfield != NIL) {
|
while (ptrfield != NIL) {
|
||||||
carfield = car(ptrfield);
|
carfield = car(ptrfield);
|
||||||
ptrfield = cdr(ptrfield);
|
ptrfield = cdr(ptrfield);
|
||||||
@@ -233,7 +235,7 @@ normal:
|
|||||||
goto doval;
|
goto doval;
|
||||||
} else
|
} else
|
||||||
goto addtofreelist;
|
goto addtofreelist;
|
||||||
};
|
}
|
||||||
#else
|
#else
|
||||||
if (val != NIL) {
|
if (val != NIL) {
|
||||||
if (ptrfield != NIL) {
|
if (ptrfield != NIL) {
|
||||||
@@ -249,9 +251,9 @@ normal:
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
goto addtofreelist;
|
goto addtofreelist;
|
||||||
};
|
}
|
||||||
#endif /* NEWCDRCODING */
|
#endif /* NEWCDRCODING */
|
||||||
};
|
}
|
||||||
addtofreelist:
|
addtofreelist:
|
||||||
field = (LispPTR *)NativeAligned4FromLAddr(tmpptr);
|
field = (LispPTR *)NativeAligned4FromLAddr(tmpptr);
|
||||||
*field = typdtd->dtd_free;
|
*field = typdtd->dtd_free;
|
||||||
@@ -273,7 +275,7 @@ doval:
|
|||||||
/* GCLOOKUP(0x8000, ADDREF,tmpptr); */
|
/* GCLOOKUP(0x8000, ADDREF,tmpptr); */
|
||||||
val = NIL;
|
val = NIL;
|
||||||
goto lp;
|
goto lp;
|
||||||
};
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
@@ -289,7 +291,7 @@ trynext:
|
|||||||
donext = (LispPTR)ptr->car_field;
|
donext = (LispPTR)ptr->car_field;
|
||||||
index = ptr->cdr_code;
|
index = ptr->cdr_code;
|
||||||
goto lp;
|
goto lp;
|
||||||
};
|
}
|
||||||
#ifdef NEWCDRCODING
|
#ifdef NEWCDRCODING
|
||||||
if (do_count) /* If there are other cells to collect */
|
if (do_count) /* If there are other cells to collect */
|
||||||
{
|
{
|
||||||
@@ -354,5 +356,5 @@ void freelistcell(LispPTR cell) {
|
|||||||
if ((++pbase->count > 32) && (pbase->next_page == CONSPAGE_LAST)) {
|
if ((++pbase->count > 32) && (pbase->next_page == CONSPAGE_LAST)) {
|
||||||
pbase->next_page = ListpDTD->dtd_nextpage;
|
pbase->next_page = ListpDTD->dtd_nextpage;
|
||||||
ListpDTD->dtd_nextpage = POINTER_PAGE(cell);
|
ListpDTD->dtd_nextpage = POINTER_PAGE(cell);
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,12 +36,12 @@
|
|||||||
#include "stack.h" // for FX, frameex1, Bframe, CHECK_FX, StackWord
|
#include "stack.h" // for FX, frameex1, Bframe, CHECK_FX, StackWord
|
||||||
|
|
||||||
#define MAKE_FXCOPY(fx68k) \
|
#define MAKE_FXCOPY(fx68k) \
|
||||||
{ \
|
do { \
|
||||||
BEFORE_CONTEXTSW; \
|
BEFORE_CONTEXTSW; \
|
||||||
if (((fx68k) = (FX *)make_FXcopy(fx68k)) == 0) { return (1); /* Whole space exhausted */ } \
|
if (((fx68k) = (FX *)make_FXcopy(fx68k)) == 0) { return (1); /* Whole space exhausted */ } \
|
||||||
AFTER_CONTEXTSW; \
|
AFTER_CONTEXTSW; \
|
||||||
CHECK_FX(fx68k); \
|
CHECK_FX(fx68k); \
|
||||||
}
|
} while (0)
|
||||||
static FX *make_FXcopy(FX *fx68k) {
|
static FX *make_FXcopy(FX *fx68k) {
|
||||||
int size;
|
int size;
|
||||||
int nametbl_on_stk = NIL;
|
int nametbl_on_stk = NIL;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
#include "mkcelldefs.h" // for N_OP_createcell
|
#include "mkcelldefs.h" // for N_OP_createcell
|
||||||
#include "testtooldefs.h" // for MakeAtom68k, MAKEATOM
|
#include "testtooldefs.h" // for MakeAtom68k, MAKEATOM
|
||||||
|
|
||||||
#ifdef MAIKO_ENABLE_ETHERNET
|
#if defined(MAIKO_ENABLE_ETHERNET) || defined(MAIKO_ENABLE_NETHUB)
|
||||||
#include "etherdefs.h"
|
#include "etherdefs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -117,9 +117,9 @@ void init_ifpage(int sysout_size) {
|
|||||||
Initialize IFPAGE
|
Initialize IFPAGE
|
||||||
*/
|
*/
|
||||||
InterfacePage->machinetype = KATANA; /* 3 is katana */
|
InterfacePage->machinetype = KATANA; /* 3 is katana */
|
||||||
#ifdef MAIKO_ENABLE_ETHERNET
|
#if defined(MAIKO_ENABLE_ETHERNET) || defined(MAIKO_ENABLE_NETHUB)
|
||||||
init_ifpage_ether(); /* store ethernet ID in IF page */
|
init_ifpage_ether(); /* store ethernet ID in IF page */
|
||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
#endif /* MAIKO_ENABLE_ETHERNET or MAIKO_ENABLE_NETHUB */
|
||||||
/*InterfacePage->dl24bitaddressable = (sysout_size == 32? 0xffff : 0);*/
|
/*InterfacePage->dl24bitaddressable = (sysout_size == 32? 0xffff : 0);*/
|
||||||
InterfacePage->dl24bitaddressable = (sysout_size == 8 ? 0 : 0xffff);
|
InterfacePage->dl24bitaddressable = (sysout_size == 8 ? 0 : 0xffff);
|
||||||
new_lastvmem = (sysout_size * PAGES_IN_MBYTE) - 1;
|
new_lastvmem = (sysout_size * PAGES_IN_MBYTE) - 1;
|
||||||
@@ -457,7 +457,7 @@ void init_for_bltchar(void) {
|
|||||||
if (!for_makeinit) {
|
if (!for_makeinit) {
|
||||||
BLTCHAR_index = get_package_atom("\\MAIKO.PUNTBLTCHAR", 18, IL, 9, NIL);
|
BLTCHAR_index = get_package_atom("\\MAIKO.PUNTBLTCHAR", 18, IL, 9, NIL);
|
||||||
TEDIT_BLTCHAR_index = get_package_atom("\\TEDIT.BLTCHAR", 14, IL, 9, NIL);
|
TEDIT_BLTCHAR_index = get_package_atom("\\TEDIT.BLTCHAR", 14, IL, 9, NIL);
|
||||||
};
|
}
|
||||||
TOPWDS68k = MakeAtom68k("\\TOPWDS");
|
TOPWDS68k = MakeAtom68k("\\TOPWDS");
|
||||||
|
|
||||||
#ifdef COLOR
|
#ifdef COLOR
|
||||||
|
|||||||
@@ -61,9 +61,9 @@ void Mouse_hndlr(void); /* Fields mouse events from driver */
|
|||||||
#include "osmsgdefs.h"
|
#include "osmsgdefs.h"
|
||||||
#include "xwinmandefs.h"
|
#include "xwinmandefs.h"
|
||||||
|
|
||||||
#ifdef MAIKO_ENABLE_ETHERNET
|
#if defined(MAIKO_ENABLE_ETHERNET) || defined(MAIKO_ENABLE_NETHUB)
|
||||||
#include "etherdefs.h"
|
#include "etherdefs.h"
|
||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
#endif /* MAIKO_ENABLE_ETHERNET or MAIKO_ENABLE_NETHUB */
|
||||||
|
|
||||||
#include "dbprint.h"
|
#include "dbprint.h"
|
||||||
#if (defined(DOS) || defined(XWINDOW))
|
#if (defined(DOS) || defined(XWINDOW))
|
||||||
@@ -78,28 +78,28 @@ extern IOPAGE *IOPage68K;
|
|||||||
|
|
||||||
/* EmMouseX68K are already swapped, no need for GETWORD */
|
/* EmMouseX68K are already swapped, no need for GETWORD */
|
||||||
#define MouseMove(x, y) \
|
#define MouseMove(x, y) \
|
||||||
{ \
|
do { \
|
||||||
*((DLword *)EmMouseX68K) = x; \
|
*((DLword *)EmMouseX68K) = x; \
|
||||||
*((DLword *)EmMouseY68K) = y; \
|
*((DLword *)EmMouseY68K) = y; \
|
||||||
}
|
} while (0)
|
||||||
#ifdef NEVER
|
#ifdef NEVER
|
||||||
#ifndef BYTESWAP
|
#ifndef BYTESWAP
|
||||||
#define PUTBASEBIT68K(base68k, offset, bitvalue) \
|
#define PUTBASEBIT68K(base68k, offset, bitvalue) \
|
||||||
{ \
|
do { \
|
||||||
if (bitvalue) \
|
if (bitvalue) \
|
||||||
*((DLword *)(base68k) + (((u_short)(offset)) >> 4)) |= \
|
*((DLword *)(base68k) + (((u_short)(offset)) >> 4)) |= \
|
||||||
1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD); \
|
1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD); \
|
||||||
else \
|
else \
|
||||||
*((DLword *)(base68k) + (((u_short)(offset)) >> 4)) &= \
|
*((DLword *)(base68k) + (((u_short)(offset)) >> 4)) &= \
|
||||||
~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \
|
~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \
|
||||||
}
|
} while (0)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* convert to real 68 k address, then do arithmetic, and convert
|
/* convert to real 68 k address, then do arithmetic, and convert
|
||||||
back to i386 address pointer */
|
back to i386 address pointer */
|
||||||
|
|
||||||
#define PUTBASEBIT68K(base68k, offset, bitvalue) \
|
#define PUTBASEBIT68K(base68k, offset, bitvalue) \
|
||||||
{ \
|
do { \
|
||||||
int real68kbase; \
|
int real68kbase; \
|
||||||
real68kbase = 2 ^ ((int)(base68k)); \
|
real68kbase = 2 ^ ((int)(base68k)); \
|
||||||
if (bitvalue) \
|
if (bitvalue) \
|
||||||
@@ -108,7 +108,7 @@ extern IOPAGE *IOPage68K;
|
|||||||
else \
|
else \
|
||||||
GETWORD((DLword *)(real68kbase) + (((u_short)(offset)) >> 4)) &= \
|
GETWORD((DLword *)(real68kbase) + (((u_short)(offset)) >> 4)) &= \
|
||||||
~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \
|
~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \
|
||||||
}
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
#endif /* NEVER */
|
#endif /* NEVER */
|
||||||
|
|
||||||
@@ -124,9 +124,9 @@ extern volatile sig_atomic_t XNeedSignal;
|
|||||||
|
|
||||||
extern int LogFileFd;
|
extern int LogFileFd;
|
||||||
|
|
||||||
#ifdef MAIKO_ENABLE_ETHERNET
|
#if defined(MAIKO_ENABLE_ETHERNET) || defined(MAIKO_ENABLE_NETHUB)
|
||||||
extern int ether_fd;
|
extern int ether_fd;
|
||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
#endif /* MAIKO_ENABLE_ETHERNET or MAIKO_ENABLE_NETHUB */
|
||||||
|
|
||||||
extern DLword *DisplayRegion68k;
|
extern DLword *DisplayRegion68k;
|
||||||
|
|
||||||
@@ -263,6 +263,10 @@ void process_io_events()
|
|||||||
}
|
}
|
||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
#endif /* MAIKO_ENABLE_ETHERNET */
|
||||||
|
|
||||||
|
#ifdef MAIKO_ENABLE_NETHUB
|
||||||
|
check_ether();
|
||||||
|
#endif /* MAIKO_ENABLE_NETHUB */
|
||||||
|
|
||||||
#ifdef RS232
|
#ifdef RS232
|
||||||
if (RS232C_Fd >= 0 && (FD_ISSET(RS232C_Fd, &rfds) || (RS232C_remain_data && rs232c_lisp_is_ready())))
|
if (RS232C_Fd >= 0 && (FD_ISSET(RS232C_Fd, &rfds) || (RS232C_remain_data && rs232c_lisp_is_ready())))
|
||||||
rs232c_read();
|
rs232c_read();
|
||||||
@@ -336,22 +340,22 @@ typedef struct {
|
|||||||
} CURSOR;
|
} CURSOR;
|
||||||
|
|
||||||
#define CursorClippingX(posx, width) \
|
#define CursorClippingX(posx, width) \
|
||||||
{ \
|
do { \
|
||||||
if (displaywidth < ((posx) + HARD_CURSORWIDTH)) { \
|
if (displaywidth < ((posx) + HARD_CURSORWIDTH)) { \
|
||||||
LastCursorClippingX = (width) = displaywidth - (posx); \
|
LastCursorClippingX = (width) = displaywidth - (posx); \
|
||||||
} else { \
|
} else { \
|
||||||
LastCursorClippingX = (width) = HARD_CURSORWIDTH; \
|
LastCursorClippingX = (width) = HARD_CURSORWIDTH; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define CursorClippingY(posy, height) \
|
#define CursorClippingY(posy, height) \
|
||||||
{ \
|
do { \
|
||||||
if (displayheight < ((posy) + HARD_CURSORHEIGHT)) { \
|
if (displayheight < ((posy) + HARD_CURSORHEIGHT)) { \
|
||||||
LastCursorClippingY = (height) = displayheight - (posy); \
|
LastCursorClippingY = (height) = displayheight - (posy); \
|
||||||
} else { \
|
} else { \
|
||||||
LastCursorClippingY = (height) = HARD_CURSORHEIGHT; \
|
LastCursorClippingY = (height) = HARD_CURSORHEIGHT; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
extern int displaywidth, displayheight;
|
extern int displaywidth, displayheight;
|
||||||
extern int DisplayInitialized;
|
extern int DisplayInitialized;
|
||||||
@@ -448,7 +452,7 @@ void copy_cursor(int newx, int newy)
|
|||||||
dx = newx;
|
dx = newx;
|
||||||
w = LastCursorClippingX;
|
w = LastCursorClippingX;
|
||||||
h = LastCursorClippingY;
|
h = LastCursorClippingY;
|
||||||
;
|
|
||||||
srcbpl = HARD_CURSORWIDTH;
|
srcbpl = HARD_CURSORWIDTH;
|
||||||
dstbpl = displaywidth;
|
dstbpl = displaywidth;
|
||||||
op = 2; /* OR-in */
|
op = 2; /* OR-in */
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ int main(int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
perror("lde: This Display Model does not supported\n");
|
perror("lde: This Display Model does not supported\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}; /* endif( my_screen... */
|
} /* endif( my_screen... */
|
||||||
|
|
||||||
close(FrameBufferFd);
|
close(FrameBufferFd);
|
||||||
|
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ int sysout_loader(const char *sysout_file_name, int sys_size) {
|
|||||||
perror("sysout_loader: can't seek sysout file");
|
perror("sysout_loader: can't seek sysout file");
|
||||||
free(fptovp);
|
free(fptovp);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
};
|
}
|
||||||
lispworld_offset = GETFPTOVP(fptovp, i) * BYTESPER_PAGE;
|
lispworld_offset = GETFPTOVP(fptovp, i) * BYTESPER_PAGE;
|
||||||
if (read(sysout, lispworld_scratch + lispworld_offset, BYTESPER_PAGE) == -1) {
|
if (read(sysout, lispworld_scratch + lispworld_offset, BYTESPER_PAGE) == -1) {
|
||||||
printf("sysout_loader: can't read sysout file at %d\n", i);
|
printf("sysout_loader: can't read sysout file at %d\n", i);
|
||||||
@@ -314,11 +314,11 @@ int sysout_loader(const char *sysout_file_name, int sys_size) {
|
|||||||
}
|
}
|
||||||
free(fptovp);
|
free(fptovp);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
};
|
}
|
||||||
#ifdef BYTESWAP
|
#ifdef BYTESWAP
|
||||||
word_swap_page((DLword *)(lispworld_scratch + lispworld_offset), 128);
|
word_swap_page((DLword *)(lispworld_scratch + lispworld_offset), 128);
|
||||||
#endif
|
#endif
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
free(fptovp);
|
free(fptovp);
|
||||||
DBPRINT(("sysout file is read completely.\n"));
|
DBPRINT(("sysout file is read completely.\n"));
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ unsigned int BMask_tbl[] = {0xf, 7, 3, 1};
|
|||||||
therefore, width indicates the rest bits in source bitmap */
|
therefore, width indicates the rest bits in source bitmap */
|
||||||
|
|
||||||
#define LineBLT8(srcWptr, offset, width, dstLptr, op1, op2) \
|
#define LineBLT8(srcWptr, offset, width, dstLptr, op1, op2) \
|
||||||
{ \
|
do { \
|
||||||
DLword *srcw; \
|
DLword *srcw; \
|
||||||
u_int temp1; \
|
u_int temp1; \
|
||||||
for (srcw = (srcWptr) + (offset) / BITSPERDLWORD; ((width)-BITSPERNIBBLE) >= 0; \
|
for (srcw = (srcWptr) + (offset) / BITSPERDLWORD; ((width)-BITSPERNIBBLE) >= 0; \
|
||||||
@@ -116,7 +116,7 @@ unsigned int BMask_tbl[] = {0xf, 7, 3, 1};
|
|||||||
break; \
|
break; \
|
||||||
default:; /* error */ \
|
default:; /* error */ \
|
||||||
} /* switch end */ \
|
} /* switch end */ \
|
||||||
} /* MACRO END */
|
} while (0) /* MACRO END */
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ LispPTR cgfour_change_screen_mode(LispPTR which_screen)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: { error("cgfour_change_screen_mode:Unknown mode:"); }
|
default: { error("cgfour_change_screen_mode:Unknown mode:"); }
|
||||||
};
|
}
|
||||||
|
|
||||||
#ifndef DISPLAYBUFFER
|
#ifndef DISPLAYBUFFER
|
||||||
pr_close(ColorFb);
|
pr_close(ColorFb);
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ SCAN:
|
|||||||
while (STKWORD(scanptr68k)->flags != STK_BF) {
|
while (STKWORD(scanptr68k)->flags != STK_BF) {
|
||||||
S_WARN(STKWORD(scanptr68k)->flags == STK_NOTFLG, "NOTFLG not on", (void *)scanptr68k);
|
S_WARN(STKWORD(scanptr68k)->flags == STK_NOTFLG, "NOTFLG not on", (void *)scanptr68k);
|
||||||
scanptr68k = (StackWord *)(((DLword *)scanptr68k) + DLWORDSPER_CELL);
|
scanptr68k = (StackWord *)(((DLword *)scanptr68k) + DLWORDSPER_CELL);
|
||||||
};
|
}
|
||||||
|
|
||||||
#ifdef STACKCHECK
|
#ifdef STACKCHECK
|
||||||
if (((Bframe *)scanptr68k)->residual) {
|
if (((Bframe *)scanptr68k)->residual) {
|
||||||
@@ -605,7 +605,7 @@ void stack_check(StackWord *start68k) {
|
|||||||
WARN("StackCheck:!=STK_NOTFLG", printf("content:0x%x\n", GETWORD((DLword *)scanptr68k)));
|
WARN("StackCheck:!=STK_NOTFLG", printf("content:0x%x\n", GETWORD((DLword *)scanptr68k)));
|
||||||
}
|
}
|
||||||
scanptr68k = (StackWord *)((DLword *)scanptr68k + DLWORDSPER_CELL);
|
scanptr68k = (StackWord *)((DLword *)scanptr68k + DLWORDSPER_CELL);
|
||||||
} /* while end */;
|
} /* while end */
|
||||||
CHECK_BF((Bframe *)scanptr68k);
|
CHECK_BF((Bframe *)scanptr68k);
|
||||||
if (((Bframe *)scanptr68k)->residual) {
|
if (((Bframe *)scanptr68k)->residual) {
|
||||||
if ((DLword *)scanptr68k != top_ivar)
|
if ((DLword *)scanptr68k != top_ivar)
|
||||||
@@ -774,7 +774,7 @@ void walk_stack(StackWord *start68k) {
|
|||||||
GETWORD((DLword *)scanptr68k));
|
GETWORD((DLword *)scanptr68k));
|
||||||
}
|
}
|
||||||
scanptr68k = (StackWord *)((DLword *)scanptr68k + DLWORDSPER_CELL);
|
scanptr68k = (StackWord *)((DLword *)scanptr68k + DLWORDSPER_CELL);
|
||||||
} /* while end */;
|
} /* while end */
|
||||||
/* CHECK_BF(scanptr68k); */
|
/* CHECK_BF(scanptr68k); */
|
||||||
{
|
{
|
||||||
Bframe *bf = (Bframe *)scanptr68k;
|
Bframe *bf = (Bframe *)scanptr68k;
|
||||||
@@ -900,7 +900,7 @@ int quick_stack_check(void) {
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
scanptr68k = (StackWord *)((DLword *)scanptr68k + DLWORDSPER_CELL);
|
scanptr68k = (StackWord *)((DLword *)scanptr68k + DLWORDSPER_CELL);
|
||||||
} /* while end */;
|
} /* while end */
|
||||||
CHECK_BF((Bframe *)scanptr68k);
|
CHECK_BF((Bframe *)scanptr68k);
|
||||||
if (((Bframe *)scanptr68k)->residual) {
|
if (((Bframe *)scanptr68k)->residual) {
|
||||||
if ((DLword *)scanptr68k != top_ivar)
|
if ((DLword *)scanptr68k != top_ivar)
|
||||||
|
|||||||
@@ -65,21 +65,21 @@ static const char il_string[] = "INTERLISP";
|
|||||||
#define CLASSP(obj) (LC_TYPEP((obj), atom_class))
|
#define CLASSP(obj) (LC_TYPEP((obj), atom_class))
|
||||||
|
|
||||||
#define INSTANCE_OR_PUNT(obj, fn, argnum) \
|
#define INSTANCE_OR_PUNT(obj, fn, argnum) \
|
||||||
{ \
|
do { \
|
||||||
if (!LC_TYPEP((obj), atom_instance)) RETCALL(fn, argnum); \
|
if (!LC_TYPEP((obj), atom_instance)) RETCALL(fn, argnum); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define INSTANCE_CLASS_OR_PUNT(obj, fn, argnum) \
|
#define INSTANCE_CLASS_OR_PUNT(obj, fn, argnum) \
|
||||||
{ \
|
do { \
|
||||||
LispPTR tmp = DTD_FROM_LADDR(obj); \
|
LispPTR tmp = DTD_FROM_LADDR(obj); \
|
||||||
if (tmp != atom_instance && tmp != atom_class) RETCALL(fn, argnum); \
|
if (tmp != atom_instance && tmp != atom_class) RETCALL(fn, argnum); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define LC_INIT \
|
#define LC_INIT \
|
||||||
if (atom_instance == 0) LCinit()
|
if (atom_instance == 0) LCinit()
|
||||||
|
|
||||||
#define GET_IV_INDEX(objptr, iv, dest, otherwise) \
|
#define GET_IV_INDEX(objptr, iv, dest, otherwise) \
|
||||||
{ \
|
do { \
|
||||||
struct LCIVCacheEntry *ce; \
|
struct LCIVCacheEntry *ce; \
|
||||||
LispPTR iNames = (objptr)->iNames; \
|
LispPTR iNames = (objptr)->iNames; \
|
||||||
\
|
\
|
||||||
@@ -105,7 +105,7 @@ static const char il_string[] = "INTERLISP";
|
|||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
struct LCClass { /* class datatype */
|
struct LCClass { /* class datatype */
|
||||||
LispPTR metaClass, ivNames, ivDescrs, classUnitRec, localIVs, cvNames, cvDescrs, className,
|
LispPTR metaClass, ivNames, ivDescrs, classUnitRec, localIVs, cvNames, cvDescrs, className,
|
||||||
@@ -206,7 +206,7 @@ LispPTR LCFetchMethodOrHelp(LispPTR object, LispPTR selector) {
|
|||||||
ce->selector = selector;
|
ce->selector = selector;
|
||||||
return (ce->method_fn = ((LispPTR *)NativeAligned4FromLAddr(classptr->methods))[i - 1]);
|
return (ce->method_fn = ((LispPTR *)NativeAligned4FromLAddr(classptr->methods))[i - 1]);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
next_class:
|
next_class:
|
||||||
if ((cur_class = car(supers)) == NIL_PTR) break;
|
if ((cur_class = car(supers)) == NIL_PTR) break;
|
||||||
@@ -255,7 +255,7 @@ LispPTR LCFetchMethod(LispPTR class, LispPTR selector) {
|
|||||||
ce->selector = selector;
|
ce->selector = selector;
|
||||||
return (ce->method_fn = ((LispPTR *)NativeAligned4FromLAddr(classptr->methods))[i - 1]);
|
return (ce->method_fn = ((LispPTR *)NativeAligned4FromLAddr(classptr->methods))[i - 1]);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
next_class:
|
next_class:
|
||||||
if ((cur_class = car(supers)) == NIL_PTR) break;
|
if ((cur_class = car(supers)) == NIL_PTR) break;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ LispPTR N_OP_putbitsnfd(LispPTR base, LispPTR data, int word_offset,
|
|||||||
if (beta > 0xFF) { error("bad beta argument to PUTBITS"); }
|
if (beta > 0xFF) { error("bad beta argument to PUTBITS"); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((SEGMASK & data) != S_POSITIVE) { ERROR_EXIT(data); };
|
if ((SEGMASK & data) != S_POSITIVE) { ERROR_EXIT(data); }
|
||||||
|
|
||||||
pword = NativeAligned2FromLAddr(base + word_offset);
|
pword = NativeAligned2FromLAddr(base + word_offset);
|
||||||
field_size = 0xF & beta;
|
field_size = 0xF & beta;
|
||||||
|
|||||||
@@ -73,19 +73,19 @@ LispPTR fmemb(LispPTR item, LispPTR list) {
|
|||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
||||||
#define SAVE_ERROR_EXIT2(topcstk, tos) \
|
#define SAVE_ERROR_EXIT2(topcstk, tos) \
|
||||||
{ \
|
do { \
|
||||||
Scratch_CSTK = topcstk; \
|
Scratch_CSTK = topcstk; \
|
||||||
ERROR_EXIT(tos); \
|
ERROR_EXIT(tos); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define S_N_CHECKANDCADR2(sour, dest, tos, tcstk) \
|
#define S_N_CHECKANDCADR2(sour, dest, tos, tcstk) \
|
||||||
{ \
|
do { \
|
||||||
LispPTR parm = sour; \
|
LispPTR parm = sour; \
|
||||||
if (GetTypeNumber(parm) != TYPE_LISTP) { \
|
if (GetTypeNumber(parm) != TYPE_LISTP) { \
|
||||||
SAVE_ERROR_EXIT2(tcstk, tos); \
|
SAVE_ERROR_EXIT2(tcstk, tos); \
|
||||||
} else \
|
} else \
|
||||||
(dest) = cadr(parm); \
|
(dest) = cadr(parm); \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
LispPTR N_OP_listget(LispPTR plist, LispPTR tos) {
|
LispPTR N_OP_listget(LispPTR plist, LispPTR tos) {
|
||||||
struct cadr_cell cadrobj;
|
struct cadr_cell cadrobj;
|
||||||
|
|||||||
100
src/main.c
100
src/main.c
@@ -285,6 +285,22 @@ const char *helpstring =
|
|||||||
-help Print this message\n";
|
-help Print this message\n";
|
||||||
#endif /* DOS */
|
#endif /* DOS */
|
||||||
|
|
||||||
|
#if defined(MAIKO_ENABLE_NETHUB)
|
||||||
|
const char *nethubHelpstring =
|
||||||
|
"\
|
||||||
|
-nh-host dodo-host Hostname for Dodo Nethub (no networking if missing)\n\
|
||||||
|
-nh-port port-number Port for Dodo Nethub (optional, default: 3333)\n\
|
||||||
|
-nh-mac XX-XX-XX-XX-XX-XX Machine-ID for Maiko-VM (optional, default: CA-FF-EE-12-34-56) \n\
|
||||||
|
-nh-loglevel level Loglevel for Dodo networking (0..2, optional, default: 0)\n\
|
||||||
|
";
|
||||||
|
#else
|
||||||
|
const char *nethubHelpstring = "";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
||||||
|
extern int insnsCountdownForTimerAsyncEmulation;
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* M A I N E N T R Y P O I N T */
|
/* M A I N E N T R Y P O I N T */
|
||||||
@@ -304,7 +320,7 @@ int main(int argc, char *argv[])
|
|||||||
perror("Name of executable not found.");
|
perror("Name of executable not found.");
|
||||||
} else if (dld_init(dld_find_executable(argv[0])) != 0) {
|
} else if (dld_init(dld_find_executable(argv[0])) != 0) {
|
||||||
dld_perror("Can't init DLD.");
|
dld_perror("Can't init DLD.");
|
||||||
};
|
}
|
||||||
#endif /* MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE */
|
#endif /* MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE */
|
||||||
|
|
||||||
#ifdef XWINDOW
|
#ifdef XWINDOW
|
||||||
@@ -333,7 +349,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (argv[i] && ((strcmp(argv[i], "-help") == 0) || (strcmp(argv[i], "-HELP") == 0))) {
|
if (argv[i] && ((strcmp(argv[i], "-help") == 0) || (strcmp(argv[i], "-HELP") == 0))) {
|
||||||
fprintf(stderr, "%s", helpstring);
|
fprintf(stderr, "%s%s", helpstring, nethubHelpstring);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,7 +372,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (access(sysout_name, R_OK)) {
|
if (access(sysout_name, R_OK)) {
|
||||||
perror("Couldn't find a sysout to run");
|
perror("Couldn't find a sysout to run");
|
||||||
fprintf(stderr, "%s", helpstring);
|
fprintf(stderr, "%s%s", helpstring, nethubHelpstring);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
/* OK, sysout name is now in sysout_name, and i is moved past a supplied name */
|
/* OK, sysout name is now in sysout_name, and i is moved past a supplied name */
|
||||||
@@ -454,6 +470,80 @@ int main(int argc, char *argv[])
|
|||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
#endif /* MAIKO_ENABLE_ETHERNET */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MAIKO_ENABLE_NETHUB
|
||||||
|
else if (!strcmp(argv[i], "-nh-host")) {
|
||||||
|
if (argc > ++i) {
|
||||||
|
setNethubHost(argv[i]);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Missing argument after -nh-host\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!strcmp(argv[i], "-nh-port")) {
|
||||||
|
if (argc > ++i) {
|
||||||
|
errno = 0;
|
||||||
|
tmpint = strtol(argv[i], (char **)NULL, 10);
|
||||||
|
if (errno == 0 && tmpint > 0) {
|
||||||
|
setNethubPort(tmpint);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Bad value for -nh-port\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Missing argument after -nh-port\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!strcmp(argv[i], "-nh-mac")) {
|
||||||
|
if (argc > ++i) {
|
||||||
|
int b0, b1, b2, b3, b4, b5;
|
||||||
|
if (sscanf(argv[i], "%x-%x-%x-%x-%x-%x", &b0, &b1, &b2, &b3, &b4, &b5) == 6) {
|
||||||
|
setNethubMac(b0, b1, b2, b3, b4, b5);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Invalid argument for -nh-mac\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Missing argument after -nh-mac\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!strcmp(argv[i], "-nh-loglevel")) {
|
||||||
|
if (argc > ++i) {
|
||||||
|
errno = 0;
|
||||||
|
tmpint = strtol(argv[i], (char **)NULL, 10);
|
||||||
|
if (errno == 0 && tmpint >= 0) {
|
||||||
|
setNethubLogLevel(tmpint);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Bad value for -nh-loglevel\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Missing argument after -nh-loglevel\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* MAIKO_ENABLE_NETHUB */
|
||||||
|
|
||||||
|
#if defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
||||||
|
else if (!strcmp(argv[i], "-intr-emu-insns")) {
|
||||||
|
if (argc > ++i) {
|
||||||
|
errno = 0;
|
||||||
|
tmpint = strtol(argv[i], (char **)NULL, 10);
|
||||||
|
if (errno == 0 && tmpint > 1000) {
|
||||||
|
insnsCountdownForTimerAsyncEmulation = tmpint;
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Bad value for -intr-emu-insns (integer > 1000)\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Missing argument after -intr-emu-insns\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* diagnostic flag for big vmem write() calls */
|
/* diagnostic flag for big vmem write() calls */
|
||||||
else if (!strcmp(argv[i], "-xpages")) {
|
else if (!strcmp(argv[i], "-xpages")) {
|
||||||
if (argc > ++i) {
|
if (argc > ++i) {
|
||||||
@@ -491,6 +581,10 @@ int main(int argc, char *argv[])
|
|||||||
init_ether(); /* modified by kiuchi Nov. 4 */
|
init_ether(); /* modified by kiuchi Nov. 4 */
|
||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
#endif /* MAIKO_ENABLE_ETHERNET */
|
||||||
|
|
||||||
|
#ifdef MAIKO_ENABLE_NETHUB
|
||||||
|
connectToHub();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DOS
|
#ifdef DOS
|
||||||
init_host_filesystem();
|
init_host_filesystem();
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ LispPTR N_OP_misc7(LispPTR arg1, LispPTR arg2, LispPTR arg3, LispPTR arg4, LispP
|
|||||||
case OP_ERASE: GETWORDBASEWORD(base, offset) = bmdata & ~bmmask; break;
|
case OP_ERASE: GETWORDBASEWORD(base, offset) = bmdata & ~bmmask; break;
|
||||||
case OP_READ: break;
|
case OP_READ: break;
|
||||||
default: GETWORDBASEWORD(base, offset) = bmdata | bmmask;
|
default: GETWORDBASEWORD(base, offset) = bmdata | bmmask;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef XWINDOW
|
#ifdef XWINDOW
|
||||||
|
|||||||
@@ -274,7 +274,6 @@ void simulate_unbind(FX2 *frame, int unbind_count, FX2 *returner) {
|
|||||||
; /* find the binding mark */
|
; /* find the binding mark */
|
||||||
value = (int)*stackptr;
|
value = (int)*stackptr;
|
||||||
lastpvar = (LispPTR *)((DLword *)frame + FRAMESIZE + 2 + GetLoWord(value));
|
lastpvar = (LispPTR *)((DLword *)frame + FRAMESIZE + 2 + GetLoWord(value));
|
||||||
;
|
|
||||||
bindnvalues = (~value) >> 16;
|
bindnvalues = (~value) >> 16;
|
||||||
for (value = bindnvalues; --value >= 0;) { *--lastpvar = 0xffffffff; }
|
for (value = bindnvalues; --value >= 0;) { *--lastpvar = 0xffffffff; }
|
||||||
/* This line caused \NSMAIL.READ.HEADING to smash memory, */
|
/* This line caused \NSMAIL.READ.HEADING to smash memory, */
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ gotpty:
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
perror("fcntl F_SETOWN of log PTY");
|
perror("fcntl F_SETOWN of log PTY");
|
||||||
#endif
|
#endif
|
||||||
};
|
}
|
||||||
FD_SET(LogFileFd, &LispReadFds);
|
FD_SET(LogFileFd, &LispReadFds);
|
||||||
flush_pty();
|
flush_pty();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user