[kaffe] CVS kaffe (dalibor): Moved sysdepCallMethod into its own file on m68k

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Fri Dec 12 08:12:02 2003


PatchSet 4217 
Date: 2003/12/12 15:58:49
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Moved sysdepCallMethod into its own file on m68k

2003-12-12  Dalibor Topic <robilad@kaffe.org>

        * config/m68k/sysdepCallMethod.h: New file.

        * config/Makefile.am:
        ((EXTRA_DIST) Added config/m68k/sysdepCallMethod.h.

        * aclocal.m4,
        config/Makefile.in:
        Regenerated.

        * config/m68k/common.h:
        (sysdepCallMethod) Moved into its own file,
        config/m68k/sysdepCallMethod.h.
        (sysdepCallMethod)[USE_ASM] Deleted.

        * config/m68k/a-ux/md.h,
        config/m68k/amigaos/md.h,
        config/m68k/netbsd1/md.h,
        config/m68k/nextstep3/md.h,
        config/m68k/openbsd2/md.h,
        config/m68k/sunos4/md.h:
        Include config/m68k/sysdepCallMethod.h.

        * config/m68k/linux/md.h:
        (sysdepCallMethod) Converted macro to inline function.

Members: 
	ChangeLog:1.1807->1.1808 
	aclocal.m4:1.79->1.80 
	config/Makefile.am:1.30->1.31 
	config/Makefile.in:1.97->1.98 
	config/m68k/common.h:1.13->1.14 
	config/m68k/sysdepCallMethod.h:INITIAL->1.1 
	config/m68k/a-ux/md.h:1.4->1.5 
	config/m68k/amigaos/md.h:1.3->1.4 
	config/m68k/linux/md.h:1.5->1.6 
	config/m68k/netbsd1/md.h:1.5->1.6 
	config/m68k/nextstep3/md.h:1.2->1.3 
	config/m68k/openbsd2/md.h:1.3->1.4 
	config/m68k/sunos4/md.h:1.3->1.4 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1807 kaffe/ChangeLog:1.1808
--- kaffe/ChangeLog:1.1807	Fri Dec 12 15:42:53 2003
+++ kaffe/ChangeLog	Fri Dec 12 15:58:49 2003
@@ -1,3 +1,30 @@
+2003-12-12  Dalibor Topic <robilad@kaffe.org>
+
+	* config/m68k/sysdepCallMethod.h: New file.
+
+	* config/Makefile.am:
+	((EXTRA_DIST) Added config/m68k/sysdepCallMethod.h.
+
+	* aclocal.m4,
+	config/Makefile.in:
+	Regenerated.
+
+	* config/m68k/common.h:
+	(sysdepCallMethod) Moved into its own file,
+        config/m68k/sysdepCallMethod.h.
+	(sysdepCallMethod)[USE_ASM] Deleted.
+
+	* config/m68k/a-ux/md.h,
+	config/m68k/amigaos/md.h,
+	config/m68k/netbsd1/md.h,
+	config/m68k/nextstep3/md.h,
+	config/m68k/openbsd2/md.h,
+	config/m68k/sunos4/md.h:
+	Include config/m68k/sysdepCallMethod.h.
+	
+	* config/m68k/linux/md.h:
+	(sysdepCallMethod) Converted macro to inline function.
+
 2003-12-12  Ito Kazumitsu  <kaz@maczuka.gcd.org>
 
 	* libraries/javalib/kaffe/io/CharToByteEUC_JP.java,
Index: kaffe/aclocal.m4
diff -u kaffe/aclocal.m4:1.79 kaffe/aclocal.m4:1.80
--- kaffe/aclocal.m4:1.79	Thu Dec 11 17:56:18 2003
+++ kaffe/aclocal.m4	Fri Dec 12 15:58:49 2003
@@ -8723,7 +8723,7 @@
 AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])
 
 # ----------------------------------------------------------------------------
-# $Id: aclocal.m4,v 1.79 2003/12/11 17:56:18 dalibor Exp $
+# $Id: aclocal.m4,v 1.80 2003/12/12 15:58:49 dalibor Exp $
 #
 # Copyright (C) 2003 Free Software Foundation, Inc.
 #
@@ -8767,7 +8767,7 @@
 #
 # GNU Crypto m4 macro for use by VM Providers
 #
-# $Revision: 1.79 $
+# $Revision: 1.80 $
 #
 
 # process --with-gnu-crypto configure option.
Index: kaffe/config/Makefile.am
diff -u kaffe/config/Makefile.am:1.30 kaffe/config/Makefile.am:1.31
--- kaffe/config/Makefile.am:1.30	Thu Dec 11 17:56:20 2003
+++ kaffe/config/Makefile.am	Fri Dec 12 15:58:50 2003
@@ -210,6 +210,7 @@
 	m68k/sunos4/config.frag \
 	m68k/sunos4/md.c \
 	m68k/sunos4/md.h \
+	m68k/sysdepCallMethod.h \
 	m68k/threads.h \
 	m68k/trampolines.c \
 	mips/common.h \
Index: kaffe/config/Makefile.in
diff -u kaffe/config/Makefile.in:1.97 kaffe/config/Makefile.in:1.98
--- kaffe/config/Makefile.in:1.97	Thu Dec 11 17:56:20 2003
+++ kaffe/config/Makefile.in	Fri Dec 12 15:58:50 2003
@@ -452,6 +452,7 @@
 	m68k/sunos4/config.frag \
 	m68k/sunos4/md.c \
 	m68k/sunos4/md.h \
+	m68k/sysdepCallMethod.h \
 	m68k/threads.h \
 	m68k/trampolines.c \
 	mips/common.h \
Index: kaffe/config/m68k/common.h
diff -u kaffe/config/m68k/common.h:1.13 kaffe/config/m68k/common.h:1.14
--- kaffe/config/m68k/common.h:1.13	Thu Dec 11 12:14:45 2003
+++ kaffe/config/m68k/common.h	Fri Dec 12 15:58:51 2003
@@ -26,147 +26,10 @@
 
 #include "atomicity.h"
 
-#include "support.h"
-
 /*
  * Alignment in structure is 2 bytes packed.
  */
 #define ALIGNMENT_OF_SIZE(S)    (((S>1)?2:1))
-
-/*
- * sysdepCallMethod supports:
- *
- *	Calling sequences for linux and netbsd1 are same, except for
- *	the place of return values. The float/double values are in
- *	fp0 (linux) or d0/d1 (netbsd1).
- *
- *	Still I do not understand 'asm' statement well, and the
- *	statement below is a 'because it works' version.
- */
-#if defined(__linux__)		// try forcing linux sysdepCallMethod()
-#ifdef	USE_ASM		/* Old and obsolete... */
-static inline void sysdepCallMethod(callMethodInfo *call)
-{
-
-	asm volatile (" \n"
-		      "       1: \n"
-		      "               cmp.l   #0,%0 \n"
-		      "               beq     3f \n"
-		      "               subq.l  #1,%0 \n"
-		      "               cmp.b   #0,(%2,%0.l) \n"
-		      "               beq     1b \n"
-		      "               cmp.b   #1,(%2,%0.l) \n"
-		      "               beq     2f \n"
-		      "               move.l  4(%1,%0.l*8),-(%/sp) \n"
-		      "       2: \n"
-		      "               move.l  (%1,%0.l*8),-(%/sp) \n"
-		      "               jmp     1b \n"
-		      "       3: \n"
-		      "               jsr     (%3) \n"
-		      "               cmp.b   #0x46,%4 \n"
-		      "               bne     4f \n"
-		      "               fmove.s %/fp0,(%5) \n"
-		      "               jmp     6f \n"
-		      "       4: \n"
-		      "               cmp.b   #0x44,%4 \n"
-		      "               bne     5f \n"
-		      "               fmove.d %/fp0,(%5) \n"
-		      "               jmp     6f \n"
-		      "       5: \n"
-		      "               move.l  %/d0,(%5) \n"
-		      "               cmp.b   #0x4a,%4 \n"
-		      "               bne     6f \n"
-		      "               move.l  %/d1,4(%5) \n"
-		      "       6: \n"
-		      "       " :
-		      : "r" ((call)->nrargs),
-		      "a" ((call)->args),
-		      "a" ((call)->callsize),
-		      "a" ((call)->function),
-		      "m" ((call)->rettype),
-		      "a" ((call)->ret)
-		      : "d0", "d1", "fp0", "cc", "memory");
-	asm volatile (" \n"
-		      "               add.w %0,%/sp \n"
-		      "        " : 
-		      : "r" ((call)->argsize * sizeof(jint)) 
-		      : "cc");
-}
-		       
-#else	/* undef USE_ASM */
-//	Linux version
-static inline void sysdepCallMethod(callMethodInfo *call)
-{
-	int extraargs[(call)->nrargs];
-	register int d0 asm ("d0");
-	register int d1 asm ("d1");
-	register double f0d asm ("fp0");
-	register float f0f asm ("fp0");
-	int *res;
-	int *args = extraargs;
-	int argidx;
-	for(argidx = 0; argidx < (call)->nrargs; ++argidx) {
-		if ((call)->callsize[argidx])
-			*args++ = (call)->args[argidx].i;
-		else
-			*args++ = (call)->args[argidx-1].j;
-	}
-	asm volatile ("jsr	%2@\n"
-		      : "=r" (d0), "=r" (d1)
-		      : "a" ((call)->function)
-		      : "cc", "memory");
-	if ((call)->retsize != 0) {
-		res = (int *)(call)->ret;
-	switch((call)->retsize) {
-	case 2:
-	  if ((call)->rettype == 'D')
-	    *(double*)res = f0d;
-	  else {
-		res[1] = d1;
-		res[0] = d0;
-	  }
-	  break;
-	case 1:
-	  if ((call)->rettype == 'F')
-	    *(double*)res = f0f;
-	  else
-		res[0] = d0;
-	  break;
-	}
-	}
-}
-#endif	/* USE_ASM */
-#else	/* not defined(__linux__) */
-
-static inline void sysdepCallMethod(callMethodInfo *call) 
-{
-	int extraargs[(call)->nrargs];
-	register int d0 asm ("d0");
-	register int d1 asm ("d1");
-	int *res;
-	int *args = extraargs;
-	int argidx;
-	for(argidx = 0; argidx < (call)->nrargs; ++argidx)
-	{
-		if ((call)->callsize[argidx])
-			*args++ = (call)->args[argidx].i;
-		else
-			*args++ = (call)->args[argidx-1].j;
-	}
-	asm volatile ("jsr	%2@\n"
-	 : "=r" (d0), "=r" (d1)
-	 : "a" ((call)->function)
-	 : "cc", "memory");
-	if ((call)->retsize >= 1 )
-	{
-		res = (int *)(call)->ret;
-		res[0] = d0;
-  		if((call)->retsize > 1)	/* >= 2 */
-			res[1] = d1;
-	}
-}
-
-#endif	/* defined(__linux__) */
 
 /*
  * Do an atomic compare and exchange.  The address 'A' is checked against
===================================================================
Checking out kaffe/config/m68k/sysdepCallMethod.h
RCS:  /home/cvs/kaffe/kaffe/config/m68k/sysdepCallMethod.h,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/config/m68k/sysdepCallMethod.h	Fri Dec 12 16:01:34 2003
@@ -0,0 +1,67 @@
+/*
+ * m68k/common.h
+ * Common M68K configuration information.
+ *
+ * Copyright (c) 1996, 1997, 1998, 1999
+ *	Transvirtual Technologies, Inc.  All rights reserved.
+ *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
+ * See the file "license.terms" for information on usage and redistribution 
+ * of this file. 
+ *
+ * Written by Kiyo Inaba <k-inaba@mxb.mesh.ne.jp>, 1998;
+ * Based on the ports
+ *      by Remi Perrot <r_perrot@mail.club-internet.fr> to m68k/linux
+ * and
+ *      by Alexandre Oliva <oliva@dcc.unicamp.br> to sparc
+ *
+ * Modified by Kiyo Inaba <k-inaba@mxb.mesh.ne.jp>, 1999 to support
+ *	both linux and netbsd1.
+ */
+
+#ifndef __m68k_sysdepCallMethod_h
+#define __m68k_sysdepCallMethod_h
+
+#include "support.h"
+
+/*
+ * sysdepCallMethod supports:
+ *
+ *	Calling sequences for linux and netbsd1 are same, except for
+ *	the place of return values. The float/double values are in
+ *	fp0 (linux) or d0/d1 (netbsd1).
+ *
+ *	Still I do not understand 'asm' statement well, and the
+ *	statement below is a 'because it works' version.
+ */
+static inline void sysdepCallMethod(callMethodInfo *call) 
+{
+	int extraargs[(call)->nrargs];
+	register int d0 asm ("d0");
+	register int d1 asm ("d1");
+	int *res;
+	int *args = extraargs;
+	int argidx;
+	for(argidx = 0; argidx < (call)->nrargs; ++argidx)
+	{
+		if ((call)->callsize[argidx])
+			*args++ = (call)->args[argidx].i;
+		else
+			*args++ = (call)->args[argidx-1].j;
+	}
+	asm volatile ("jsr	%2@\n"
+	 : "=r" (d0), "=r" (d1)
+	 : "a" ((call)->function)
+	 : "cc", "memory");
+	if ((call)->retsize >= 1 )
+	{
+		res = (int *)(call)->ret;
+		res[0] = d0;
+  		if((call)->retsize > 1)	/* >= 2 */
+			res[1] = d1;
+	}
+}
+
+#endif /* __m68k_sysdepCallMethod_h */
Index: kaffe/config/m68k/a-ux/md.h
diff -u kaffe/config/m68k/a-ux/md.h:1.4 kaffe/config/m68k/a-ux/md.h:1.5
--- kaffe/config/m68k/a-ux/md.h:1.4	Wed Aug 27 09:35:07 2003
+++ kaffe/config/m68k/a-ux/md.h	Fri Dec 12 15:58:52 2003
@@ -13,6 +13,7 @@
 #define __m68k_netbsd_md_h
 
 #include "m68k/threads.h"
+#include "m68k/sysdepCallMethod.h"
 
 /*
  * Stack offset.
Index: kaffe/config/m68k/amigaos/md.h
diff -u kaffe/config/m68k/amigaos/md.h:1.3 kaffe/config/m68k/amigaos/md.h:1.4
--- kaffe/config/m68k/amigaos/md.h:1.3	Fri Mar  7 09:29:57 2003
+++ kaffe/config/m68k/amigaos/md.h	Fri Dec 12 15:58:52 2003
@@ -19,6 +19,7 @@
 
 #include "m68k/threads.h"
 #include "m68k/common.h"
+#include "m68k/sysdepCallMethod.h"
 
 /*	Define Stack Offset
 */
Index: kaffe/config/m68k/linux/md.h
diff -u kaffe/config/m68k/linux/md.h:1.5 kaffe/config/m68k/linux/md.h:1.6
--- kaffe/config/m68k/linux/md.h:1.5	Wed Aug 27 09:35:07 2003
+++ kaffe/config/m68k/linux/md.h	Fri Dec 12 15:58:53 2003
@@ -39,4 +39,57 @@
 extern void init_md(void);
 #define	INIT_MD()	init_md()
 
-#endif
+/*
+ * sysdepCallMethod supports:
+ *
+ *	Calling sequences for linux and netbsd1 are same, except for
+ *	the place of return values. The float/double values are in
+ *	fp0 (linux) or d0/d1 (netbsd1).
+ *
+ *	Still I do not understand 'asm' statement well, and the
+ *	statement below is a 'because it works' version.
+ */
+//	Linux version
+static inline void sysdepCallMethod(callMethodInfo *call)
+{
+	int extraargs[(call)->nrargs];
+	register int d0 asm ("d0");
+	register int d1 asm ("d1");
+	register double f0d asm ("fp0");
+	register float f0f asm ("fp0");
+	int *res;
+	int *args = extraargs;
+	int argidx;
+	for(argidx = 0; argidx < (call)->nrargs; ++argidx) {
+		if ((call)->callsize[argidx])
+			*args++ = (call)->args[argidx].i;
+		else
+			*args++ = (call)->args[argidx-1].j;
+	}
+	asm volatile ("jsr	%2@\n"
+		      : "=r" (d0), "=r" (d1)
+		      : "a" ((call)->function)
+		      : "cc", "memory");
+	if ((call)->retsize != 0) {
+		res = (int *)(call)->ret;
+	switch((call)->retsize) {
+	case 2:
+	  if ((call)->rettype == 'D')
+	    *(double*)res = f0d;
+	  else {
+		res[1] = d1;
+		res[0] = d0;
+	  }
+	  break;
+	case 1:
+	  if ((call)->rettype == 'F')
+	    *(double*)res = f0f;
+	  else
+		res[0] = d0;
+	  break;
+	}
+	}
+}
+
+#endif /* __m68k_linux_md_h */
+
Index: kaffe/config/m68k/netbsd1/md.h
diff -u kaffe/config/m68k/netbsd1/md.h:1.5 kaffe/config/m68k/netbsd1/md.h:1.6
--- kaffe/config/m68k/netbsd1/md.h:1.5	Wed Aug 27 09:35:08 2003
+++ kaffe/config/m68k/netbsd1/md.h	Fri Dec 12 15:58:53 2003
@@ -16,6 +16,7 @@
 
 #include "m68k/common.h"
 #include "m68k/threads.h"
+#include "m68k/sysdepCallMethod.h"
 
 /*
  * Redefine stack pointer offset.
Index: kaffe/config/m68k/nextstep3/md.h
diff -u kaffe/config/m68k/nextstep3/md.h:1.2 kaffe/config/m68k/nextstep3/md.h:1.3
--- kaffe/config/m68k/nextstep3/md.h:1.2	Wed Apr  2 08:03:28 2003
+++ kaffe/config/m68k/nextstep3/md.h	Fri Dec 12 15:58:53 2003
@@ -18,6 +18,7 @@
 #define __m68k_nextstep3_md_h
 
 #include "m68k/threads.h"
+#include "m68k/sysdepCallMethod.h"
 
 /*
  * Stack offset.
Index: kaffe/config/m68k/openbsd2/md.h
diff -u kaffe/config/m68k/openbsd2/md.h:1.3 kaffe/config/m68k/openbsd2/md.h:1.4
--- kaffe/config/m68k/openbsd2/md.h:1.3	Wed Aug 27 09:35:08 2003
+++ kaffe/config/m68k/openbsd2/md.h	Fri Dec 12 15:58:54 2003
@@ -19,6 +19,7 @@
 #define __m68k_openbsd_md_h
 
 #include "m68k/threads.h"
+#include "m68k/sysdepCallMethod.h"
 
 /*
  * Stack offset.
Index: kaffe/config/m68k/sunos4/md.h
diff -u kaffe/config/m68k/sunos4/md.h:1.3 kaffe/config/m68k/sunos4/md.h:1.4
--- kaffe/config/m68k/sunos4/md.h:1.3	Thu Aug 20 00:50:18 1998
+++ kaffe/config/m68k/sunos4/md.h	Fri Dec 12 15:58:54 2003
@@ -16,6 +16,7 @@
 
 #include "m68k/common.h"
 #include "m68k/threads.h"
+#include "m68k/sysdepCallMethod.h"
 
 /*
  * Redefine stack pointer offset.