[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git] / ghc / includes / StgRegs.lh
index ddeebf3..10f447e 100644 (file)
@@ -45,6 +45,20 @@ void SaveAllStgRegs(STG_NO_ARGS)
     /* CurrentRegTable = BaseReg; */
 # endif
 #endif
+/* Hack!!! slam the current C stack pointer into the reg. table
+   in the event that we need to copy a chunk of the C stack
+   before entering Haskell via a stable pointer (contact
+   <sof> for (gruesome) details!)
+  
+   Only save this once.
+
+   ToDo: support this across platforms.
+*/
+#if 0 && defined(CONCURRENT) && defined(i386_TARGET_ARCH)
+    if (CurrentTSO != CurrentTSOinC) {
+       __asm__ volatile (" mov %%esp,%0" : "m=" (CurrentRegTable->rCstkptr));
+    }
+#endif
 
 #ifdef REG_R1
     SAVE_R1 = R1;      
@@ -102,6 +116,14 @@ void SaveAllStgRegs(STG_NO_ARGS)
     SAVE_Dbl2 = DblReg2;
 #endif
 
+#ifdef REG_Lng1
+    SAVE_Lng1 = LngReg1;
+#endif
+
+#ifdef REG_Lng2
+    SAVE_Lng2 = LngReg2;
+#endif
+
 #ifdef REG_Tag
     SAVE_Tag = TagReg;
 #endif
@@ -240,6 +262,14 @@ RestoreAllStgRegs (STG_NO_ARGS)
     DblReg2 = SAVE_Dbl2;
 #endif
 
+#ifdef REG_Lng1
+    LngReg1 = SAVE_Lng1;
+#endif
+
+#ifdef REG_Lng2
+    LngReg2 = SAVE_Lng2;
+#endif
+
 #ifdef REG_Tag
     TagReg = SAVE_Tag;
 #endif