[project @ 2001-05-02 12:14:49 by simonpj]
[ghc-hetmet.git] / ghc / includes / TSO.h
index 1f7aa8e..71439a8 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: TSO.h,v 1.19 2000/12/14 15:19:47 sewardj Exp $
+ * $Id: TSO.h,v 1.21 2001/04/02 07:24:12 qrczak Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -12,8 +12,7 @@
 
 #if defined(GRAN) || defined(PAR)
 
-#if DEBUG // && PARANOIA_LEVEL>999
-// magic marker for TSOs; debugging only
+#if DEBUG
 #define TSO_MAGIC 4321
 #endif
 
@@ -53,6 +52,17 @@ typedef struct {
 } StgTSOParInfo;
 #endif /* PAR */
 
+#if defined(DIST)
+typedef struct {
+  StgThreadPriority  priority;   
+  StgInt             revalTid;   /* ToDo: merge both into 1 word */
+  StgInt             revalSlot;
+} StgTSODistInfo;
+#else /* !DIST */
+typedef struct {
+} StgTSODistInfo;
+#endif /* DIST */
+
 #if defined(GRAN)
 typedef StgTSOStatBuf StgTSOGranInfo;
 #else /* !GRAN */
@@ -108,6 +118,16 @@ typedef enum {
   ThreadFinished
 } StgThreadReturnCode;
 
+/*
+ * We distinguish between the various classes of threads in the system.
+ */
+
+typedef enum {
+  AdvisoryPriority,
+  MandatoryPriority,
+  RevalPriority
+} StgThreadPriority;
+
 /* 
  * Threads may be blocked for several reasons.  A blocked thread will
  * have the reason in the why_blocked field of the TSO, and some
@@ -164,7 +184,8 @@ typedef struct StgTSO_ {
   StgTSOProfInfo     prof;
   StgTSOParInfo      par;
   StgTSOGranInfo     gran;
-
+  StgTSODistInfo     dist;
+    
   /* The thread stack... */
   StgWord           stack_size;     /* stack size in *words* */
   StgWord            max_stack_size; /* maximum stack size in *words* */
@@ -246,7 +267,7 @@ typedef struct StgTSO_ {
 extern StgTSO dummy_tso;
 
 #define TSO_STRUCT_SIZE \
-   ((int)&(dummy_tso).stack - (int)&(dummy_tso).header)
+   ((char *)&dummy_tso.stack - (char *)&dummy_tso.header)
 
 #define TSO_STRUCT_SIZEW (TSO_STRUCT_SIZE / sizeof(W_))