[project @ 2001-04-10 13:52:31 by sewardj]
[ghc-hetmet.git] / ghc / includes / StgMacros.h
index 55ddab5..444a5c2 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgMacros.h,v 1.31 2000/07/21 09:48:47 rrt Exp $
+ * $Id: StgMacros.h,v 1.37 2000/12/04 12:31:20 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -49,7 +49,7 @@
 
 #define EXTINFO_RTS    extern DLL_IMPORT_RTS INFO_TBL_CONST StgInfoTable
 #define ED_            extern
-#define EDD_           extern DLLIMPORT 
+#define EDD_           extern DLLIMPORT
 #define ED_RO_         extern const
 #define ID_            static
 #define ID_RO_         static const
@@ -378,11 +378,8 @@ EXTFUN_RTS(stg_gen_block);
    We use a RET_DYN frame the same as for a dynamic heap check.
    ------------------------------------------------------------------------- */
 
-#if COMPILING_RTS
-EI_(stg_gen_chk_info);
-#else
-EDI_(stg_gen_chk_info);
-#endif
+EXTINFO_RTS(stg_gen_chk_info);
+
 /* -----------------------------------------------------------------------------
    Vectored Returns
 
@@ -425,7 +422,7 @@ EDI_(stg_gen_chk_info);
              }                                                 \
           }                                                    \
        }                                                       \
-        SET_INFO(R1.cl,&BLACKHOLE_info)
+        SET_INFO(R1.cl,&stg_BLACKHOLE_info)
 #    define UPD_BH_SINGLE_ENTRY(info)                          \
         TICK_UPD_BH_SINGLE_ENTRY();                            \
         {                                                      \
@@ -439,14 +436,14 @@ EDI_(stg_gen_chk_info);
              }                                                 \
           }                                                    \
        }                                                       \
-        SET_INFO(R1.cl,&BLACKHOLE_info)
+        SET_INFO(R1.cl,&stg_BLACKHOLE_info)
 #  else
 #    define UPD_BH_UPDATABLE(info)             \
         TICK_UPD_BH_UPDATABLE();               \
-        SET_INFO(R1.cl,&BLACKHOLE_info)
+        SET_INFO(R1.cl,&stg_BLACKHOLE_info)
 #    define UPD_BH_SINGLE_ENTRY(info)          \
         TICK_UPD_BH_SINGLE_ENTRY();            \
-        SET_INFO(R1.cl,&SE_BLACKHOLE_info)
+        SET_INFO(R1.cl,&stg_SE_BLACKHOLE_info)
 #  endif
 #else /* !EAGER_BLACKHOLING */
 #  define UPD_BH_UPDATABLE(thunk)    /* nothing */
@@ -620,7 +617,7 @@ static inline StgInt64 PK_Int64(W_ p_src[])
    Catch frames
    -------------------------------------------------------------------------- */
 
-extern DLL_IMPORT_DATA const StgPolyInfoTable catch_frame_info;
+extern DLL_IMPORT_RTS const StgPolyInfoTable stg_catch_frame_info;
 
 /* -----------------------------------------------------------------------------
    Seq frames
@@ -629,14 +626,14 @@ extern DLL_IMPORT_DATA const StgPolyInfoTable catch_frame_info;
    an update...
    -------------------------------------------------------------------------- */
 
-extern DLL_IMPORT_DATA const StgPolyInfoTable seq_frame_info;
+extern DLL_IMPORT_RTS const StgPolyInfoTable stg_seq_frame_info;
 
 #define PUSH_SEQ_FRAME(sp)                                     \
        {                                                       \
                StgSeqFrame *__frame;                           \
                TICK_SEQF_PUSHED();                             \
                __frame = (StgSeqFrame *)(sp);                  \
-               SET_HDR_(__frame,&seq_frame_info,CCCS);         \
+               SET_HDR_(__frame,&stg_seq_frame_info,CCCS);     \
                __frame->link = Su;                             \
                Su = (StgUpdateFrame *)__frame;                 \
        }
@@ -646,7 +643,11 @@ extern DLL_IMPORT_DATA const StgPolyInfoTable seq_frame_info;
    -------------------------------------------------------------------------- */
 
 #if defined(USE_SPLIT_MARKERS)
+#if defined(cygwin32_TARGET_OS) || defined(mingw32_TARGET_OS)
+#define __STG_SPLIT_MARKER __asm__("\n___stg_split_marker:");
+#else
 #define __STG_SPLIT_MARKER __asm__("\n__stg_split_marker:");
+#endif
 #else
 #define __STG_SPLIT_MARKER /* nothing */
 #endif
@@ -687,7 +688,6 @@ SaveThreadState(void)
   tso = CurrentTSO;
   tso->sp       = Sp;
   tso->su       = Su;
-  tso->splim    = SpLim;
   CloseNursery(Hp);
 
 #ifdef REG_CurrentTSO
@@ -713,7 +713,7 @@ LoadThreadState (void)
   tso = CurrentTSO;
   Sp    = tso->sp;
   Su    = tso->su;
-  SpLim = tso->splim;
+  SpLim = (P_)&(tso->stack) + RESERVED_STACK_WORDS;
   OpenNursery(Hp,HpLim);
 
 #ifdef REG_CurrentNursery
@@ -749,10 +749,8 @@ LoadThreadState (void)
         STGCALL1(getStablePtr,reg_fe_binder)
        
 #define REGISTER_IMPORT(reg_mod_name)          \
-       do { EXTFUN_RTS(reg_mod_name);                  \
-         PUSH_INIT_STACK(reg_mod_name) ;       \
-       } while (0)
-       
+        PUSH_INIT_STACK(reg_mod_name)
+
 #define END_MOD_INIT()                         \
         }};                                    \
        JMP_(POP_INIT_STACK());                 \