Fix scoped type variables for expression type signatures
[ghc-hetmet.git] / includes / RtsTypes.h
1 /*
2   Time-stamp: <2005-03-30 12:02:33 simonmar>
3
4   RTS specific types.
5 */
6
7 /* -------------------------------------------------------------------------
8    Generally useful typedefs
9    ------------------------------------------------------------------------- */
10
11 #ifndef RTS_TYPES_H
12 #define RTS_TYPES_H
13
14 typedef unsigned int  nat;           /* at least 32 bits (like int) */
15 typedef unsigned long lnat;          /* at least 32 bits            */
16 #ifndef _MSC_VER
17 typedef unsigned long long ullong;   /* at least 32 bits            */
18 typedef long long llong;
19 #else
20 typedef unsigned __int64   ullong;   /* at least 32 bits            */
21 typedef __int64 llong;
22 #endif
23
24 /* ullong (64|128-bit) type: only include if needed (not ANSI) */
25 #if defined(__GNUC__) 
26 #define LL(x) (x##LL)
27 #else
28 #define LL(x) (x##L)
29 #endif
30   
31 typedef enum { 
32     rtsFalse = 0, 
33     rtsTrue 
34 } rtsBool;
35
36 /* 
37    Types specific to the parallel runtime system.
38 */
39
40 typedef ullong        rtsTime;
41
42 #if defined(PAR)
43 /* types only needed in the parallel system */
44 typedef struct hashtable ParHashTable;
45 typedef struct hashlist ParHashList;
46
47 /* typedef double REAL_TIME; */
48 /* typedef W_ TIME; */
49 /* typedef GlobalTaskId Proc; */
50 typedef int           GlobalTaskId;
51 typedef GlobalTaskId  PEs;
52 typedef unsigned int  rtsWeight;
53 typedef int           rtsPacket;
54 typedef int           OpCode;
55
56 /* Global addresses i.e. unique ids in a parallel setup; needed in Closures.h*/
57 typedef struct {
58   union {
59     StgPtr plc;
60     struct {
61       GlobalTaskId gtid;
62       int slot;
63     } gc;
64   } payload;
65   rtsWeight weight;
66 } globalAddr;
67
68 /* (GA, LA) pairs */
69 typedef struct gala {
70     globalAddr ga;
71     StgPtr la;
72     struct gala *next;
73     rtsBool preferred;
74 } GALA;
75
76 #elif defined(GRAN)
77
78 /*
79  * GlobalTaskId is dummy in GranSim;
80  * we define it to have cleaner code in the RTS
81  */
82 typedef int       GlobalTaskId;
83 typedef lnat      rtsTime;
84 typedef StgWord   PEs;
85
86 #endif
87
88 #endif /* RTS_TYPES_H */