| 1 | /* -------------------------------------------------------------------------- |
|---|
| 2 | * |
|---|
| 3 | * (c) The GHC Team, 1992-2012 |
|---|
| 4 | * |
|---|
| 5 | * mkDerivedConstants.c |
|---|
| 6 | * |
|---|
| 7 | * Basically this is a C program that extracts information from the C |
|---|
| 8 | * declarations in the header files (primarily struct field offsets) |
|---|
| 9 | * and generates a header file that can be #included into non-C source |
|---|
| 10 | * containing this information. |
|---|
| 11 | * |
|---|
| 12 | * ------------------------------------------------------------------------*/ |
|---|
| 13 | |
|---|
| 14 | #define IN_STG_CODE 0 |
|---|
| 15 | |
|---|
| 16 | /* |
|---|
| 17 | * We need offsets of profiled things... better be careful that this |
|---|
| 18 | * doesn't affect the offsets of anything else. |
|---|
| 19 | */ |
|---|
| 20 | |
|---|
| 21 | #define PROFILING |
|---|
| 22 | #define THREADED_RTS |
|---|
| 23 | |
|---|
| 24 | #include "PosixSource.h" |
|---|
| 25 | #include "Rts.h" |
|---|
| 26 | #include "Stable.h" |
|---|
| 27 | #include "Capability.h" |
|---|
| 28 | |
|---|
| 29 | #include <stdio.h> |
|---|
| 30 | |
|---|
| 31 | #define str(a,b) #a "_" #b |
|---|
| 32 | |
|---|
| 33 | #define OFFSET(s_type, field) ((size_t)&(((s_type*)0)->field)) |
|---|
| 34 | #define FIELD_SIZE(s_type, field) ((size_t)sizeof(((s_type*)0)->field)) |
|---|
| 35 | #define TYPE_SIZE(type) (sizeof(type)) |
|---|
| 36 | |
|---|
| 37 | #pragma GCC poison sizeof |
|---|
| 38 | |
|---|
| 39 | #if defined(GEN_HASKELL) |
|---|
| 40 | #define def_offset(str, offset) \ |
|---|
| 41 | printf("oFFSET_" str " :: Int\n"); \ |
|---|
| 42 | printf("oFFSET_" str " = %" FMT_SizeT "\n", (size_t)offset); |
|---|
| 43 | #else |
|---|
| 44 | #define def_offset(str, offset) \ |
|---|
| 45 | printf("#define OFFSET_" str " %" FMT_SizeT "\n", (size_t)offset); |
|---|
| 46 | #endif |
|---|
| 47 | |
|---|
| 48 | #if defined(GEN_HASKELL) |
|---|
| 49 | #define ctype(type) /* nothing */ |
|---|
| 50 | #else |
|---|
| 51 | #define ctype(type) \ |
|---|
| 52 | printf("#define SIZEOF_" #type " %" FMT_SizeT "\n", (size_t)TYPE_SIZE(type)); |
|---|
| 53 | #endif |
|---|
| 54 | |
|---|
| 55 | #if defined(GEN_HASKELL) |
|---|
| 56 | #define field_type_(str, s_type, field) /* nothing */ |
|---|
| 57 | #define field_type_gcptr_(str, s_type, field) /* nothing */ |
|---|
| 58 | #else |
|---|
| 59 | /* Defining REP_x to be b32 etc |
|---|
| 60 | These are both the C-- types used in a load |
|---|
| 61 | e.g. b32[addr] |
|---|
| 62 | and the names of the CmmTypes in the compiler |
|---|
| 63 | b32 :: CmmType |
|---|
| 64 | */ |
|---|
| 65 | #define field_type_(str, s_type, field) \ |
|---|
| 66 | printf("#define REP_" str " b"); \ |
|---|
| 67 | printf("%" FMT_SizeT "\n", FIELD_SIZE(s_type, field) * 8); |
|---|
| 68 | #define field_type_gcptr_(str, s_type, field) \ |
|---|
| 69 | printf("#define REP_" str " gcptr\n"); |
|---|
| 70 | #endif |
|---|
| 71 | |
|---|
| 72 | #define field_type(s_type, field) \ |
|---|
| 73 | field_type_(str(s_type,field),s_type,field); |
|---|
| 74 | |
|---|
| 75 | #define field_offset_(str, s_type, field) \ |
|---|
| 76 | def_offset(str, OFFSET(s_type,field)); |
|---|
| 77 | |
|---|
| 78 | #define field_offset(s_type, field) \ |
|---|
| 79 | field_offset_(str(s_type,field),s_type,field); |
|---|
| 80 | |
|---|
| 81 | /* An access macro for use in C-- sources. */ |
|---|
| 82 | #define struct_field_macro(str) \ |
|---|
| 83 | printf("#define " str "(__ptr__) REP_" str "[__ptr__+OFFSET_" str "]\n"); |
|---|
| 84 | |
|---|
| 85 | /* Outputs the byte offset and MachRep for a field */ |
|---|
| 86 | #define struct_field(s_type, field) \ |
|---|
| 87 | field_offset(s_type, field); \ |
|---|
| 88 | field_type(s_type, field); \ |
|---|
| 89 | struct_field_macro(str(s_type,field)) |
|---|
| 90 | |
|---|
| 91 | #define struct_field_(str, s_type, field) \ |
|---|
| 92 | field_offset_(str, s_type, field); \ |
|---|
| 93 | field_type_(str, s_type, field); \ |
|---|
| 94 | struct_field_macro(str) |
|---|
| 95 | |
|---|
| 96 | #if defined(GEN_HASKELL) |
|---|
| 97 | #define def_size(str, size) \ |
|---|
| 98 | printf("sIZEOF_" str " :: Int\n"); \ |
|---|
| 99 | printf("sIZEOF_" str " = %" FMT_SizeT "\n", (size_t)size); |
|---|
| 100 | #else |
|---|
| 101 | #define def_size(str, size) \ |
|---|
| 102 | printf("#define SIZEOF_" str " %" FMT_SizeT "\n", (size_t)size); |
|---|
| 103 | #endif |
|---|
| 104 | |
|---|
| 105 | #if defined(GEN_HASKELL) |
|---|
| 106 | #define def_closure_size(str, size) /* nothing */ |
|---|
| 107 | #else |
|---|
| 108 | #define def_closure_size(str, size) \ |
|---|
| 109 | printf("#define SIZEOF_" str " (SIZEOF_StgHeader+%" FMT_SizeT ")\n", (size_t)size); |
|---|
| 110 | #endif |
|---|
| 111 | |
|---|
| 112 | #define struct_size(s_type) \ |
|---|
| 113 | def_size(#s_type, TYPE_SIZE(s_type)); |
|---|
| 114 | |
|---|
| 115 | /* |
|---|
| 116 | * Size of a closure type, minus the header, named SIZEOF_<type>_NoHdr |
|---|
| 117 | * Also, we #define SIZEOF_<type> to be the size of the whole closure for .cmm. |
|---|
| 118 | */ |
|---|
| 119 | #define closure_size(s_type) \ |
|---|
| 120 | def_size(#s_type "_NoHdr", TYPE_SIZE(s_type) - TYPE_SIZE(StgHeader)); \ |
|---|
| 121 | def_closure_size(#s_type, TYPE_SIZE(s_type) - TYPE_SIZE(StgHeader)); |
|---|
| 122 | |
|---|
| 123 | #define thunk_size(s_type) \ |
|---|
| 124 | def_size(#s_type "_NoThunkHdr", TYPE_SIZE(s_type) - TYPE_SIZE(StgThunkHeader)); \ |
|---|
| 125 | closure_size(s_type) |
|---|
| 126 | |
|---|
| 127 | /* An access macro for use in C-- sources. */ |
|---|
| 128 | #define closure_field_macro(str) \ |
|---|
| 129 | printf("#define " str "(__ptr__) REP_" str "[__ptr__+SIZEOF_StgHeader+OFFSET_" str "]\n"); |
|---|
| 130 | |
|---|
| 131 | #define closure_field_offset_(str, s_type,field) \ |
|---|
| 132 | def_offset(str, OFFSET(s_type,field) - TYPE_SIZE(StgHeader)); |
|---|
| 133 | |
|---|
| 134 | #define closure_field_offset(s_type,field) \ |
|---|
| 135 | closure_field_offset_(str(s_type,field),s_type,field) |
|---|
| 136 | |
|---|
| 137 | #define closure_payload_macro(str) \ |
|---|
| 138 | printf("#define " str "(__ptr__,__ix__) W_[__ptr__+SIZEOF_StgHeader+OFFSET_" str " + WDS(__ix__)]\n"); |
|---|
| 139 | |
|---|
| 140 | #define closure_payload(s_type,field) \ |
|---|
| 141 | closure_field_offset_(str(s_type,field),s_type,field); \ |
|---|
| 142 | closure_payload_macro(str(s_type,field)); |
|---|
| 143 | |
|---|
| 144 | /* Byte offset and MachRep for a closure field, minus the header */ |
|---|
| 145 | #define closure_field_(str, s_type, field) \ |
|---|
| 146 | closure_field_offset_(str,s_type,field) \ |
|---|
| 147 | field_type_(str, s_type, field); \ |
|---|
| 148 | closure_field_macro(str) |
|---|
| 149 | |
|---|
| 150 | #define closure_field(s_type, field) \ |
|---|
| 151 | closure_field_(str(s_type,field),s_type,field) |
|---|
| 152 | |
|---|
| 153 | /* Byte offset and MachRep for a closure field, minus the header */ |
|---|
| 154 | #define closure_field_gcptr_(str, s_type, field) \ |
|---|
| 155 | closure_field_offset_(str,s_type,field) \ |
|---|
| 156 | field_type_gcptr_(str, s_type, field); \ |
|---|
| 157 | closure_field_macro(str) |
|---|
| 158 | |
|---|
| 159 | #define closure_field_gcptr(s_type, field) \ |
|---|
| 160 | closure_field_gcptr_(str(s_type,field),s_type,field) |
|---|
| 161 | |
|---|
| 162 | /* Byte offset for a TSO field, minus the header and variable prof bit. */ |
|---|
| 163 | #define tso_payload_offset(s_type, field) \ |
|---|
| 164 | def_offset(str(s_type,field), OFFSET(s_type,field) - TYPE_SIZE(StgHeader) - TYPE_SIZE(StgTSOProfInfo)); |
|---|
| 165 | |
|---|
| 166 | /* Full byte offset for a TSO field, for use from Cmm */ |
|---|
| 167 | #define tso_field_offset_macro(str) \ |
|---|
| 168 | printf("#define TSO_OFFSET_" str " (SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+OFFSET_" str ")\n"); |
|---|
| 169 | |
|---|
| 170 | #define tso_field_offset(s_type, field) \ |
|---|
| 171 | tso_payload_offset(s_type, field); \ |
|---|
| 172 | tso_field_offset_macro(str(s_type,field)); |
|---|
| 173 | |
|---|
| 174 | #define tso_field_macro(str) \ |
|---|
| 175 | printf("#define " str "(__ptr__) REP_" str "[__ptr__+TSO_OFFSET_" str "]\n") |
|---|
| 176 | #define tso_field(s_type, field) \ |
|---|
| 177 | field_type(s_type, field); \ |
|---|
| 178 | tso_field_offset(s_type,field); \ |
|---|
| 179 | tso_field_macro(str(s_type,field)) |
|---|
| 180 | |
|---|
| 181 | #define opt_struct_size(s_type, option) \ |
|---|
| 182 | printf("#ifdef " #option "\n"); \ |
|---|
| 183 | printf("#define SIZEOF_OPT_" #s_type " SIZEOF_" #s_type "\n"); \ |
|---|
| 184 | printf("#else\n"); \ |
|---|
| 185 | printf("#define SIZEOF_OPT_" #s_type " 0\n"); \ |
|---|
| 186 | printf("#endif\n\n"); |
|---|
| 187 | |
|---|
| 188 | #define FUN_OFFSET(sym) (OFFSET(Capability,f.sym) - OFFSET(Capability,r)) |
|---|
| 189 | |
|---|
| 190 | |
|---|
| 191 | int |
|---|
| 192 | main(int argc, char *argv[]) |
|---|
| 193 | { |
|---|
| 194 | #ifndef GEN_HASKELL |
|---|
| 195 | printf("/* This file is created automatically. Do not edit by hand.*/\n\n"); |
|---|
| 196 | |
|---|
| 197 | printf("#define STD_HDR_SIZE %" FMT_SizeT "\n", (size_t)sizeofW(StgHeader) - sizeofW(StgProfHeader)); |
|---|
| 198 | /* grrr.. PROFILING is on so we need to subtract sizeofW(StgProfHeader) */ |
|---|
| 199 | printf("#define PROF_HDR_SIZE %" FMT_SizeT "\n", (size_t)sizeofW(StgProfHeader)); |
|---|
| 200 | |
|---|
| 201 | printf("#define BLOCK_SIZE %u\n", BLOCK_SIZE); |
|---|
| 202 | printf("#define MBLOCK_SIZE %u\n", MBLOCK_SIZE); |
|---|
| 203 | printf("#define BLOCKS_PER_MBLOCK %" FMT_SizeT "\n", (lnat)BLOCKS_PER_MBLOCK); |
|---|
| 204 | // could be derived, but better to save doing the calculation twice |
|---|
| 205 | |
|---|
| 206 | printf("\n\n"); |
|---|
| 207 | #endif |
|---|
| 208 | |
|---|
| 209 | field_offset(StgRegTable, rR1); |
|---|
| 210 | field_offset(StgRegTable, rR2); |
|---|
| 211 | field_offset(StgRegTable, rR3); |
|---|
| 212 | field_offset(StgRegTable, rR4); |
|---|
| 213 | field_offset(StgRegTable, rR5); |
|---|
| 214 | field_offset(StgRegTable, rR6); |
|---|
| 215 | field_offset(StgRegTable, rR7); |
|---|
| 216 | field_offset(StgRegTable, rR8); |
|---|
| 217 | field_offset(StgRegTable, rR9); |
|---|
| 218 | field_offset(StgRegTable, rR10); |
|---|
| 219 | field_offset(StgRegTable, rF1); |
|---|
| 220 | field_offset(StgRegTable, rF2); |
|---|
| 221 | field_offset(StgRegTable, rF3); |
|---|
| 222 | field_offset(StgRegTable, rF4); |
|---|
| 223 | field_offset(StgRegTable, rD1); |
|---|
| 224 | field_offset(StgRegTable, rD2); |
|---|
| 225 | field_offset(StgRegTable, rL1); |
|---|
| 226 | field_offset(StgRegTable, rSp); |
|---|
| 227 | field_offset(StgRegTable, rSpLim); |
|---|
| 228 | field_offset(StgRegTable, rHp); |
|---|
| 229 | field_offset(StgRegTable, rHpLim); |
|---|
| 230 | field_offset(StgRegTable, rCCCS); |
|---|
| 231 | field_offset(StgRegTable, rCurrentTSO); |
|---|
| 232 | field_offset(StgRegTable, rCurrentNursery); |
|---|
| 233 | field_offset(StgRegTable, rHpAlloc); |
|---|
| 234 | struct_field(StgRegTable, rRet); |
|---|
| 235 | struct_field(StgRegTable, rNursery); |
|---|
| 236 | |
|---|
| 237 | def_offset("stgEagerBlackholeInfo", FUN_OFFSET(stgEagerBlackholeInfo)); |
|---|
| 238 | def_offset("stgGCEnter1", FUN_OFFSET(stgGCEnter1)); |
|---|
| 239 | def_offset("stgGCFun", FUN_OFFSET(stgGCFun)); |
|---|
| 240 | |
|---|
| 241 | field_offset(Capability, r); |
|---|
| 242 | field_offset(Capability, lock); |
|---|
| 243 | struct_field(Capability, no); |
|---|
| 244 | struct_field(Capability, mut_lists); |
|---|
| 245 | struct_field(Capability, context_switch); |
|---|
| 246 | struct_field(Capability, interrupt); |
|---|
| 247 | struct_field(Capability, sparks); |
|---|
| 248 | |
|---|
| 249 | struct_field(bdescr, start); |
|---|
| 250 | struct_field(bdescr, free); |
|---|
| 251 | struct_field(bdescr, blocks); |
|---|
| 252 | struct_field(bdescr, gen_no); |
|---|
| 253 | struct_field(bdescr, link); |
|---|
| 254 | |
|---|
| 255 | struct_size(generation); |
|---|
| 256 | struct_field(generation, n_new_large_words); |
|---|
| 257 | |
|---|
| 258 | struct_size(CostCentreStack); |
|---|
| 259 | struct_field(CostCentreStack, ccsID); |
|---|
| 260 | struct_field(CostCentreStack, mem_alloc); |
|---|
| 261 | struct_field(CostCentreStack, scc_count); |
|---|
| 262 | struct_field(CostCentreStack, prevStack); |
|---|
| 263 | |
|---|
| 264 | struct_field(CostCentre, ccID); |
|---|
| 265 | struct_field(CostCentre, link); |
|---|
| 266 | |
|---|
| 267 | struct_field(StgHeader, info); |
|---|
| 268 | struct_field_("StgHeader_ccs", StgHeader, prof.ccs); |
|---|
| 269 | struct_field_("StgHeader_ldvw", StgHeader, prof.hp.ldvw); |
|---|
| 270 | |
|---|
| 271 | struct_size(StgSMPThunkHeader); |
|---|
| 272 | |
|---|
| 273 | closure_payload(StgClosure,payload); |
|---|
| 274 | |
|---|
| 275 | struct_field(StgEntCounter, allocs); |
|---|
| 276 | struct_field(StgEntCounter, registeredp); |
|---|
| 277 | struct_field(StgEntCounter, link); |
|---|
| 278 | struct_field(StgEntCounter, entry_count); |
|---|
| 279 | |
|---|
| 280 | closure_size(StgUpdateFrame); |
|---|
| 281 | closure_size(StgCatchFrame); |
|---|
| 282 | closure_size(StgStopFrame); |
|---|
| 283 | |
|---|
| 284 | closure_size(StgMutArrPtrs); |
|---|
| 285 | closure_field(StgMutArrPtrs, ptrs); |
|---|
| 286 | closure_field(StgMutArrPtrs, size); |
|---|
| 287 | |
|---|
| 288 | closure_size(StgArrWords); |
|---|
| 289 | closure_field(StgArrWords, bytes); |
|---|
| 290 | closure_payload(StgArrWords, payload); |
|---|
| 291 | |
|---|
| 292 | closure_field(StgTSO, _link); |
|---|
| 293 | closure_field(StgTSO, global_link); |
|---|
| 294 | closure_field(StgTSO, what_next); |
|---|
| 295 | closure_field(StgTSO, why_blocked); |
|---|
| 296 | closure_field(StgTSO, block_info); |
|---|
| 297 | closure_field(StgTSO, blocked_exceptions); |
|---|
| 298 | closure_field(StgTSO, id); |
|---|
| 299 | closure_field(StgTSO, cap); |
|---|
| 300 | closure_field(StgTSO, saved_errno); |
|---|
| 301 | closure_field(StgTSO, trec); |
|---|
| 302 | closure_field(StgTSO, flags); |
|---|
| 303 | closure_field(StgTSO, dirty); |
|---|
| 304 | closure_field(StgTSO, bq); |
|---|
| 305 | closure_field_("StgTSO_cccs", StgTSO, prof.cccs); |
|---|
| 306 | closure_field(StgTSO, stackobj); |
|---|
| 307 | |
|---|
| 308 | closure_field(StgStack, sp); |
|---|
| 309 | closure_field_offset(StgStack, stack); |
|---|
| 310 | closure_field(StgStack, stack_size); |
|---|
| 311 | closure_field(StgStack, dirty); |
|---|
| 312 | |
|---|
| 313 | struct_size(StgTSOProfInfo); |
|---|
| 314 | |
|---|
| 315 | opt_struct_size(StgTSOProfInfo,PROFILING); |
|---|
| 316 | |
|---|
| 317 | closure_field(StgUpdateFrame, updatee); |
|---|
| 318 | |
|---|
| 319 | closure_field(StgCatchFrame, handler); |
|---|
| 320 | closure_field(StgCatchFrame, exceptions_blocked); |
|---|
| 321 | |
|---|
| 322 | closure_size(StgPAP); |
|---|
| 323 | closure_field(StgPAP, n_args); |
|---|
| 324 | closure_field_gcptr(StgPAP, fun); |
|---|
| 325 | closure_field(StgPAP, arity); |
|---|
| 326 | closure_payload(StgPAP, payload); |
|---|
| 327 | |
|---|
| 328 | thunk_size(StgAP); |
|---|
| 329 | closure_field(StgAP, n_args); |
|---|
| 330 | closure_field_gcptr(StgAP, fun); |
|---|
| 331 | closure_payload(StgAP, payload); |
|---|
| 332 | |
|---|
| 333 | thunk_size(StgAP_STACK); |
|---|
| 334 | closure_field(StgAP_STACK, size); |
|---|
| 335 | closure_field_gcptr(StgAP_STACK, fun); |
|---|
| 336 | closure_payload(StgAP_STACK, payload); |
|---|
| 337 | |
|---|
| 338 | thunk_size(StgSelector); |
|---|
| 339 | |
|---|
| 340 | closure_field_gcptr(StgInd, indirectee); |
|---|
| 341 | |
|---|
| 342 | closure_size(StgMutVar); |
|---|
| 343 | closure_field(StgMutVar, var); |
|---|
| 344 | |
|---|
| 345 | closure_size(StgAtomicallyFrame); |
|---|
| 346 | closure_field(StgAtomicallyFrame, code); |
|---|
| 347 | closure_field(StgAtomicallyFrame, next_invariant_to_check); |
|---|
| 348 | closure_field(StgAtomicallyFrame, result); |
|---|
| 349 | |
|---|
| 350 | closure_field(StgInvariantCheckQueue, invariant); |
|---|
| 351 | closure_field(StgInvariantCheckQueue, my_execution); |
|---|
| 352 | closure_field(StgInvariantCheckQueue, next_queue_entry); |
|---|
| 353 | |
|---|
| 354 | closure_field(StgAtomicInvariant, code); |
|---|
| 355 | |
|---|
| 356 | closure_field(StgTRecHeader, enclosing_trec); |
|---|
| 357 | |
|---|
| 358 | closure_size(StgCatchSTMFrame); |
|---|
| 359 | closure_field(StgCatchSTMFrame, handler); |
|---|
| 360 | closure_field(StgCatchSTMFrame, code); |
|---|
| 361 | |
|---|
| 362 | closure_size(StgCatchRetryFrame); |
|---|
| 363 | closure_field(StgCatchRetryFrame, running_alt_code); |
|---|
| 364 | closure_field(StgCatchRetryFrame, first_code); |
|---|
| 365 | closure_field(StgCatchRetryFrame, alt_code); |
|---|
| 366 | |
|---|
| 367 | closure_field(StgTVarWatchQueue, closure); |
|---|
| 368 | closure_field(StgTVarWatchQueue, next_queue_entry); |
|---|
| 369 | closure_field(StgTVarWatchQueue, prev_queue_entry); |
|---|
| 370 | |
|---|
| 371 | closure_field(StgTVar, current_value); |
|---|
| 372 | |
|---|
| 373 | closure_size(StgWeak); |
|---|
| 374 | closure_field(StgWeak,link); |
|---|
| 375 | closure_field(StgWeak,key); |
|---|
| 376 | closure_field(StgWeak,value); |
|---|
| 377 | closure_field(StgWeak,finalizer); |
|---|
| 378 | closure_field(StgWeak,cfinalizer); |
|---|
| 379 | |
|---|
| 380 | closure_size(StgDeadWeak); |
|---|
| 381 | closure_field(StgDeadWeak,link); |
|---|
| 382 | |
|---|
| 383 | closure_size(StgMVar); |
|---|
| 384 | closure_field(StgMVar,head); |
|---|
| 385 | closure_field(StgMVar,tail); |
|---|
| 386 | closure_field(StgMVar,value); |
|---|
| 387 | |
|---|
| 388 | closure_size(StgMVarTSOQueue); |
|---|
| 389 | closure_field(StgMVarTSOQueue, link); |
|---|
| 390 | closure_field(StgMVarTSOQueue, tso); |
|---|
| 391 | |
|---|
| 392 | closure_size(StgBCO); |
|---|
| 393 | closure_field(StgBCO, instrs); |
|---|
| 394 | closure_field(StgBCO, literals); |
|---|
| 395 | closure_field(StgBCO, ptrs); |
|---|
| 396 | closure_field(StgBCO, arity); |
|---|
| 397 | closure_field(StgBCO, size); |
|---|
| 398 | closure_payload(StgBCO, bitmap); |
|---|
| 399 | |
|---|
| 400 | closure_size(StgStableName); |
|---|
| 401 | closure_field(StgStableName,sn); |
|---|
| 402 | |
|---|
| 403 | closure_size(StgBlockingQueue); |
|---|
| 404 | closure_field(StgBlockingQueue, bh); |
|---|
| 405 | closure_field(StgBlockingQueue, owner); |
|---|
| 406 | closure_field(StgBlockingQueue, queue); |
|---|
| 407 | closure_field(StgBlockingQueue, link); |
|---|
| 408 | |
|---|
| 409 | closure_size(MessageBlackHole); |
|---|
| 410 | closure_field(MessageBlackHole, link); |
|---|
| 411 | closure_field(MessageBlackHole, tso); |
|---|
| 412 | closure_field(MessageBlackHole, bh); |
|---|
| 413 | |
|---|
| 414 | struct_field_("RtsFlags_ProfFlags_showCCSOnException", |
|---|
| 415 | RTS_FLAGS, ProfFlags.showCCSOnException); |
|---|
| 416 | struct_field_("RtsFlags_DebugFlags_apply", |
|---|
| 417 | RTS_FLAGS, DebugFlags.apply); |
|---|
| 418 | struct_field_("RtsFlags_DebugFlags_sanity", |
|---|
| 419 | RTS_FLAGS, DebugFlags.sanity); |
|---|
| 420 | struct_field_("RtsFlags_DebugFlags_weak", |
|---|
| 421 | RTS_FLAGS, DebugFlags.weak); |
|---|
| 422 | struct_field_("RtsFlags_GcFlags_initialStkSize", |
|---|
| 423 | RTS_FLAGS, GcFlags.initialStkSize); |
|---|
| 424 | struct_field_("RtsFlags_MiscFlags_tickInterval", |
|---|
| 425 | RTS_FLAGS, MiscFlags.tickInterval); |
|---|
| 426 | |
|---|
| 427 | struct_size(StgFunInfoExtraFwd); |
|---|
| 428 | struct_field(StgFunInfoExtraFwd, slow_apply); |
|---|
| 429 | struct_field(StgFunInfoExtraFwd, fun_type); |
|---|
| 430 | struct_field(StgFunInfoExtraFwd, arity); |
|---|
| 431 | struct_field_("StgFunInfoExtraFwd_bitmap", StgFunInfoExtraFwd, b.bitmap); |
|---|
| 432 | |
|---|
| 433 | struct_size(StgFunInfoExtraRev); |
|---|
| 434 | struct_field(StgFunInfoExtraRev, slow_apply_offset); |
|---|
| 435 | struct_field(StgFunInfoExtraRev, fun_type); |
|---|
| 436 | struct_field(StgFunInfoExtraRev, arity); |
|---|
| 437 | struct_field_("StgFunInfoExtraRev_bitmap", StgFunInfoExtraRev, b.bitmap); |
|---|
| 438 | |
|---|
| 439 | struct_field(StgLargeBitmap, size); |
|---|
| 440 | field_offset(StgLargeBitmap, bitmap); |
|---|
| 441 | |
|---|
| 442 | struct_size(snEntry); |
|---|
| 443 | struct_field(snEntry,sn_obj); |
|---|
| 444 | struct_field(snEntry,addr); |
|---|
| 445 | |
|---|
| 446 | #ifdef mingw32_HOST_OS |
|---|
| 447 | struct_size(StgAsyncIOResult); |
|---|
| 448 | struct_field(StgAsyncIOResult, reqID); |
|---|
| 449 | struct_field(StgAsyncIOResult, len); |
|---|
| 450 | struct_field(StgAsyncIOResult, errCode); |
|---|
| 451 | #endif |
|---|
| 452 | |
|---|
| 453 | return 0; |
|---|
| 454 | } |
|---|