FIX BUILD (on Windows): follow changes to make threaded RTS compile with -fasm
[ghc-hetmet.git] / includes / mkDerivedConstants.c
index 27d4fa9..2fe99b6 100644 (file)
  * doesn't affect the offsets of anything else.
  */
 #define PROFILING
+#define THREADED_RTS
 
 #include "Rts.h"
 #include "RtsFlags.h"
 #include "Storage.h"
+#include "Stable.h"
 #include "OSThreads.h"
 #include "Capability.h"
 
 
 #define str(a,b) #a "_" #b
 
-#define OFFSET(s_type, field) ((unsigned int)&(((s_type*)0)->field))
+#define OFFSET(s_type, field) ((size_t)&(((s_type*)0)->field))
+
+#ifdef mingw32_HOST_OS
+#define SIZET_FMT "d"
+#else
+#define SIZET_FMT "zd"
+#endif
 
 #if defined(GEN_HASKELL)
 #define def_offset(str, offset) \
-    printf("oFFSET_" str " = %d::Int\n", offset);
+    printf("oFFSET_" str " = %" SIZET_FMT "::Int\n", offset);
 #else
 #define def_offset(str, offset) \
-    printf("#define OFFSET_" str " %d\n", offset);
+    printf("#define OFFSET_" str " %" SIZET_FMT "\n", offset);
 #endif
 
 #if defined(GEN_HASKELL)
@@ -177,13 +185,6 @@ main(int argc, char *argv[])
     printf("#define PROF_HDR_SIZE  %d\n", sizeofW(StgProfHeader));
     printf("#define GRAN_HDR_SIZE  %d\n", sizeofW(StgGranHeader));
 
-    printf("#define STD_ITBL_SIZE   %d\n", sizeofW(StgInfoTable));
-    printf("#define RET_ITBL_SIZE   %d\n", sizeofW(StgRetInfoTable) - sizeofW(StgInfoTable));
-    printf("#define PROF_ITBL_SIZE  %d\n", sizeofW(StgProfInfo));
-
-    printf("#define GRAN_ITBL_SIZE  %d\n", 0);
-    printf("#define TICKY_ITBL_SIZE %d\n", 0);
-
     printf("#define BLOCK_SIZE   %d\n", BLOCK_SIZE);
     printf("#define MBLOCK_SIZE   %d\n", MBLOCK_SIZE);  
 
@@ -227,6 +228,8 @@ main(int argc, char *argv[])
     def_offset("stgGCFun", FUN_OFFSET(stgGCFun));
 
     field_offset(Capability, r);
+    field_offset(Capability, lock);
+    struct_field(Capability, mut_lists);
 
     struct_field(bdescr, start);
     struct_field(bdescr, free);
@@ -257,7 +260,8 @@ main(int argc, char *argv[])
     struct_field(StgEntCounter, allocs);
     struct_field(StgEntCounter, registeredp);
     struct_field(StgEntCounter, link);
-    
+    struct_field(StgEntCounter, entry_count);
+
     closure_size(StgUpdateFrame);
     closure_size(StgCatchFrame);
     closure_size(StgStopFrame);
@@ -276,8 +280,10 @@ main(int argc, char *argv[])
     closure_field(StgTSO, block_info);
     closure_field(StgTSO, blocked_exceptions);
     closure_field(StgTSO, id);
+    closure_field(StgTSO, cap);
     closure_field(StgTSO, saved_errno);
     closure_field(StgTSO, trec);
+    closure_field(StgTSO, flags);
     closure_field_("StgTSO_CCCS", StgTSO, prof.CCCS);
     tso_field(StgTSO, sp);
     tso_field_offset(StgTSO, stack);
@@ -314,6 +320,8 @@ main(int argc, char *argv[])
     closure_field(StgAP_STACK, fun);
     closure_payload(StgAP_STACK, payload);
 
+    thunk_size(StgSelector);
+
     closure_field(StgInd, indirectee);
 
     closure_size(StgMutVar);
@@ -321,15 +329,26 @@ main(int argc, char *argv[])
 
     closure_size(StgAtomicallyFrame);
     closure_field(StgAtomicallyFrame, code);
+    closure_field(StgAtomicallyFrame, next_invariant_to_check);
+
+    closure_field(StgInvariantCheckQueue, invariant);
+    closure_field(StgInvariantCheckQueue, my_execution);
+    closure_field(StgInvariantCheckQueue, next_queue_entry);
+
+    closure_field(StgAtomicInvariant, code);
 
     closure_size(StgCatchSTMFrame);
     closure_field(StgCatchSTMFrame, handler);
+    closure_field(StgCatchSTMFrame, code);
 
     closure_size(StgCatchRetryFrame);
     closure_field(StgCatchRetryFrame, running_alt_code);
     closure_field(StgCatchRetryFrame, first_code);
     closure_field(StgCatchRetryFrame, alt_code);
-    closure_field(StgCatchRetryFrame, first_code_trec);
+
+    closure_field(StgTVarWatchQueue, closure);
+    closure_field(StgTVarWatchQueue, next_queue_entry);
+    closure_field(StgTVarWatchQueue, prev_queue_entry);
 
     closure_size(StgWeak);
     closure_field(StgWeak,link);
@@ -349,7 +368,6 @@ main(int argc, char *argv[])
     closure_field(StgBCO, instrs);
     closure_field(StgBCO, literals);
     closure_field(StgBCO, ptrs);
-    closure_field(StgBCO, itbls);
     closure_field(StgBCO, arity);
     closure_field(StgBCO, size);
     closure_payload(StgBCO, bitmap);
@@ -367,6 +385,8 @@ main(int argc, char *argv[])
                  RTS_FLAGS, DebugFlags.weak);
     struct_field_("RtsFlags_GcFlags_initialStkSize",
                  RTS_FLAGS, GcFlags.initialStkSize);
+    struct_field_("RtsFlags_MiscFlags_tickInterval",
+                 RTS_FLAGS, MiscFlags.tickInterval);
 
     struct_size(StgFunInfoExtraFwd);
     struct_field(StgFunInfoExtraFwd, slow_apply);