[kaffe] CVS kaffe (dalibor): Fixes for m68k-openbsd build

Kaffe CVS cvs-commits at kaffe.org
Fri Apr 16 10:06:03 PDT 2004


PatchSet 4653 
Date: 2004/04/16 16:26:37
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Fixes for m68k-openbsd build

2004-04-16  Riccardo Mottola <zuse at libero.it>

        * config/m68k/openbsd2/jit.h:
        (CALL_KAFFE_FUNCTION): Removed.
        (CALL_KAFFE_FUNCTION_VARARGS) Rearranged.
        (FPFRAME, HAVE_TRAMPOLINE, methodTrampoline,
        FILL_IN_TRAMPOLINE, FIXUP_TRAMPOLINE_DECL,
        FIXUP_TRAMPOLINE_INIT, NR_GLOBALS, NR_ARGUMENTS,
        SRNR, SAVEMASK, RESTOREMASK): Copied over from
        config/m68k/jit.h in order to fix compilation problems.

        * config/m68k/openbsd2/md.h:
        Include m68k/common.h for compare & exchange macro.

Members: 
	ChangeLog:1.2229->1.2230 
	config/m68k/openbsd2/jit.h:1.3->1.4 
	config/m68k/openbsd2/md.h:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2229 kaffe/ChangeLog:1.2230
--- kaffe/ChangeLog:1.2229	Fri Apr 16 15:28:17 2004
+++ kaffe/ChangeLog	Fri Apr 16 16:26:37 2004
@@ -1,3 +1,17 @@
+2004-04-16  Riccardo Mottola <zuse at libero.it>
+
+	* config/m68k/openbsd2/jit.h:
+	(CALL_KAFFE_FUNCTION): Removed.
+	(CALL_KAFFE_FUNCTION_VARARGS) Rearranged.
+	(FPFRAME, HAVE_TRAMPOLINE, methodTrampoline,
+	FILL_IN_TRAMPOLINE, FIXUP_TRAMPOLINE_DECL, 
+	FIXUP_TRAMPOLINE_INIT, NR_GLOBALS, NR_ARGUMENTS,
+	SRNR, SAVEMASK, RESTOREMASK): Copied over from 
+	config/m68k/jit.h in order to fix compilation problems.
+
+	* config/m68k/openbsd2/md.h:
+	Include m68k/common.h for compare & exchange macro.
+
 2004-04-16  Ito kazumitsu <kaz at maczuka.gcd.org>
         * kaffe/kaffevm/locks.c
 	slowUnlockMutex(): lk->holder may be null. So check it before
@@ -67,7 +81,6 @@
 	Fix bug where the exec code would search the path for
 	a binary, but then didn't use the found file.
 
->>>>>>> 1.2228
 2004-04-15  Jim Pick <jim at kaffe.org>
 
 	* configure.ac:
Index: kaffe/config/m68k/openbsd2/jit.h
diff -u kaffe/config/m68k/openbsd2/jit.h:1.3 kaffe/config/m68k/openbsd2/jit.h:1.4
--- kaffe/config/m68k/openbsd2/jit.h:1.3	Fri Sep 10 14:03:55 1999
+++ kaffe/config/m68k/openbsd2/jit.h	Fri Apr 16 16:26:38 2004
@@ -5,8 +5,15 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2004
+ *	Kaffe.org contributors, see ChangeLogs for details.  All rights reserved.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
+ *
+ * Modified by Riccardo Mottola <rmottola at users.sourceforge.net>
+ * after m68k/jit.h by Kiyo Inaba
+ *
  */
 
 /* NOTE:
@@ -19,43 +26,6 @@
 #define __m68k_jit_h
 
 /**/
-/* Native function invocation. */
-/**/
-#define	CALL_KAFFE_FUNCTION_VARARGS(meth, obj, nargs, argptr, retval)	\
-	__asm__ __volatile__(						\
-		"movem%.l %/d2-%/d7/%/a1-%/a5,%-\n\t"			\
-		"fmovem %/fp0-%/fp7,%-\n\t"				\
-		"move%.l %3,%/d0\n\t"					\
-		"beq 2f\n\t"						\
-		"lea %4@(%/d0:L:4),%/a0\n\t"				\
-		"subq%.l %#1,%/d0\n"					\
-	"1:	move%.l %/a0 at -,%-\n\t"					\
-		"dbra %/d0, 1b\n"					\
-	"2:	move%.l %2,%-\n\t"					\
-		"jsr %1\n\t"						\
-		"move%.l %5,%/d1\n\t"					\
-		"addl %/d1,%/sp\n\t"					\
-		"move%.l %/d0,%0\n\t"					\
-		"fmovem %+,%/fp0-%/fp7\n\t"				\
-		"movem%.l %+,%/d2-%/d7/%/a1-%/a5"			\
-		: "=m"(retval)						\
-		: "m"(*meth->ncode), "g"(obj), "g"(nargs), "a"(argptr),	\
-		  "m"(4*(nargs+1))					\
-		: "cc", "memory", "a0","d0","d1")
-
-#define CALL_KAFFE_FUNCTION(meth, obj)                                  \
-	__asm__ __volatile__(						\
-		"movem%.l %/d0-%/d7/%/a0-%/a5,%-\n\t"			\
-		"fmovem %/fp0-%/fp7,%-\n\t"				\
-		"move%.l %1,%-\n\t"					\
-		"jsr %0\n\t"						\
-		"addl %#4,%/sp\n\t"					\
-		"fmovem %+,%/fp0-%/fp7\n\t"				\
-		"movem%.l %+,%/d0-%/d7/%/a0-%/a5"			\
-		: : "m"(*meth->ncode), "g"(obj)				\
-		: "cc", "memory")
-		
-/**/
 /* Exception handling information. */
 /**/
 
@@ -78,6 +48,7 @@
 
 /* Extract the PC from the given frame */
 #define	PCFRAME(f)		((f)->retpc)
+#define FPFRAME(f)		((f)->retfp)
 
 /* Get the first exception frame from a subroutine call */
 #define	FIRSTFRAME(f, o)						\
@@ -99,6 +70,59 @@
 		    "m"(*(nativecode*)info.handler)			\
 		: "d0", "cc", "memory")
 
+/**/
+/* Native function invocation. */
+/**/
+#define	CALL_KAFFE_FUNCTION_VARARGS(meth, obj, nargs, argptr, retval)	\
+	__asm__ __volatile__(						\
+		"movem%.l %/d2-%/d7/%/a1-%/a5,%-\n\t"			\
+		"fmovem %/fp0-%/fp7,%-\n\t"				\
+		"move%.l %3,%/d0\n\t"					\
+		"beq 2f\n\t"						\
+		"lea %4@(%/d0:L:4),%/a0\n\t"				\
+		"subq%.l %#1,%/d0\n"					\
+	"1:	move%.l %/a0 at -,%-\n\t"					\
+		"dbra %/d0, 1b\n"					\
+	"2:	move%.l %2,%-\n\t"					\
+		"jsr %1\n\t"						\
+		"move%.l %5,%/d1\n\t"					\
+		"addl %/d1,%/sp\n\t"					\
+		"move%.l %/d0,%0\n\t"					\
+		"fmovem %+,%/fp0-%/fp7\n\t"				\
+		"movem%.l %+,%/d2-%/d7/%/a1-%/a5"			\
+		: "=m"(retval)						\
+		: "m"(*meth->ncode), "g"(obj), "g"(nargs), "a"(argptr),	\
+		  "m"(4*(nargs+1))					\
+		: "cc", "memory", "a0","d0","d1")
+		
+
+
+/**/
+/* Method dispatch.  */
+/**/
+
+#define HAVE_TRAMPOLINE
+
+typedef struct _methodTrampoline {
+        unsigned short call;
+	int fixup;
+	struct _methods* meth;
+	void** where;
+} methodTrampoline;
+
+extern void m68k_do_fixup_trampoline(void);
+
+#define FILL_IN_TRAMPOLINE(t,m,w)					\
+        do {                                                            \
+                (t)->call = 0x4eb9;	/* jsr abs.l */			\
+                (t)->fixup = (int)m68k_do_fixup_trampoline;		\
+                (t)->meth = (m);                                        \
+		(t)->where = (w);					\
+        } while (0)
+
+#define FIXUP_TRAMPOLINE_DECL	void** _data
+#define FIXUP_TRAMPOLINE_INIT	(meth = (Method*)_data[0], \
+				 where = (void**)_data[1])
 
 /**/
 /* Register management information. */
@@ -139,12 +163,25 @@
 /* Number of registers in the register set */
 #define	NR_REGISTERS	24
 
+/* Number of function globals in register set */
+#define NR_GLOBALS      8
+
+/* Number of arguments passed in registers - we don't have any */
+#undef  NR_ARGUMENTS
+
+/* Define the registers to be saved and restore in the prologue/epilogue */
+#define SRNR            10
+#define SAVEMASK        0x3F3C
+#define RESTOREMASK     0x3CFC
+
+
 /**/
 /* Opcode generation. */
 /**/
 
 /* Define if generated code uses two operands rather than one */
 #define	TWO_OPERAND
+
 
 /**/
 /* Slot management information. */
Index: kaffe/config/m68k/openbsd2/md.h
diff -u kaffe/config/m68k/openbsd2/md.h:1.4 kaffe/config/m68k/openbsd2/md.h:1.5
--- kaffe/config/m68k/openbsd2/md.h:1.4	Fri Dec 12 15:58:54 2003
+++ kaffe/config/m68k/openbsd2/md.h	Fri Apr 16 16:26:38 2004
@@ -18,6 +18,7 @@
 #ifndef __m68k_openbsd_md_h
 #define __m68k_openbsd_md_h
 
+#include "m68k/common.h"
 #include "m68k/threads.h"
 #include "m68k/sysdepCallMethod.h"
 




More information about the kaffe mailing list