More build system work
parent
2892083014
commit
6dc28869ce
64
Makefile
64
Makefile
|
@ -44,21 +44,20 @@ EXE_OBJS = $(PLAF_EXE_OBJS)
|
|||
default:
|
||||
@echo "Run 'make' with one of the following parameters:"
|
||||
@echo ""
|
||||
@echo "freebsd-x86"
|
||||
@echo "freebsd-amd64"
|
||||
@echo "linux-x86"
|
||||
@echo "linux-amd64"
|
||||
@echo "freebsd-x86-32"
|
||||
@echo "freebsd-x86-64"
|
||||
@echo "linux-x86-32"
|
||||
@echo "linux-x86-64"
|
||||
@echo "linux-ppc"
|
||||
@echo "linux-arm"
|
||||
@echo "openbsd-x86"
|
||||
@echo "openbsd-amd64"
|
||||
@echo "macosx-x86"
|
||||
@echo "openbsd-x86-32"
|
||||
@echo "openbsd-x86-64"
|
||||
@echo "macosx-x86-32"
|
||||
@echo "macosx-ppc"
|
||||
@echo "solaris-x86"
|
||||
@echo "solaris-amd64"
|
||||
@echo "solaris-x86-32"
|
||||
@echo "solaris-x86-64"
|
||||
@echo "windows-ce-arm"
|
||||
@echo "windows-ce-x86"
|
||||
@echo "windows-nt-x86"
|
||||
@echo "windows-nt-x86-32"
|
||||
@echo ""
|
||||
@echo "Additional modifiers:"
|
||||
@echo ""
|
||||
|
@ -67,17 +66,17 @@ default:
|
|||
@echo "NO_UI=1 don't link with X11 libraries (ignored on Mac OS X)"
|
||||
@echo "X11=1 force link with X11 libraries instead of Cocoa (only on Mac OS X)"
|
||||
|
||||
openbsd-x86:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.openbsd.x86
|
||||
openbsd-x86-32:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.openbsd.x86.32
|
||||
|
||||
openbsd-amd64:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.openbsd.amd64
|
||||
openbsd-x86-64:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.openbsd.x86.64
|
||||
|
||||
freebsd-x86:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.freebsd.x86
|
||||
freebsd-x86-32:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.freebsd.x86.32
|
||||
|
||||
freebsd-amd64:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.freebsd.amd64
|
||||
freebsd-x86-64:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.freebsd.x86.64
|
||||
|
||||
macosx-freetype:
|
||||
ln -sf libfreetype.6.dylib \
|
||||
|
@ -86,14 +85,14 @@ macosx-freetype:
|
|||
macosx-ppc: macosx-freetype
|
||||
$(MAKE) $(EXECUTABLE) macosx.app CONFIG=vm/Config.macosx.ppc
|
||||
|
||||
macosx-x86: macosx-freetype
|
||||
$(MAKE) $(EXECUTABLE) macosx.app CONFIG=vm/Config.macosx.x86
|
||||
macosx-x86-32: macosx-freetype
|
||||
$(MAKE) $(EXECUTABLE) macosx.app CONFIG=vm/Config.macosx.x86.32
|
||||
|
||||
linux-x86:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.x86
|
||||
linux-x86-32:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.x86.32
|
||||
|
||||
linux-amd64:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.amd64
|
||||
linux-x86-64:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.x86.64
|
||||
|
||||
linux-ppc:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.ppc
|
||||
|
@ -101,21 +100,18 @@ linux-ppc:
|
|||
linux-arm:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.arm
|
||||
|
||||
solaris-x86:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.solaris.x86
|
||||
solaris-x86-32:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.solaris.x86.32
|
||||
|
||||
solaris-amd64:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.solaris.amd64
|
||||
solaris-x86-64:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.solaris.x86.64
|
||||
|
||||
windows-nt-x86:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.nt.x86
|
||||
windows-nt-x86-32:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.32
|
||||
|
||||
windows-ce-arm:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.ce.arm
|
||||
|
||||
windows-ce-x86:
|
||||
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.ce.x86
|
||||
|
||||
macosx.app: factor
|
||||
mkdir -p $(BUNDLE)/Contents/MacOS
|
||||
cp $(EXECUTABLE) $(BUNDLE)/Contents/MacOS/factor
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
BOOT_ARCH = arm
|
||||
PLAF_DLL_OBJS += vm/cpu-arm.o
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
BOOT_ARCH = ppc
|
||||
PLAF_DLL_OBJS += vm/cpu-ppc.o
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
BOOT_ARCH = amd64
|
||||
PLAF_DLL_OBJS += vm/cpu-x86.64.o
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#include "asm.h"
|
||||
|
||||
/* Callable from C as
|
||||
void *native_stack_pointer(void) */
|
||||
.globl MANGLE(native_stack_pointer)
|
||||
MANGLE(native_stack_pointer):
|
||||
mov %rsp,%rax
|
||||
ret
|
|
@ -1,20 +0,0 @@
|
|||
#define FACTOR_CPU_STRING "x86.64"
|
||||
|
||||
register CELL ds asm("r14");
|
||||
register CELL rs asm("r15");
|
||||
void **primitives;
|
||||
|
||||
INLINE void flush_icache(CELL start, CELL len) {}
|
||||
|
||||
void *native_stack_pointer(void);
|
||||
|
||||
typedef CELL F_COMPILED_FRAME;
|
||||
|
||||
#define PREVIOUS_FRAME(frame) (frame + 1)
|
||||
#define RETURN_ADDRESS(frame) (*(frame))
|
||||
|
||||
INLINE void execute(CELL word)
|
||||
{
|
||||
F_WORD *untagged = untag_object(word);
|
||||
untagged->xt(word);
|
||||
}
|
|
@ -8,16 +8,16 @@ and the callstack top is passed in EDX */
|
|||
#define ARG1 %edx
|
||||
#define XT_REG %ecx
|
||||
#define STACK_REG %esp
|
||||
#define DS_REG %edi
|
||||
#define DS_REG %esi
|
||||
|
||||
#define CELL_SIZE 4
|
||||
|
||||
#define PUSH_NONVOLATILE \
|
||||
push %ebx \
|
||||
push %ebx ; \
|
||||
push %ebp
|
||||
|
||||
#define POP_NONVOLATILE \
|
||||
pop %ebp \
|
||||
pop %ebp ; \
|
||||
pop %ebx
|
||||
|
||||
#define QUOT_XT_OFFSET 5
|
||||
|
|
|
@ -4,5 +4,3 @@ register CELL ds asm("esi");
|
|||
register CELL rs asm("edi");
|
||||
|
||||
#define FASTCALL __attribute__ ((regparm (2)))
|
||||
|
||||
void set_callstack(F_STACK_FRAME *to, F_STACK_FRAME *from, CELL length, void *memcpy);
|
||||
|
|
|
@ -9,19 +9,19 @@
|
|||
#define CELL_SIZE 8
|
||||
|
||||
#define PUSH_NONVOLATILE \
|
||||
push %rbx \
|
||||
push %rbp \
|
||||
push %r12 \
|
||||
push %r13 \
|
||||
push %r16 \
|
||||
push %rbx ; \
|
||||
push %rbp ; \
|
||||
push %r12 ; \
|
||||
push %r13 ; \
|
||||
push %r16 ; \
|
||||
push %rax /* Alignment */
|
||||
|
||||
#define POP_NONVOLATILE \
|
||||
pop %rax /* Alignment */ \
|
||||
pop %r16 \
|
||||
pop %r13 \
|
||||
pop %r12 \
|
||||
pop %rbp \
|
||||
pop %rax ; /* Alignment */ \
|
||||
pop %r16 ; \
|
||||
pop %r13 ; \
|
||||
pop %r12 ; \
|
||||
pop %rbp ; \
|
||||
pop %rbx
|
||||
|
||||
#define QUOT_XT_OFFSET 13
|
||||
|
|
|
@ -10,7 +10,7 @@ DEF(FASTCALL void,c_to_factor,(CELL quot)):
|
|||
call MANGLE(save_callstack_bottom)
|
||||
|
||||
mov (STACK_REG),ARG0 /* Pass quot as arg 1 */
|
||||
mov QUOT_XT_OFFSET(STACK_REG),XT_REG
|
||||
mov QUOT_XT_OFFSET(ARG0),XT_REG
|
||||
call *XT_REG /* Call quot-xt */
|
||||
|
||||
POP ARG0
|
||||
|
@ -18,7 +18,7 @@ DEF(FASTCALL void,c_to_factor,(CELL quot)):
|
|||
ret
|
||||
|
||||
DEF(FASTCALL void,undefined,(CELL word)):
|
||||
mov STACK_REG,ARG1 /* Pass callstack pointer as arg 2 (not fastcall) */
|
||||
mov STACK_REG,ARG1 /* Pass callstack pointer */
|
||||
jmp MANGLE(undefined_error) /* This throws an error */
|
||||
|
||||
DEF(FASTCALL void,dosym,(CELL word)):
|
||||
|
@ -31,7 +31,7 @@ enabled */
|
|||
DEF(FASTCALL void,docol_profiling,(CELL word)):
|
||||
add $CELL_SIZE,PROFILING_OFFSET(%eax) /* Increment profile-count slot */
|
||||
DEF(FASTCALL void,docol,(CELL word)):
|
||||
mov WORD_XT_OFFSET(ARG0),ARG0 /* Load word-def slot */
|
||||
mov WORD_DEF_OFFSET(ARG0),ARG0 /* Load word-def slot */
|
||||
JUMP_QUOT
|
||||
|
||||
/* We must pass the XT to the quotation in ECX. */
|
||||
|
|
|
@ -28,3 +28,5 @@ FASTCALL void undefined(CELL word);
|
|||
FASTCALL void dosym(CELL word);
|
||||
FASTCALL void docol_profiling(CELL word);
|
||||
FASTCALL void docol(CELL word);
|
||||
|
||||
void set_callstack(F_STACK_FRAME *to, F_STACK_FRAME *from, CELL length, void *memcpy);
|
||||
|
|
|
@ -13,10 +13,8 @@
|
|||
#if defined(WINDOWS)
|
||||
#if defined(WINCE)
|
||||
#include "os-windows-ce.h"
|
||||
#elif defined (__i386)
|
||||
#include "os-windows-nt.h"
|
||||
#else
|
||||
#error "Unsupported Windows flavor"
|
||||
#include "os-windows-nt.h"
|
||||
#endif
|
||||
|
||||
#include "os-windows.h"
|
||||
|
@ -44,7 +42,7 @@
|
|||
#include "os-unix-ucontext.h"
|
||||
|
||||
#if defined(FACTOR_X86)
|
||||
#include "os-freebsd-x86.h"
|
||||
#include "os-freebsd-x86.32.h"
|
||||
#else
|
||||
#error "Unsupported FreeBSD flavor"
|
||||
#endif
|
||||
|
@ -53,9 +51,9 @@
|
|||
#include "os-openbsd.h"
|
||||
|
||||
#if defined(FACTOR_X86)
|
||||
#include "os-openbsd-x86.h"
|
||||
#include "os-openbsd-x86.32.h"
|
||||
#elif defined(FACTOR_AMD64)
|
||||
#include "os-openbsd-amd64.h"
|
||||
#include "os-openbsd-x86.64.h"
|
||||
#else
|
||||
#error "Unsupported OpenBSD flavor"
|
||||
#endif
|
||||
|
@ -86,11 +84,11 @@
|
|||
#endif
|
||||
|
||||
#if defined(FACTOR_X86)
|
||||
#include "cpu-x86.h"
|
||||
#include "cpu-x86.32.h"
|
||||
#elif defined(FACTOR_AMD64)
|
||||
#include "cpu-x86.h"
|
||||
#elif defined(FACTOR_AMD64)
|
||||
#include "cpu-x86.64.h"
|
||||
#include "cpu-x86.h"
|
||||
#elif defined(FACTOR_PPC)
|
||||
#include "cpu-ppc.h"
|
||||
#elif defined(FACTOR_ARM)
|
||||
|
|
2
vm/run.c
2
vm/run.c
|
@ -199,7 +199,7 @@ void not_implemented_error(void)
|
|||
}
|
||||
|
||||
/* This function is called from the undefined function in cpu_*.S */
|
||||
void undefined_error(CELL word, F_STACK_FRAME *callstack_top)
|
||||
FASTCALL void undefined_error(CELL word, F_STACK_FRAME *callstack_top)
|
||||
{
|
||||
stack_chain->callstack_top = callstack_top;
|
||||
general_error(ERROR_UNDEFINED_WORD,word,F,NULL);
|
||||
|
|
|
@ -19,7 +19,7 @@ void fix_stacks(void)
|
|||
}
|
||||
|
||||
/* called before entry into Factor code. */
|
||||
void save_callstack_bottom(F_STACK_FRAME *callstack_bottom)
|
||||
FASTCALL void save_callstack_bottom(F_STACK_FRAME *callstack_bottom)
|
||||
{
|
||||
stack_chain->callstack_bottom = callstack_bottom;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue