[project @ 2002-09-05 08:58:55 by simonmar]
[ghc-hetmet.git] / ghc / includes / mkNativeHdr.c
index 7b2bebd..8bf707b 100644 (file)
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
- * $Id: mkNativeHdr.c,v 1.6 2001/11/08 12:46:31 simonmar Exp $
+ * $Id: mkNativeHdr.c,v 1.10 2002/07/21 11:46:34 panne Exp $
  *
  * (c) The GHC Team, 1992-1998
  *
@@ -9,6 +9,8 @@
 
 #include "Stg.h"
 
+#include <stdio.h>
+
 #define OFFSET(table, x) ((StgUnion *) &(x) - (StgUnion *) (&table))
 
 #define OFFSET_R1    OFFSET(RegTable, RegTable.rR1)
 #define OFFSET_stgGCEnter1   FUN_OFFSET(stgGCEnter1)
 #define OFFSET_stgUpdatePAP  FUN_OFFSET(stgUpdatePAP)
 
+#define OFFW_Capability_r  OFFSET(cap, cap.r)
+
 #define TSO_SP       OFFSET(tso, tso.sp)
 #define TSO_SU       OFFSET(tso, tso.su)
 #define TSO_STACK    OFFSET(tso, tso.stack)
 
 #define BDESCR_START OFFSET(bd, bd.start)
 #define BDESCR_FREE  OFFSET(bd, bd.free)
+#define BDESCR_BLOCKS OFFSET(bd, bd.blocks)
 
 StgRegTable RegTable;
 
@@ -98,6 +103,10 @@ main()
     printf("#define OFFSET_stgGCEnter1 (%d)\n", OFFSET_stgGCEnter1);
     printf("#define OFFSET_stgUpdatePAP (%d)\n", OFFSET_stgUpdatePAP);
 
+    printf("\n-- Offset of the .r (StgRegTable) field in a Capability\n");
+
+    printf("#define OFFW_Capability_r (%d)\n", OFFW_Capability_r);
+
     printf("\n-- Storage Manager offsets for the Native Code Generator\n");
 
     printf("\n-- TSO offsets for the Native Code Generator\n");
@@ -110,6 +119,7 @@ main()
 
     printf("#define BDESCR_START %d\n", BDESCR_START);
     printf("#define BDESCR_FREE %d\n", BDESCR_FREE);
+    printf("#define BDESCR_BLOCKS %d\n", BDESCR_BLOCKS);
 
     printf("\n-- FILE size for the Native Code Generator\n");