2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
4 \section[Constants]{Info about this compilation}
7 module Constants (module Constants) where
9 import Data.Bits (shiftL)
11 -- This magical #include brings in all the everybody-knows-these magic
12 -- constants unfortunately, we need to be *explicit* about which one
13 -- we want; if we just hope a -I... will get the right one, we could
16 -- XXX This define is a bit of a hack, and should be done more nicely
17 #define FAST_STRING_NOT_NEEDED 1
18 #include "HsVersions.h"
19 #include "../includes/MachRegs.h"
20 #include "../includes/Constants.h"
21 #include "../includes/MachDeps.h"
22 #include "../includes/DerivedConstants.h"
31 mAX_TUPLE_SIZE = 62 -- Should really match the number
32 -- of decls in Data.Tuple
34 mAX_CONTEXT_REDUCTION_DEPTH :: Int
35 mAX_CONTEXT_REDUCTION_DEPTH = 20
40 -- specialised fun/thunk/constr closure types
41 mAX_SPEC_THUNK_SIZE :: Int
42 mAX_SPEC_THUNK_SIZE = MAX_SPEC_THUNK_SIZE
44 mAX_SPEC_FUN_SIZE :: Int
45 mAX_SPEC_FUN_SIZE = MAX_SPEC_FUN_SIZE
47 mAX_SPEC_CONSTR_SIZE :: Int
48 mAX_SPEC_CONSTR_SIZE = MAX_SPEC_CONSTR_SIZE
50 -- pre-compiled thunk types
51 mAX_SPEC_SELECTEE_SIZE :: Int
52 mAX_SPEC_SELECTEE_SIZE = MAX_SPEC_SELECTEE_SIZE
54 mAX_SPEC_AP_SIZE :: Int
55 mAX_SPEC_AP_SIZE = MAX_SPEC_AP_SIZE
57 -- closure sizes: these do NOT include the header (see below for header sizes)
58 mIN_PAYLOAD_SIZE ::Int
59 mIN_PAYLOAD_SIZE = MIN_PAYLOAD_SIZE
63 mIN_INTLIKE, mAX_INTLIKE :: Int
64 mIN_INTLIKE = MIN_INTLIKE
65 mAX_INTLIKE = MAX_INTLIKE
67 mIN_CHARLIKE, mAX_CHARLIKE :: Int
68 mIN_CHARLIKE = MIN_CHARLIKE
69 mAX_CHARLIKE = MAX_CHARLIKE
72 A section of code-generator-related MAGIC CONSTANTS.
75 mAX_Vanilla_REG :: Int
76 mAX_Vanilla_REG = MAX_VANILLA_REG
79 mAX_Float_REG = MAX_FLOAT_REG
82 mAX_Double_REG = MAX_DOUBLE_REG
85 mAX_Long_REG = MAX_LONG_REG
87 mAX_Real_Vanilla_REG :: Int
88 mAX_Real_Vanilla_REG = MAX_REAL_VANILLA_REG
90 mAX_Real_Float_REG :: Int
91 mAX_Real_Float_REG = MAX_REAL_FLOAT_REG
93 mAX_Real_Double_REG :: Int
94 mAX_Real_Double_REG = MAX_REAL_DOUBLE_REG
96 mAX_Real_Long_REG :: Int
97 #ifdef MAX_REAL_LONG_REG
98 mAX_Real_Long_REG = MAX_REAL_LONG_REG
100 mAX_Real_Long_REG = 0
104 Closure header sizes.
108 sTD_HDR_SIZE = STD_HDR_SIZE
111 pROF_HDR_SIZE = PROF_HDR_SIZE
114 gRAN_HDR_SIZE = GRAN_HDR_SIZE
117 Size of a double in StgWords.
121 dOUBLE_SIZE = SIZEOF_DOUBLE
127 iNT64_SIZE = wORD64_SIZE
130 This tells the native code generator the size of the spill
131 area is has available.
134 rESERVED_C_STACK_BYTES :: Int
135 rESERVED_C_STACK_BYTES = RESERVED_C_STACK_BYTES
138 The amount of (Haskell) stack to leave free for saving registers when
139 returning to the scheduler.
142 rESERVED_STACK_WORDS :: Int
143 rESERVED_STACK_WORDS = RESERVED_STACK_WORDS
146 Continuations that need more than this amount of stack should do their
147 own stack check (see bug #1466).
150 aP_STACK_SPLIM :: Int
151 aP_STACK_SPLIM = AP_STACK_SPLIM
154 Size of a word, in bytes
158 wORD_SIZE = SIZEOF_HSWORD
160 wORD_SIZE_IN_BITS :: Int
161 wORD_SIZE_IN_BITS = wORD_SIZE * 8
164 Amount of pointer bits used for semi-tagging constructor closures
171 tAG_MASK = (1 `shiftL` tAG_BITS) - 1
174 mAX_PTR_TAG = tAG_MASK
177 Size of a C int, in bytes. May be smaller than wORD_SIZE.
181 cINT_SIZE = SIZEOF_INT
184 Size of a storage manager block (in bytes).
188 bLOCK_SIZE = BLOCK_SIZE
190 bLOCK_SIZE_W = bLOCK_SIZE `quot` wORD_SIZE
193 Number of bits to shift a bitfield left by in an info table.
196 bITMAP_BITS_SHIFT :: Int
197 bITMAP_BITS_SHIFT = BITMAP_BITS_SHIFT
200 Constants derived from headers in ghc/includes, generated by the program
201 ../includes/mkDerivedConstants.c.
204 #include "../includes/GHCConstants.h"