[project @ 2001-11-22 16:33:06 by simonmar]
[ghc-hetmet.git] / ghc / rts / Schedule.h
index e7b51ba..b81087d 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Schedule.h,v 1.21 2000/12/04 12:31:21 simonmar Exp $
+ * $Id: Schedule.h,v 1.25 2001/11/22 14:25:12 simonmar Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -32,7 +32,6 @@ void exitScheduler( void );
 void startTasks( void );
 #endif
 
-
 //@cindex awakenBlockedQueue
 /* awakenBlockedQueue()
  *
@@ -94,6 +93,15 @@ void awaitEvent(rtsBool wait);  /* In Select.c */
  */
 rtsBool wakeUpSleepingThreads(nat);  /* In Select.c */
 
+/* GetRoots(evac_fn f)
+ *
+ * Call f() for each root known to the scheduler.
+ *
+ * Called from STG :  NO
+ * Locks assumed   :  ????
+ */
+void GetRoots(evac_fn);
+
 // ToDo: check whether all fcts below are used in the SMP version, too
 //@cindex awaken_blocked_queue
 #if defined(GRAN)
@@ -123,12 +131,6 @@ extern rtsBool interrupted;
 
 /* In Select.c */
 extern nat timestamp;
-extern nat ticks_since_timestamp;
-
-//@cindex Capability
-/* Capability type
- */
-typedef StgRegTable Capability;
 
 /* Free capability list.
  * Locks required: sched_mutex.
@@ -137,7 +139,7 @@ typedef StgRegTable Capability;
 extern Capability *free_capabilities;
 extern nat n_free_capabilities;
 #else
-extern Capability MainRegTable;
+extern Capability MainCapability;
 #endif
 
 /* Thread queues.
@@ -198,15 +200,15 @@ void printThreadStatus(StgTSO *tso);
 void printAllThreads(void);
 #endif
 void print_bq (StgClosure *node);
+#if defined(PAR)
+void print_bqe (StgBlockingQueueElement *bqe);
+#endif
 
 /* -----------------------------------------------------------------------------
  * Some convenient macros...
  */
 
-/* this is the NIL ptr for a TSO queue (e.g. runnable queue) */
-#define END_TSO_QUEUE  ((StgTSO *)(void*)&stg_END_TSO_QUEUE_closure)
-/* this is the NIL ptr for a list CAFs */
-#define END_ECAF_LIST   ((StgCAF *)(void*)&stg_END_TSO_QUEUE_closure)
+/* END_TSO_QUEUE and friends now defined in includes/StgMiscClosures.h */
 
 //@cindex APPEND_TO_RUN_QUEUE
 /* Add a thread to the end of the run queue.
@@ -273,6 +275,11 @@ void print_bq (StgClosure *node);
 #define THREAD_RUNNABLE()  /* nothing */
 #endif
 
+//@cindex EMPTY_RUN_QUEUE
+/* Check whether the run queue is empty i.e. the PE is idle
+ */
+#define EMPTY_RUN_QUEUE()     (run_queue_hd == END_TSO_QUEUE)
+
 //@node Index,  , Some convenient macros
 //@subsection Index