[project @ 2000-08-02 14:13:26 by rrt]
[ghc-hetmet.git] / ghc / includes / StgMacros.h
index c5ebfa5..3cbcf8e 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgMacros.h,v 1.28 2000/07/20 17:06:41 rrt Exp $
+ * $Id: StgMacros.h,v 1.32 2000/08/02 14:13:27 rrt Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
 #define EF_(f)         extern F_ f(void)
 #define EDF_(f)                extern DLLIMPORT F_ f(void)
 
-/* Use this rather than EF_ or EDF_ throughout the RTS */
-#define ERTSF_(f)   extern DLL_IMPORT_RTS F_ f(void)
-
+#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
@@ -296,7 +294,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define HP_CHK_GEN(headroom,liveness,reentry,tag_assts)        \
    if ((Hp += (headroom)) > HpLim ) {                  \
-       ERTSF_(stg_gen_chk);                            \
+       EXTFUN_RTS(stg_gen_chk);                                \
         tag_assts                                      \
        R9.w = (W_)LIVENESS_MASK(liveness);             \
         R10.w = (W_)reentry;                           \
@@ -309,7 +307,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define STK_CHK_GEN(headroom,liveness,reentry,tag_assts)       \
    if ((Sp - (headroom)) < SpLim) {                            \
-       ERTSF_(stg_gen_chk);                                    \
+       EXTFUN_RTS(stg_gen_chk);                                        \
         tag_assts                                              \
        R9.w = (W_)LIVENESS_MASK(liveness);                     \
         R10.w = (W_)reentry;                                   \
@@ -318,7 +316,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define MAYBE_GC(liveness,reentry)             \
    if (doYouWantToGC()) {                      \
-       ERTSF_(stg_gen_hp);                     \
+       EXTFUN_RTS(stg_gen_hp);                 \
        R9.w = (W_)LIVENESS_MASK(liveness);     \
         R10.w = (W_)reentry;                   \
         JMP_(stg_gen_hp);                      \
@@ -331,8 +329,8 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
    out to be slowing us down we can make specialised ones.
    -------------------------------------------------------------------------- */
 
-ERTSF_(stg_gen_yield);
-ERTSF_(stg_gen_block);
+EXTFUN_RTS(stg_gen_yield);
+EXTFUN_RTS(stg_gen_block);
 
 #define YIELD(liveness,reentry)                        \
   {                                            \
@@ -350,7 +348,7 @@ ERTSF_(stg_gen_block);
 
 #define BLOCK_NP(ptrs)                         \
   {                                            \
-    ERTSF_(stg_block_##ptrs);                  \
+    EXTFUN_RTS(stg_block_##ptrs);                      \
     JMP_(stg_block_##ptrs);                    \
   }
 
@@ -380,11 +378,8 @@ ERTSF_(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
 
@@ -751,10 +746,8 @@ LoadThreadState (void)
         STGCALL1(getStablePtr,reg_fe_binder)
        
 #define REGISTER_IMPORT(reg_mod_name)          \
-       do { ERTSF_(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());                 \