[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git] / ghc / runtime / c-as-asm / CallWrap_C.lc
index 66591d1..96892ba 100644 (file)
@@ -44,6 +44,8 @@ callWrapper(STG_NO_ARGS)
     CALLER_SAVE_FltReg4
     CALLER_SAVE_DblReg1
     CALLER_SAVE_DblReg2
+    CALLER_SAVE_LngReg1
+    CALLER_SAVE_LngReg2
     CALLER_SAVE_Tag
     CALLER_SAVE_SpA
     CALLER_SAVE_SuA
@@ -73,6 +75,8 @@ callWrapper(STG_NO_ARGS)
     CALLER_RESTORE_FltReg4
     CALLER_RESTORE_DblReg1
     CALLER_RESTORE_DblReg2
+    CALLER_RESTORE_LngReg1
+    CALLER_RESTORE_LngReg2
     CALLER_RESTORE_Tag
     CALLER_RESTORE_SpA
     CALLER_RESTORE_SuA
@@ -207,10 +211,7 @@ W_ args;
     WRAPPER_RETURN(0)
 }
 
-# endif
-
-# ifdef GRAN
-
+#if defined(GRAN)
 void PerformReschedule_wrapper PROTO((W_, W_))     WRAPPER_NAME(PerformReschedule);
 void PerformReschedule_wrapper(liveness, always_reenter_node)
   W_ liveness;
@@ -226,8 +227,74 @@ void PerformReschedule_wrapper(liveness, always_reenter_node)
     WRAPPER_RETURN(0)
 }
 
+/* Similar wrappers for all GrAnSim functions. */
+/* NB: These are normal functions, which don't call ReSchedule. So we just */
+/* have to safe/restore the registers. */
+
+void GranSimAllocate_wrapper PROTO((I_, P_, W_))  WRAPPER_NAME(GranSimAllocate);
+void GranSimAllocate_wrapper(n, node, liveness)
+I_ n;
+P_ node;
+W_ liveness;
+{
+#if i386_TARGET_ARCH
+    void *ret_addr, *ignore_me;
+    WRAPPER_SETUP(GranSimAllocate, ret_addr, ignore_me)
+#else
+    WRAPPER_SETUP(GranSimAllocate, ignore_me, ignore_me)
+#endif
+    GranSimAllocate(n, node, liveness);
+    WRAPPER_RETURN(0);
+}
+
+void GranSimUnallocate_wrapper PROTO((I_, P_, W_))  WRAPPER_NAME(GranSimUnallocate);
+void GranSimUnallocate_wrapper(n, node, liveness)
+I_ n;
+P_ node;
+W_ liveness;
+{
+#if i386_TARGET_ARCH
+    void *ret_addr, *ignore_me;
+    WRAPPER_SETUP(GranSimUnallocate, ret_addr, ignore_me)
+#else
+    WRAPPER_SETUP(GranSimUnallocate, ignore_me, ignore_me)
+#endif
+  GranSimUnallocate(n, node, liveness);
+  WRAPPER_RETURN(0);
+}
+
+void GranSimFetch_wrapper PROTO((P_))  WRAPPER_NAME(GranSimFetch);
+void GranSimFetch_wrapper(node)
+P_ node;
+{
+#if i386_TARGET_ARCH
+    void *ret_addr, *ignore_me;
+    WRAPPER_SETUP(GranSimFetch, ret_addr, ignore_me)
+#else
+    WRAPPER_SETUP(GranSimFetch, ignore_me, ignore_me)
+#endif
+    GranSimFetch(node);
+    WRAPPER_RETURN(0);
+}
+
+void GranSimExec_wrapper PROTO((W_, W_, W_, W_, W_))  WRAPPER_NAME(GranSimExec);
+void GranSimExec_wrapper(arith,branch,load,store,floats)
+W_ arith,branch,load,store,floats;
+{
+#if i386_TARGET_ARCH
+    void *ret_addr, *ignore_me;
+    WRAPPER_SETUP(GranSimExec, ret_addr, ignore_me)
+#else
+    WRAPPER_SETUP(GranSimExec, ignore_me, ignore_me)
+#endif
+    GranSimExec(arith,branch,load,store,floats);       
+    WRAPPER_RETURN(0);
+}
+
 # endif /* GRAN */
 
+# endif /* CONCURRENT */
+
 /* 
  * In the threaded world, context switches may occur during one of these
  * wrapped calls, and when we come back, our stack will have been trashed.
@@ -254,14 +321,3 @@ checkInCCallGC()
 }
 \end{code}
 
-Hack for -UGRAN setup. % HWL
-
-\begin{code}
-#ifndef GRAN
-void PerformReschedule_wrapper PROTO((W_, W_));
-void PerformReschedule_wrapper(liveness, always_reenter_node)
-  W_ liveness;
-  W_  always_reenter_node;
-{ }
-#endif
-\end{code}