]> gitweb.factorcode.org Git - factor.git/commitdiff
More build system work
authorSlava <slava@emu.(none)>
Sat, 22 Sep 2007 04:44:27 +0000 (00:44 -0400)
committerSlava <slava@emu.(none)>
Sat, 22 Sep 2007 04:44:27 +0000 (00:44 -0400)
14 files changed:
Makefile
vm/Config.arm
vm/Config.ppc
vm/Config.x86.64
vm/cpu-amd64.S [deleted file]
vm/cpu-amd64.h [deleted file]
vm/cpu-x86.32.S
vm/cpu-x86.32.h
vm/cpu-x86.64.S
vm/cpu-x86.S
vm/cpu-x86.h
vm/platform.h
vm/run.c
vm/stack.c

index 73c7b2eb5ee4febba9a4478be0406a862b208f8e..c5db03896e3cf8d6252cb6619a346465c0d089d0 100644 (file)
--- a/Makefile
+++ b/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
index fc41bb9c37b2bdf23073f258ccc9343bce241749..2273d61cafabe3cac7993bd459fbcf9b0334d149 100644 (file)
@@ -1,2 +1 @@
-BOOT_ARCH = arm
 PLAF_DLL_OBJS += vm/cpu-arm.o
index 3fa5fd8df1fa79ab8a6dac56d40da0cf4f370ca9..1ded04dda19b08dc15f121b70b6b265f582a99fb 100644 (file)
@@ -1,2 +1 @@
-BOOT_ARCH = ppc
 PLAF_DLL_OBJS += vm/cpu-ppc.o
index 9630e4a3ff837cfc0fb095fb03f756e12f5717ff..53a4d3c5e12ca0e2ff3a0fb2a12d6d0f36ee3229 100644 (file)
@@ -1,2 +1 @@
-BOOT_ARCH = amd64
 PLAF_DLL_OBJS += vm/cpu-x86.64.o
diff --git a/vm/cpu-amd64.S b/vm/cpu-amd64.S
deleted file mode 100644 (file)
index 5df8bd0..0000000
+++ /dev/null
@@ -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
diff --git a/vm/cpu-amd64.h b/vm/cpu-amd64.h
deleted file mode 100644 (file)
index 64d2c3a..0000000
+++ /dev/null
@@ -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);
-}
index 57f8656a753dda5e06d2223931f1ef40cc57bd0a..93af51c9681f9bff8fb13c0367018aa3efd2d515 100644 (file)
@@ -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
index 0129737685fc609c718c5549daa38934573f839e..4c4acb0ad3ca2b132862a3fe1eb8902ddda38ad2 100644 (file)
@@ -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);
index 12af25eec555536b2a23f117c36b709d25f1fcf6..ed502af89b833075c10184befee23746efaa2373 100644 (file)
@@ -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
index e8eeb403b78ef99842ef403815b269a304748ece..a84ae6c480172cc50d641312596feb09d3f4bc6b 100644 (file)
@@ -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. */
index e705432e70f9e352d0257b5b3077bc00833e5f56..a535038eefcb897b6d07bdcef8f7c666861db2e1 100644 (file)
@@ -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);
index e1da40a03735431987f418897d2a503b639ee313..d5e5d6902a6a773d1252265a1e2188c74828915a 100644 (file)
 #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
 #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)
index 2ed7bae7f479689a343ef315c3e0b93e43aaf373..2b946b0722a89aca1fd729f6b67d8298c9232205 100644 (file)
--- a/vm/run.c
+++ b/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);
index 9c36389b40ca49cc8c569446d4d23873c13457a7..e50575219c3fb28cd0e8cd2846d1ed9a53c2f0cd 100644 (file)
@@ -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;
 }