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