2 Time-stamp: <2005-03-30 12:02:33 simonmar>
7 /* -------------------------------------------------------------------------
8 Generally useful typedefs
9 ------------------------------------------------------------------------- */
14 typedef unsigned int nat; /* at least 32 bits (like int) */
15 typedef unsigned long lnat; /* at least 32 bits */
17 typedef unsigned long long ullong; /* at least 32 bits */
18 typedef long long llong;
20 typedef unsigned __int64 ullong; /* at least 32 bits */
21 typedef __int64 llong;
24 /* ullong (64|128-bit) type: only include if needed (not ANSI) */
37 Types specific to the parallel runtime system.
41 /* Spark pools: used to store pending sparks
42 * (THREADED_RTS & PARALLEL_HASKELL only)
43 * Implementation uses a DeQue to enable concurrent read accesses at
46 typedef struct SparkPool_ {
47 /* Size of elements array. Used for modulo calculation: we round up
48 to powers of 2 and use the dyadic log (modulo == bitwise &) */
50 StgWord moduloSize; /* bitmask for modulo */
52 /* top, index where multiple readers steal() (protected by a cas) */
55 /* bottom, index of next free place where one writer can push
56 elements. This happens unsynchronised. */
58 /* both position indices are continuously incremented, and used as
59 an index modulo the current array size. */
61 /* lower bound on the current top value. This is an internal
62 optimisation to avoid unnecessarily accessing the top field
66 /* The elements array */
67 StgClosurePtr* elements;
68 /* Please note: the dataspace cannot follow the admin fields
69 immediately, as it should be possible to enlarge it without
70 disposing the old one automatically (as realloc would)! */
74 typedef ullong rtsTime;
77 /* types only needed in the parallel system */
78 typedef struct hashtable ParHashTable;
79 typedef struct hashlist ParHashList;
81 /* typedef double REAL_TIME; */
82 /* typedef W_ TIME; */
83 /* typedef GlobalTaskId Proc; */
84 typedef int GlobalTaskId;
85 typedef GlobalTaskId PEs;
86 typedef unsigned int rtsWeight;
87 typedef int rtsPacket;
90 /* Global addresses i.e. unique ids in a parallel setup; needed in Closures.h*/
103 typedef struct gala {
113 * GlobalTaskId is dummy in GranSim;
114 * we define it to have cleaner code in the RTS
116 typedef int GlobalTaskId;
117 typedef lnat rtsTime;
122 #endif /* RTS_TYPES_H */