[kaffe] CVS kaffe (dalibor): Cleaned up sysdepCallMethod support for mips

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Sat Dec 13 11:34:02 2003


PatchSet 4223 
Date: 2003/12/13 19:31:25
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Cleaned up sysdepCallMethod support for mips

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

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

        * config/mips/common.h: Moved sysdepCallMethod selection
        into config/mips/sysdepCallMethod.h.

        * config/mips/irix5/md.h,
        config/mips/linux/md.h,
        config/mips/ultrix4/md.h:
        Include config/mips/sysdepCallMethod.h.

        * config/mips/netbsd1/md.c:
        (mips32CallMethod) Renamed to sysdepCallMethod.

        * config/mips/netbsd1/md.h:
        Declared sysdepCallMethod.

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

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

Members: 
	ChangeLog:1.1812->1.1813 
	aclocal.m4:1.81->1.82 
	config/Makefile.am:1.32->1.33 
	config/Makefile.in:1.99->1.100 
	config/mips/common.h:1.8->1.9 
	config/mips/sysdepCallMethod.h:INITIAL->1.1 
	config/mips/irix5/md.h:1.3->1.4 
	config/mips/linux/md.h:1.5->1.6 
	config/mips/netbsd1/md.c:1.4->1.5 
	config/mips/netbsd1/md.h:1.3->1.4 
	config/mips/ultrix4/md.h:1.1->1.2 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1812 kaffe/ChangeLog:1.1813
--- kaffe/ChangeLog:1.1812	Sat Dec 13 18:03:52 2003
+++ kaffe/ChangeLog	Sat Dec 13 19:31:25 2003
@@ -1,3 +1,28 @@
+2003-12-13  Dalibor Topic <robilad@kaffe.org>
+
+	* config/mips/sysdepCallMethod.h: New file.
+
+	* config/mips/common.h: Moved sysdepCallMethod selection
+	into config/mips/sysdepCallMethod.h.
+
+	* config/mips/irix5/md.h,
+	config/mips/linux/md.h,
+	config/mips/ultrix4/md.h:
+	Include config/mips/sysdepCallMethod.h.
+
+	* config/mips/netbsd1/md.c:
+	(mips32CallMethod) Renamed to sysdepCallMethod.
+
+	* config/mips/netbsd1/md.h:
+	Declared sysdepCallMethod.
+
+	* config/Makefile.am
+	(EXTRA_DIST): Added config/mips/sysdepCallMethod.h.
+
+	* aclocal.m4,
+	config/Makefile.in:
+	Regenerated.
+
 2003-12-12  Atsushi Nemoto  <anemo@mba.ocn.ne.jp>
 
 	Fixed build on mipsel-linux for jit3.
Index: kaffe/aclocal.m4
diff -u kaffe/aclocal.m4:1.81 kaffe/aclocal.m4:1.82
--- kaffe/aclocal.m4:1.81	Fri Dec 12 17:27:49 2003
+++ kaffe/aclocal.m4	Sat Dec 13 19:31:26 2003
@@ -8723,7 +8723,7 @@
 AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])
 
 # ----------------------------------------------------------------------------
-# $Id: aclocal.m4,v 1.81 2003/12/12 17:27:49 dalibor Exp $
+# $Id: aclocal.m4,v 1.82 2003/12/13 19:31:26 dalibor Exp $
 #
 # Copyright (C) 2003 Free Software Foundation, Inc.
 #
@@ -8767,7 +8767,7 @@
 #
 # GNU Crypto m4 macro for use by VM Providers
 #
-# $Revision: 1.81 $
+# $Revision: 1.82 $
 #
 
 # process --with-gnu-crypto configure option.
Index: kaffe/config/Makefile.am
diff -u kaffe/config/Makefile.am:1.32 kaffe/config/Makefile.am:1.33
--- kaffe/config/Makefile.am:1.32	Fri Dec 12 17:27:51 2003
+++ kaffe/config/Makefile.am	Sat Dec 13 19:31:27 2003
@@ -233,6 +233,7 @@
 	mips/netbsd1/md.c \
 	mips/netbsd1/md.h \
 	mips/o32-sysdepCallMethod.h \
+	mips/sysdepCallMethod.h \
 	mips/threads.h \
 	mips/trampolines.c \
 	mips/ultrix4/Make.frag \
Index: kaffe/config/Makefile.in
diff -u kaffe/config/Makefile.in:1.99 kaffe/config/Makefile.in:1.100
--- kaffe/config/Makefile.in:1.99	Fri Dec 12 17:27:51 2003
+++ kaffe/config/Makefile.in	Sat Dec 13 19:31:27 2003
@@ -475,6 +475,7 @@
 	mips/netbsd1/md.c \
 	mips/netbsd1/md.h \
 	mips/o32-sysdepCallMethod.h \
+	mips/sysdepCallMethod.h \
 	mips/threads.h \
 	mips/trampolines.c \
 	mips/ultrix4/Make.frag \
Index: kaffe/config/mips/common.h
diff -u kaffe/config/mips/common.h:1.8 kaffe/config/mips/common.h:1.9
--- kaffe/config/mips/common.h:1.8	Mon Jan  6 17:14:18 2003
+++ kaffe/config/mips/common.h	Sat Dec 13 19:31:28 2003
@@ -5,6 +5,9 @@
  * 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. 
  *
@@ -26,31 +29,6 @@
 #define PS2LINUX
 #undef HAVE_MIPSII_INSTRUCTIONS
 #endif 
-
-#if NEED_sysdepCallMethod
-
-#if !defined (_MIPS_SIM) || (_MIPS_SIM == _MIPS_SIM_ABI32)
-
-#define LONG_SYSDEP 1
-#include "o32-sysdepCallMethod.h"
-#undef LONG_SYSDEP
-#include "o32-sysdepCallMethod.h"
-
-#elif (_MIPS_SIM == _MIPS_SIM_NABI32)
-
-#define LONG_SYSDEP 1
-#include "n32-sysdepCallMethod.h"
-#undef LONG_SYSDEP
-#include "n32-sysdepCallMethod.h"
-
-#else
-
-#error "Calling convention not specified"
-
-#endif
-
-#endif /* NEED_sysdepCallMethod */
-
 
 #if defined(HAVE_MIPSII_INSTRUCTIONS)
 /*
===================================================================
Checking out kaffe/config/mips/sysdepCallMethod.h
RCS:  /home/cvs/kaffe/kaffe/config/mips/sysdepCallMethod.h,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/config/mips/sysdepCallMethod.h	Sat Dec 13 19:33:23 2003
@@ -0,0 +1,47 @@
+/*
+ * mips/sysdepCallMethod.h
+ * Common MIPS 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. 
+ *
+ * by Alexandre Oliva <oliva@dcc.unicamp.br>
+ * and Edouard G. Parmelan <egp@free.fr>
+ */
+
+#ifndef __mips_sysdepCallMethod_h
+#define __mips_sysdepCallMethod_h
+
+#if NEED_sysdepCallMethod
+
+#include "support.h"
+
+#if !defined (_MIPS_SIM) || (_MIPS_SIM == _MIPS_SIM_ABI32)
+
+#define LONG_SYSDEP 1
+#include "o32-sysdepCallMethod.h"
+#undef LONG_SYSDEP
+#include "o32-sysdepCallMethod.h"
+
+#elif (_MIPS_SIM == _MIPS_SIM_NABI32)
+
+#define LONG_SYSDEP 1
+#include "n32-sysdepCallMethod.h"
+#undef LONG_SYSDEP
+#include "n32-sysdepCallMethod.h"
+
+#else
+
+#error "Calling convention not specified"
+
+#endif
+
+#endif /* NEED_sysdepCallMethod */
+
+#endif /* __mips_sysdepCallMethod_h */
Index: kaffe/config/mips/irix5/md.h
diff -u kaffe/config/mips/irix5/md.h:1.3 kaffe/config/mips/irix5/md.h:1.4
--- kaffe/config/mips/irix5/md.h:1.3	Tue Aug 25 20:52:53 1998
+++ kaffe/config/mips/irix5/md.h	Sat Dec 13 19:31:28 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	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. 
  */
@@ -12,7 +15,9 @@
 #ifndef __mips_irix5_md_h
 #define __mips_irix5_md_h
 
-#include "mips/threads.h"
 #include "mips/common.h"
+#include "mips/sysdepCallMethod.h"
+#include "mips/threads.h"
+
 
 #endif
Index: kaffe/config/mips/linux/md.h
diff -u kaffe/config/mips/linux/md.h:1.5 kaffe/config/mips/linux/md.h:1.6
--- kaffe/config/mips/linux/md.h:1.5	Sat Dec 13 18:03:53 2003
+++ kaffe/config/mips/linux/md.h	Sat Dec 13 19:31:28 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997, 1998
  *	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. 
  */
@@ -13,6 +16,7 @@
 #define __mips_linux_md_h
 
 #include "mips/common.h"
+#include "mips/sysdepCallMethod.h"
 #include "mips/threads.h"
 
 #undef	SP_OFFSET
Index: kaffe/config/mips/netbsd1/md.c
diff -u kaffe/config/mips/netbsd1/md.c:1.4 kaffe/config/mips/netbsd1/md.c:1.5
--- kaffe/config/mips/netbsd1/md.c:1.4	Thu Jul 31 22:46:42 2003
+++ kaffe/config/mips/netbsd1/md.c	Sat Dec 13 19:31:29 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	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.
  */
@@ -17,7 +20,7 @@
 #include "support.h"
 
 void
-mips32CallMethod (callMethodInfo *CALL)
+sysdepCallMethod(callMethodInfo *call)
 {
     register int	iret	__asm__("$2");
     register int64	jret	__asm__("$2");
@@ -38,22 +41,22 @@
     int* curr_ra = ra;
 
     {
-      int nrargs = CALL->nrargs;
+      int nrargs = call->nrargs;
       uintp *argframe = __builtin_alloca((nrargs > 4 ? nrargs : 4) * sizeof(int64));
       int argidx;
       int idx = 0;
 
       for (argidx = 0; argidx < nrargs; ++argidx) {
-	switch (CALL->callsize[argidx]) {
+	switch (call->callsize[argidx]) {
 	case 2:
 	  if ((idx & 1) != 0) {	/* Align */
 	    idx += 1;
 	  }
-	  *(jlong*)&argframe[idx] = CALL->args[argidx].j;
+	  *(jlong*)&argframe[idx] = call->args[argidx].j;
 	  idx += 2;
 	  break;
 	case 1:
-	  *(jint*)&argframe[idx] = CALL->args[argidx].i;
+	  *(jint*)&argframe[idx] = call->args[argidx].i;
 	  idx += 1;
 	  break;
 	default:
@@ -65,21 +68,21 @@
        * since sometime we need values in float registers, sometimes
        * in integers.
        */
-      if (CALL->callsize[0] == 1) {
+      if (call->callsize[0] == 1) {
 	asm volatile ("l.s $f12,%0" : : "m" (*(jfloat*)&argframe[0]));
-	if (CALL->callsize[1] == 1) {
+	if (call->callsize[1] == 1) {
 	  asm volatile ("l.s $f14,%0" : : "m" (*(jfloat*)&argframe[1]));
 	}
-	else if (CALL->callsize[1] == 2) {
+	else if (call->callsize[1] == 2) {
 	  asm volatile ("l.d $f14,%0" : : "m" (*(jdouble*)&argframe[2]));
 	}
       }
-      else if (CALL->callsize[0] == 2) {
+      else if (call->callsize[0] == 2) {
 	asm volatile ("l.d $f12,%0" : : "m" (*(jdouble*)&argframe[0]));
-	if (CALL->callsize[2] == 1) {
+	if (call->callsize[2] == 1) {
 	  asm volatile ("l.s $f14,%0" : : "m" (*(jfloat*)&argframe[2]));
 	}
-	else if (CALL->callsize[2] == 2) {
+	else if (call->callsize[2] == 2) {
 	  asm volatile ("l.d $f14,%0" : : "m" (*(jdouble*)&argframe[2]));
 	}
       }
@@ -92,26 +95,26 @@
 
       asm ("" : : "r" (i0), "r" (i1), "r" (i2), "r" (i3));
 
-      (*(t9 = CALL->function))();
+      (*(t9 = call->function))();
 
       asm ("lw $31,%0" : : "m" (curr_ra));
       asm ("lw $gp,%0" : : "m" (curr_gp));
       asm ("lw $sp,%0" : : "m" (curr_sp));
 
-      if (CALL->retsize != 0) {
-	switch(CALL->retsize) {
+      if (call->retsize != 0) {
+	switch(call->retsize) {
 	case 2:
-	  if (CALL->rettype == 'D')
-	    CALL->ret->d = dret;
+	  if (call->rettype == 'D')
+	    call->ret->d = dret;
 	  else {
-	    CALL->ret->j = jret;
+	    call->ret->j = jret;
 	  }
 	  break;
 	case 1:
-	  if (CALL->rettype == 'F')
-	    CALL->ret->f = fret;
+	  if (call->rettype == 'F')
+	    call->ret->f = fret;
 	  else
-	    CALL->ret->i = iret;
+	    call->ret->i = iret;
 	  break;
 	default:
 	  ABORT();
Index: kaffe/config/mips/netbsd1/md.h
diff -u kaffe/config/mips/netbsd1/md.h:1.3 kaffe/config/mips/netbsd1/md.h:1.4
--- kaffe/config/mips/netbsd1/md.h:1.3	Sun Jun 17 16:39:55 2001
+++ kaffe/config/mips/netbsd1/md.h	Sat Dec 13 19:31:29 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	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.
  */
@@ -28,10 +31,9 @@
 
 /*
  * System dependent call method routine definition.
- * We use 'mips32CallMethod' (defined in mips.c) for NetBSD/mips.
+ * We use 'sysdepCallMethod' (defined in md.c) for NetBSD/mips.
  */
-#undef sysdepCallMethod
-#define sysdepCallMethod(CALL) mips32CallMethod(CALL)
+extern void sysdepCallMethod(callMethodInfo *call);
 
 #if defined(TRANSLATOR)
 #include "jit-md.h"
Index: kaffe/config/mips/ultrix4/md.h
diff -u kaffe/config/mips/ultrix4/md.h:1.1 kaffe/config/mips/ultrix4/md.h:1.2
--- kaffe/config/mips/ultrix4/md.h:1.1	Fri Oct 23 18:56:19 1998
+++ kaffe/config/mips/ultrix4/md.h	Sat Dec 13 19:31:29 2003
@@ -5,12 +5,17 @@
  * Copyright (c) 1996, 1997, 1998
  *	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. 
  */
 
 #ifndef __mips_ultrix4_md_h
 #define __mips_ultrix4_md_h
+
+#include "mips/sysdepCallMethod.h"
 
 /**/
 /* Thread handling */