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

Kaffe CVS cvs-commits at kaffe.org
Sun Dec 14 08:34:02 PST 2003


PatchSet 4226 
Date: 2003/12/14 16:31:36
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Cleaned up sysdepCallMethod for superh

2003-12-14  Dalibor Topic <robilad at kaffe.org>

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

        * config/superh/common.h: Moved sysdepCallMethod
        into config/superh/sysdepCallMethod.h.

        * config/superh/linux/md.h:
        Include config/superh/sysdepCallMethod.h.

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

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

Members: 
	ChangeLog:1.1815->1.1816 
	aclocal.m4:1.83->1.84 
	config/Makefile.am:1.34->1.35 
	config/Makefile.in:1.101->1.102 
	config/superh/common.h:1.1->1.2 
	config/superh/sysdepCallMethod.h:INITIAL->1.1 
	config/superh/linux/md.h:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1815 kaffe/ChangeLog:1.1816
--- kaffe/ChangeLog:1.1815	Sun Dec 14 09:26:54 2003
+++ kaffe/ChangeLog	Sun Dec 14 16:31:36 2003
@@ -1,3 +1,20 @@
+2003-12-14  Dalibor Topic <robilad at kaffe.org>
+
+	* config/superh/sysdepCallMethod.h: New file.
+
+	* config/superh/common.h: Moved sysdepCallMethod
+	into config/superh/sysdepCallMethod.h.
+
+	* config/superh/linux/md.h:
+	Include config/superh/sysdepCallMethod.h.
+
+	* config/Makefile.am
+	(EXTRA_DIST): Added config/superh/sysdepCallMethod.h.
+
+	* aclocal.m4,
+	config/Makefile.in:
+	Regenerated.
+
 2003-12-14  Guilhem Lavaux <guilhem at kaffe.org>,
 	Everton da Silva Marques <everton at lab.ipaccess.diveo.net.br>
 
Index: kaffe/aclocal.m4
diff -u kaffe/aclocal.m4:1.83 kaffe/aclocal.m4:1.84
--- kaffe/aclocal.m4:1.83	Sat Dec 13 20:01:53 2003
+++ kaffe/aclocal.m4	Sun Dec 14 16:31:37 2003
@@ -8723,7 +8723,7 @@
 AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])
 
 # ----------------------------------------------------------------------------
-# $Id: aclocal.m4,v 1.83 2003/12/13 20:01:53 dalibor Exp $
+# $Id: aclocal.m4,v 1.84 2003/12/14 16:31:37 dalibor Exp $
 #
 # Copyright (C) 2003 Free Software Foundation, Inc.
 #
@@ -8767,7 +8767,7 @@
 #
 # GNU Crypto m4 macro for use by VM Providers
 #
-# $Revision: 1.83 $
+# $Revision: 1.84 $
 #
 
 # process --with-gnu-crypto configure option.
Index: kaffe/config/Makefile.am
diff -u kaffe/config/Makefile.am:1.34 kaffe/config/Makefile.am:1.35
--- kaffe/config/Makefile.am:1.34	Sat Dec 13 20:01:53 2003
+++ kaffe/config/Makefile.am	Sun Dec 14 16:31:39 2003
@@ -314,6 +314,7 @@
         superh/linux/config.frag \
         superh/linux/md.c \
         superh/linux/md.h \
+	superh/sysdepCallMethod.h \
         superh/threads.h \
         superh/trampolines.c
 
Index: kaffe/config/Makefile.in
diff -u kaffe/config/Makefile.in:1.101 kaffe/config/Makefile.in:1.102
--- kaffe/config/Makefile.in:1.101	Sat Dec 13 20:01:53 2003
+++ kaffe/config/Makefile.in	Sun Dec 14 16:31:39 2003
@@ -556,6 +556,7 @@
         superh/linux/config.frag \
         superh/linux/md.c \
         superh/linux/md.h \
+	superh/sysdepCallMethod.h \
         superh/threads.h \
         superh/trampolines.c
 
Index: kaffe/config/superh/common.h
diff -u kaffe/config/superh/common.h:1.1 kaffe/config/superh/common.h:1.2
--- kaffe/config/superh/common.h:1.1	Fri Jul  5 22:22:24 2002
+++ kaffe/config/superh/common.h	Sun Dec 14 16:31:39 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 2001
  *	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,69 +16,6 @@
 #define __superh_common_h
 
 #include <stddef.h>
-
-#define	sysdepCallMethod(CALL) do {				\
-  int extraargs[((CALL)->nrargs>4)?((CALL)->nrargs-4):0];		\
-  switch((CALL)->nrargs) {						\
-    register int r0 asm("r4");						\
-    register int r1 asm("r5");						\
-    register int r2 asm("r6");						\
-    register int r3 asm("r7");						\
-  default:								\
-    {									\
-      int *args = extraargs;						\
-      int argidx = 4; 							\
-      if ((CALL)->callsize[3] == 2) args++;				\
-      for(; argidx < (CALL)->nrargs; ++argidx) {			\
-	if ((CALL)->callsize[argidx]) { 				\
-	  *args++ = (CALL)->args[argidx].i;				\
-	  if ((CALL)->callsize[argidx] == 2) 				\
-	    *args++ = ((CALL)->args[argidx].j) >> 32;			\
-	} 								\
-      }								\
-    }									\
-  case 4:								\
-    if ((CALL)->callsize[3]) {						\
-      r3 = (CALL)->args[3].i;						\
-      if ((CALL)->callsize[3] == 2)					\
-        *extraargs = ((CALL)->args[3].j) >> 32; 			\
-    }									\
-  case 3:								\
-    if ((CALL)->callsize[2]) {						\
-      r2 = (CALL)->args[2].i;						\
-      if ((CALL)->callsize[2] == 2)					\
-        r3 = ((CALL)->args[2].j) >> 32; 				\
-    }									\
-  case 2:								\
-    if ((CALL)->callsize[1]) {						\
-      r1 = (CALL)->args[1].i;						\
-      if ((CALL)->callsize[1] == 2)					\
-        r2 = ((CALL)->args[1].j) >> 32; 				\
-    }									\
-  case 1:								\
-    if ((CALL)->callsize[0]) {						\
-      r0 = (CALL)->args[0].i;						\
-      if ((CALL)->callsize[0] == 2)					\
-        r1 = ((CALL)->args[0].j) >> 32; 				\
-    }									\
-  case 0:								\
-    asm volatile ("jsr @%2 ; nop ; mov r0,r4 ; mov r1,r5\n"		\
-        : "=r" (r0), "=r" (r1)						\
-	: "r" ((CALL)->function),					\
-	  "0" (r0), "1" (r1), "r" (r2), "r" (r3) 			\
-	: "r14"				 				\
-	);								\
-    switch((CALL)->rettype) {                                          \
-    case 'D':                                                          \
-    case 'J':                                                          \
-        (&(CALL)->ret->i)[1] = r1;                                     \
-        /* follow through */                                           \
-    default:                                                           \
-        (CALL)->ret->i = r0;                                           \
-    }                                                                  \
-    break;								\
-  }									\
-} while (0)
 
 /*
  * Do an atomic compare and exchange.  The address 'A' is checked against
===================================================================
Checking out kaffe/config/superh/sysdepCallMethod.h
RCS:  /home/cvs/kaffe/kaffe/config/superh/sysdepCallMethod.h,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/config/superh/sysdepCallMethod.h	Sun Dec 14 16:33:40 2003
@@ -0,0 +1,84 @@
+/*
+ * superh/sysdepCallMethod.h
+ * Common sysdepCallMethod for Super-H.
+ *
+ * Copyright (c) 2001
+ *	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 __superh_sysdepCallMethod_h
+#define __superh_sysdepCallMethod_h
+
+#include "support.h"
+
+static inline void sysdepCallMethod(callMethodInfo *call)
+{
+  int extraargs[((call)->nrargs>4)?((call)->nrargs-4):0];
+  switch((call)->nrargs) {
+    register int r0 asm("r4");
+    register int r1 asm("r5");
+    register int r2 asm("r6");
+    register int r3 asm("r7");
+  default:
+    {
+      int *args = extraargs;
+      int argidx = 4;
+      if ((call)->callsize[3] == 2) args++;
+      for(; argidx < (call)->nrargs; ++argidx) {
+	if ((call)->callsize[argidx]) {
+	  *args++ = (call)->args[argidx].i;
+	  if ((call)->callsize[argidx] == 2)
+	    *args++ = ((call)->args[argidx].j) >> 32;
+	}
+      }
+    }
+  case 4:
+    if ((call)->callsize[3]) {
+      r3 = (call)->args[3].i;
+      if ((call)->callsize[3] == 2)
+        *extraargs = ((call)->args[3].j) >> 32;
+    }
+  case 3:
+    if ((call)->callsize[2]) {
+      r2 = (call)->args[2].i;
+      if ((call)->callsize[2] == 2)
+        r3 = ((call)->args[2].j) >> 32;
+    }
+  case 2:
+    if ((call)->callsize[1]) {
+      r1 = (call)->args[1].i;
+      if ((call)->callsize[1] == 2)
+        r2 = ((call)->args[1].j) >> 32;
+    }
+  case 1:
+    if ((call)->callsize[0]) {
+      r0 = (call)->args[0].i;
+      if ((call)->callsize[0] == 2)
+        r1 = ((call)->args[0].j) >> 32;
+    }
+  case 0:
+    asm volatile ("jsr @%2 ; nop ; mov r0,r4 ; mov r1,r5\n"
+        : "=r" (r0), "=r" (r1)
+	: "r" ((call)->function),
+	  "0" (r0), "1" (r1), "r" (r2), "r" (r3)
+	: "r14"
+	);
+    switch((call)->rettype) {
+    case 'D':
+    case 'J':
+        (&(call)->ret->i)[1] = r1;
+        /* follow through */
+    default:
+        (call)->ret->i = r0;
+    }
+    break;
+  }
+}
+
+#endif /* __superh_sysdepCallMethod_h */
Index: kaffe/config/superh/linux/md.h
diff -u kaffe/config/superh/linux/md.h:1.2 kaffe/config/superh/linux/md.h:1.3
--- kaffe/config/superh/linux/md.h:1.2	Mon Oct  6 19:23:08 2003
+++ kaffe/config/superh/linux/md.h	Sun Dec 14 16:31:40 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 2001
  *      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,8 @@
 #ifndef __superh_linux_md_h
 #define __superh_linux_md_h
  
-#include "superh/common.h"
+#include "superh/common.h
+#include "superh/sysdepCallMethod.h"
 #include "superh/threads.h"
 
 #if defined(TRANSLATOR)




More information about the kaffe mailing list