[project @ 2000-01-13 14:33:57 by hwloidl]
[ghc-hetmet.git] / ghc / includes / RtsTypes.h
1 /*
2   Time-stamp: <Mon Nov 22 1999 21:29:44 Stardate: [-30]3939.47 hwloidl>
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 typedef unsigned long long ullong;   /* at least 32 bits            */
17
18 /* ullong (64|128-bit) type: only include if needed (not ANSI) */
19 #if defined(__GNUC__) 
20 #define LL(x) (x##LL)
21 #else
22 #define LL(x) (x##L)
23 #endif
24   
25 typedef enum { 
26     rtsFalse = 0, 
27     rtsTrue 
28 } rtsBool;
29
30 /* 
31    Types specific to the parallel runtime system.
32 */
33
34 #if defined(PAR)
35 /* types only needed in the parallel system */
36 typedef struct hashtable ParHashTable;
37 typedef struct hashlist ParHashList;
38
39 // typedef double REAL_TIME;
40 // typedef W_ TIME;
41 // typedef GlobalTaskId Proc;
42 typedef int           GlobalTaskId;
43 typedef ullong        rtsTime;
44 typedef GlobalTaskId  PEs;
45 typedef unsigned int  rtsWeight;
46 typedef int           rtsPacket;
47 typedef int           OpCode;
48
49 /* Global addresses i.e. unique ids in a parallel setup; needed in Closures.h*/
50 typedef struct {
51   union {
52     StgPtr plc;
53     struct {
54       GlobalTaskId gtid;
55       int slot;
56     } gc;
57   } payload;
58   rtsWeight weight;
59 } globalAddr;
60
61 /* (GA, LA) pairs */
62 typedef struct gala {
63     globalAddr ga;
64     StgPtr la;
65     struct gala *next;
66     rtsBool preferred;
67 } GALA;
68
69 #elif defined(GRAN)
70
71 typedef lnat      rtsTime;
72 typedef StgWord   PEs;
73
74 #endif
75
76 #endif /* RTS_TYPES_H */