[project @ 1999-02-05 16:02:18 by simonm]
[ghc-hetmet.git] / ghc / rts / Schedule.h
1 /* -----------------------------------------------------------------------------
2  * $Id: Schedule.h,v 1.3 1999/02/05 16:02:53 simonm Exp $
3  *
4  * (c) The GHC Team 1998-1999
5  *
6  * Prototypes for functions in Schedule.c 
7  * (RTS internal scheduler interface)
8  *
9  * ---------------------------------------------------------------------------*/
10
11 /* 
12  * Initialisation
13  */
14
15 void    initScheduler(void);
16
17 /* 
18  * Miscellany
19  */
20
21 void    awaken_blocked_queue(StgTSO *tso);
22
23 void    initThread(StgTSO *tso, nat stack_size);
24
25 void    interruptStgRts(void);
26
27 extern  nat context_switch;
28
29 extern  StgTSO *run_queue_hd, *run_queue_tl;
30 extern  StgTSO *blocked_queue_hd, *blocked_queue_tl;
31
32 extern StgTSO *MainTSO; /* temporary hack */
33
34 #define END_TSO_QUEUE  ((StgTSO *)(void*)&END_TSO_QUEUE_closure)
35
36 #define PUSH_ON_RUN_QUEUE(tso)                  \
37     if (run_queue_hd == END_TSO_QUEUE) {        \
38       run_queue_hd = tso;                       \
39     } else {                                    \
40       run_queue_tl->link = tso;                 \
41     }                                           \
42     run_queue_tl = tso;
43
44 #define END_CAF_LIST  stgCast(StgCAF*,(void*)&END_TSO_QUEUE_closure)