2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
4 \section[Constants]{Info about this compilation}
8 -- The above warning supression flag is a temporary kludge.
9 -- While working on this module you are encouraged to remove it and fix
10 -- any warnings in the module. See
11 -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
14 module Constants (module Constants) where
16 import Data.Bits (shiftL)
18 -- This magical #include brings in all the everybody-knows-these magic
19 -- constants unfortunately, we need to be *explicit* about which one
20 -- we want; if we just hope a -I... will get the right one, we could
23 #include "HsVersions.h"
24 #include "../includes/MachRegs.h"
25 #include "../includes/Constants.h"
26 #include "../includes/MachDeps.h"
27 #include "../includes/DerivedConstants.h"
35 mAX_TUPLE_SIZE = (62 :: Int) -- Should really match the number
36 -- of decls in Data.Tuple
37 mAX_CONTEXT_REDUCTION_DEPTH = (20 :: Int)
42 -- specialised fun/thunk/constr closure types
43 mAX_SPEC_THUNK_SIZE = (MAX_SPEC_THUNK_SIZE :: Int)
44 mAX_SPEC_FUN_SIZE = (MAX_SPEC_FUN_SIZE :: Int)
45 mAX_SPEC_CONSTR_SIZE = (MAX_SPEC_CONSTR_SIZE :: Int)
47 -- pre-compiled thunk types
48 mAX_SPEC_SELECTEE_SIZE = (MAX_SPEC_SELECTEE_SIZE :: Int)
49 mAX_SPEC_AP_SIZE = (MAX_SPEC_AP_SIZE :: Int)
51 -- closure sizes: these do NOT include the header (see below for header sizes)
52 mIN_PAYLOAD_SIZE = (MIN_PAYLOAD_SIZE::Int)
56 mIN_INTLIKE, mAX_INTLIKE :: Int
57 mIN_INTLIKE = MIN_INTLIKE
58 mAX_INTLIKE = MAX_INTLIKE
60 mIN_CHARLIKE, mAX_CHARLIKE :: Int
61 mIN_CHARLIKE = MIN_CHARLIKE
62 mAX_CHARLIKE = MAX_CHARLIKE
65 A section of code-generator-related MAGIC CONSTANTS.
68 mAX_Vanilla_REG = (MAX_VANILLA_REG :: Int)
69 mAX_Float_REG = (MAX_FLOAT_REG :: Int)
70 mAX_Double_REG = (MAX_DOUBLE_REG :: Int)
71 mAX_Long_REG = (MAX_LONG_REG :: Int)
73 mAX_Real_Vanilla_REG = (MAX_REAL_VANILLA_REG :: Int)
74 mAX_Real_Float_REG = (MAX_REAL_FLOAT_REG :: Int)
75 mAX_Real_Double_REG = (MAX_REAL_DOUBLE_REG :: Int)
76 #ifdef MAX_REAL_LONG_REG
77 mAX_Real_Long_REG = (MAX_REAL_LONG_REG :: Int)
79 mAX_Real_Long_REG = (0::Int)
86 sTD_HDR_SIZE = (STD_HDR_SIZE :: Int)
87 pROF_HDR_SIZE = (PROF_HDR_SIZE :: Int)
88 gRAN_HDR_SIZE = (GRAN_HDR_SIZE :: Int)
91 Size of a double in StgWords.
94 dOUBLE_SIZE = SIZEOF_DOUBLE :: Int
95 wORD64_SIZE = 8 :: Int
96 iNT64_SIZE = wORD64_SIZE
99 This tells the native code generator the size of the spill
100 area is has available.
103 rESERVED_C_STACK_BYTES = (RESERVED_C_STACK_BYTES :: Int)
106 The amount of (Haskell) stack to leave free for saving registers when
107 returning to the scheduler.
110 rESERVED_STACK_WORDS = (RESERVED_STACK_WORDS :: Int)
113 Continuations that need more than this amount of stack should do their
114 own stack check (see bug #1466).
117 aP_STACK_SPLIM = (AP_STACK_SPLIM :: Int)
120 Size of a word, in bytes
123 wORD_SIZE = (SIZEOF_HSWORD :: Int)
124 wORD_SIZE_IN_BITS = wORD_SIZE * 8 :: Int
127 Amount of pointer bits used for semi-tagging constructor closures
130 tAG_BITS = (TAG_BITS :: Int)
131 tAG_MASK = ((1 `shiftL` tAG_BITS) - 1) :: Int
132 mAX_PTR_TAG = tAG_MASK :: Int
135 Size of a C int, in bytes. May be smaller than wORD_SIZE.
138 cINT_SIZE = (SIZEOF_INT :: Int)
141 Size of a storage manager block (in bytes).
144 bLOCK_SIZE = (BLOCK_SIZE :: Int)
145 bLOCK_SIZE_W = (bLOCK_SIZE `quot` wORD_SIZE :: Int)
148 Number of bits to shift a bitfield left by in an info table.
151 bITMAP_BITS_SHIFT = (BITMAP_BITS_SHIFT :: Int)
154 Constants derived from headers in ghc/includes, generated by the program
155 ../includes/mkDerivedConstants.c.
158 #include "../includes/GHCConstants.h"