Add explicit imports for RTS-external variables
[ghc-hetmet.git] / rts / StgMiscClosures.cmm
index e092e3f..4eb20dd 100644 (file)
 
 #include "Cmm.h"
 
+import pthread_mutex_lock;
+import base_GHCziBase_Czh_static_info;
+import base_GHCziBase_Izh_static_info;
+
 /* ----------------------------------------------------------------------------
    Support for the bytecode interpreter.
    ------------------------------------------------------------------------- */
@@ -167,7 +171,7 @@ INFO_TABLE_FUN( stg_BCO, 4, 0, BCO, "BCO", "BCO", ARG_BCO )
 INFO_TABLE(stg_IND,1,0,IND,"IND","IND")
 {
     TICK_ENT_DYN_IND();        /* tick */
-    R1 = StgInd_indirectee(R1);
+    R1 = UNTAG(StgInd_indirectee(R1));
     TICK_ENT_VIA_NODE();
     jump %GET_ENTRY(R1);
 }
@@ -183,7 +187,7 @@ INFO_TABLE(stg_IND_direct,1,0,IND,"IND","IND")
 INFO_TABLE(stg_IND_STATIC,1,0,IND_STATIC,"IND_STATIC","IND_STATIC")
 {
     TICK_ENT_STATIC_IND();     /* tick */
-    R1 = StgInd_indirectee(R1);
+    R1 = UNTAG(StgInd_indirectee(R1));
     TICK_ENT_VIA_NODE();
     jump %GET_ENTRY(R1);
 }
@@ -220,7 +224,7 @@ INFO_TABLE(stg_IND_PERM,1,0,IND_PERM,"IND_PERM","IND_PERM")
     StgHeader_info(R1) = stg_IND_info;
 #endif /* TICKY_TICKY */
 
-    R1 = StgInd_indirectee(R1);
+    R1 = UNTAG(StgInd_indirectee(R1));
 
 #if defined(TICKY_TICKY) && !defined(PROFILING)
     TICK_ENT_VIA_NODE();
@@ -233,7 +237,7 @@ INFO_TABLE(stg_IND_PERM,1,0,IND_PERM,"IND_PERM","IND_PERM")
 INFO_TABLE(stg_IND_OLDGEN,1,0,IND_OLDGEN,"IND_OLDGEN","IND_OLDGEN")
 {
     TICK_ENT_STATIC_IND();     /* tick */
-    R1 = StgInd_indirectee(R1);
+    R1 = UNTAG(StgInd_indirectee(R1));
     TICK_ENT_VIA_NODE();
     jump %GET_ENTRY(R1);
 }
@@ -262,7 +266,7 @@ INFO_TABLE(stg_IND_OLDGEN_PERM,1,0,IND_OLDGEN_PERM,"IND_OLDGEN_PERM","IND_OLDGEN
     StgHeader_info(R1) = stg_IND_OLDGEN_info;
 #endif /* TICKY_TICKY */
 
-    R1 = StgInd_indirectee(R1);
+    R1 = UNTAG(StgInd_indirectee(R1));
 
     TICK_ENT_VIA_NODE();
     jump %GET_ENTRY(R1);
@@ -592,17 +596,16 @@ CLOSURE(stg_dummy_ret_closure,stg_dummy_ret);
    replace them with references to the static objects.
    ------------------------------------------------------------------------- */
 
-#if defined(ENABLE_WIN32_DLL_SUPPORT)
+#if defined(__PIC__) && defined(mingw32_TARGET_OS)
 /*
  * When sticking the RTS in a DLL, we delay populating the
  * Charlike and Intlike tables until load-time, which is only
  * when we've got the real addresses to the C# and I# closures.
  *
  */
-static INFO_TBL_CONST StgInfoTable czh_static_info;
-static INFO_TBL_CONST StgInfoTable izh_static_info;
-#define Char_hash_static_info czh_static_info
-#define Int_hash_static_info izh_static_info
+#warning Is this correct? _imp is a pointer!
+#define Char_hash_static_info _imp__base_GHCziBase_Czh_static
+#define Int_hash_static_info _imp__base_GHCziBase_Izh_static
 #else
 #define Char_hash_static_info base_GHCziBase_Czh_static
 #define Int_hash_static_info base_GHCziBase_Izh_static