MiscClosures.h 18.1 KB
Newer Older
1 2
/* ----------------------------------------------------------------------------
 *
3
 * (c) The GHC Team, 1998-2009
4
 *
5
 * Declarations for various symbols exported by the RTS.
6
 *
7 8 9
 * ToDo: many of the symbols in here don't need to be exported, but
 * our Cmm code generator doesn't know how to generate local symbols
 * for the RTS bits (it assumes all RTS symbols are external).
10
 *
11 12
 * See wiki:Commentary/Compiler/Backends/PprC#Prototypes
 *
13 14 15 16 17
 * Do not #include this file directly: #include "Rts.h" instead.
 *
 * To understand the structure of the RTS headers, see the wiki:
 *   http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
 *
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
 * --------------------------------------------------------------------------*/

#ifndef STGMISCCLOSURES_H
#define STGMISCCLOSURES_H

#if IN_STG_CODE
#  define RTS_RET_INFO(i)   extern W_(i)[]
#  define RTS_FUN_INFO(i)   extern W_(i)[]
#  define RTS_THUNK_INFO(i) extern W_(i)[]
#  define RTS_INFO(i)       extern W_(i)[]
#  define RTS_CLOSURE(i)    extern W_(i)[]
#  define RTS_FUN(f)	    extern DLL_IMPORT_RTS StgFunPtr f(void)
#else
#  define RTS_RET_INFO(i)   extern DLL_IMPORT_RTS const StgRetInfoTable i
#  define RTS_FUN_INFO(i)   extern DLL_IMPORT_RTS const StgFunInfoTable i
#  define RTS_THUNK_INFO(i) extern DLL_IMPORT_RTS const StgThunkInfoTable i
#  define RTS_INFO(i)       extern DLL_IMPORT_RTS const StgInfoTable i
#  define RTS_CLOSURE(i)    extern DLL_IMPORT_RTS StgClosure i
#  define RTS_FUN(f)	    extern DLL_IMPORT_RTS StgFunPtr f(void)
#endif
38

39 40 41 42 43
#ifdef TABLES_NEXT_TO_CODE
#  define RTS_ENTRY(f)    /* nothing */
#else
#  define RTS_ENTRY(f)    RTS_FUN(f)
#endif
44

45 46
/* Stack frames */
RTS_RET_INFO(stg_upd_frame_info);
47
RTS_RET_INFO(stg_bh_upd_frame_info);
48
RTS_RET_INFO(stg_marked_upd_frame_info);
49 50
RTS_RET_INFO(stg_noupd_frame_info);
RTS_RET_INFO(stg_catch_frame_info);
51 52
RTS_RET_INFO(stg_catch_retry_frame_info);
RTS_RET_INFO(stg_atomically_frame_info);
53
RTS_RET_INFO(stg_atomically_waiting_frame_info);
54
RTS_RET_INFO(stg_catch_stm_frame_info);
Simon Marlow's avatar
Simon Marlow committed
55
RTS_RET_INFO(stg_unblockAsyncExceptionszh_ret_info);
56 57

RTS_ENTRY(stg_upd_frame_ret);
58
RTS_ENTRY(stg_bh_upd_frame_ret);
59
RTS_ENTRY(stg_marked_upd_frame_ret);
60

61 62 63 64 65 66
// RTS_FUN(stg_interp_constr_entry);
//
// This is referenced using the FFI in the compiler (ByteCodeItbls),
// so we can't give it the correct type here because the prototypes
// would clash (FFI references are always declared with type StgWord[]
// in the generated C code).
67 68

/* Magic glue code for when compiled code returns a value in R1/F1/D1
69
   or a VoidRep to the interpreter. */
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
RTS_RET_INFO(stg_ctoi_R1p_info);
RTS_RET_INFO(stg_ctoi_R1unpt_info);
RTS_RET_INFO(stg_ctoi_R1n_info);
RTS_RET_INFO(stg_ctoi_F1_info);
RTS_RET_INFO(stg_ctoi_D1_info);
RTS_RET_INFO(stg_ctoi_L1_info);
RTS_RET_INFO(stg_ctoi_V_info);

RTS_ENTRY(stg_ctoi_R1p_ret);
RTS_ENTRY(stg_ctoi_R1unpt_ret);
RTS_ENTRY(stg_ctoi_R1n_ret);
RTS_ENTRY(stg_ctoi_F1_ret);
RTS_ENTRY(stg_ctoi_D1_ret);
RTS_ENTRY(stg_ctoi_L1_ret);
RTS_ENTRY(stg_ctoi_V_ret);

RTS_RET_INFO(stg_apply_interp_info);
RTS_ENTRY(stg_apply_interp_ret);

RTS_INFO(stg_IND_info);
RTS_INFO(stg_IND_direct_info);
RTS_INFO(stg_IND_STATIC_info);
RTS_INFO(stg_IND_PERM_info);
RTS_INFO(stg_IND_OLDGEN_info);
RTS_INFO(stg_IND_OLDGEN_PERM_info);
RTS_INFO(stg_BLACKHOLE_info);
RTS_INFO(stg_CAF_BLACKHOLE_info);
97 98 99 100
RTS_INFO(__stg_EAGER_BLACKHOLE_info);
RTS_INFO(stg_WHITEHOLE_info);
RTS_INFO(stg_BLOCKING_QUEUE_CLEAN_info);
RTS_INFO(stg_BLOCKING_QUEUE_DIRTY_info);
101 102 103 104 105 106

RTS_FUN_INFO(stg_BCO_info);
RTS_INFO(stg_EVACUATED_info);
RTS_INFO(stg_WEAK_info);
RTS_INFO(stg_DEAD_WEAK_info);
RTS_INFO(stg_STABLE_NAME_info);
107 108
RTS_INFO(stg_MVAR_CLEAN_info);
RTS_INFO(stg_MVAR_DIRTY_info);
109 110 111
RTS_INFO(stg_TSO_info);
RTS_INFO(stg_ARR_WORDS_info);
RTS_INFO(stg_MUT_ARR_WORDS_info);
112 113
RTS_INFO(stg_MUT_ARR_PTRS_CLEAN_info);
RTS_INFO(stg_MUT_ARR_PTRS_DIRTY_info);
114
RTS_INFO(stg_MUT_ARR_PTRS_FROZEN_info);
115
RTS_INFO(stg_MUT_ARR_PTRS_FROZEN0_info);
116 117
RTS_INFO(stg_MUT_VAR_CLEAN_info);
RTS_INFO(stg_MUT_VAR_DIRTY_info);
118
RTS_INFO(stg_END_TSO_QUEUE_info);
119
RTS_INFO(stg_MSG_WAKEUP_info);
120
RTS_INFO(stg_MSG_TRY_WAKEUP_info);
121
RTS_INFO(stg_MSG_THROWTO_info);
122
RTS_INFO(stg_MSG_BLACKHOLE_info);
123
RTS_INFO(stg_MSG_NULL_info);
124 125 126
RTS_INFO(stg_catch_info);
RTS_INFO(stg_PAP_info);
RTS_INFO(stg_AP_info);
127
RTS_INFO(stg_AP_NOUPD_info);
128 129 130
RTS_INFO(stg_AP_STACK_info);
RTS_INFO(stg_dummy_ret_info);
RTS_INFO(stg_raise_info);
131
RTS_INFO(stg_raise_ret_info);
tharris@microsoft.com's avatar
tharris@microsoft.com committed
132 133 134
RTS_INFO(stg_TVAR_WATCH_QUEUE_info);
RTS_INFO(stg_INVARIANT_CHECK_QUEUE_info);
RTS_INFO(stg_ATOMIC_INVARIANT_info);
135 136 137
RTS_INFO(stg_TVAR_info);
RTS_INFO(stg_TREC_CHUNK_info);
RTS_INFO(stg_TREC_HEADER_info);
tharris@microsoft.com's avatar
tharris@microsoft.com committed
138 139
RTS_INFO(stg_END_STM_WATCH_QUEUE_info);
RTS_INFO(stg_END_INVARIANT_CHECK_QUEUE_info);
140 141
RTS_INFO(stg_END_STM_CHUNK_LIST_info);
RTS_INFO(stg_NO_TREC_info);
142 143 144 145 146 147 148

RTS_ENTRY(stg_IND_entry);
RTS_ENTRY(stg_IND_direct_entry);
RTS_ENTRY(stg_IND_STATIC_entry);
RTS_ENTRY(stg_IND_PERM_entry);
RTS_ENTRY(stg_IND_OLDGEN_entry);
RTS_ENTRY(stg_IND_OLDGEN_PERM_entry);
149
RTS_ENTRY(stg_WHITEHOLE_entry);
150 151
RTS_ENTRY(stg_BLACKHOLE_entry);
RTS_ENTRY(stg_CAF_BLACKHOLE_entry);
152
RTS_ENTRY(__stg_EAGER_BLACKHOLE_entry);
153 154 155 156 157 158 159 160 161 162
RTS_ENTRY(stg_BCO_entry);
RTS_ENTRY(stg_EVACUATED_entry);
RTS_ENTRY(stg_WEAK_entry);
RTS_ENTRY(stg_DEAD_WEAK_entry);
RTS_ENTRY(stg_STABLE_NAME_entry);
RTS_ENTRY(stg_FULL_MVAR_entry);
RTS_ENTRY(stg_EMPTY_MVAR_entry);
RTS_ENTRY(stg_TSO_entry);
RTS_ENTRY(stg_ARR_WORDS_entry);
RTS_ENTRY(stg_MUT_ARR_WORDS_entry);
163 164
RTS_ENTRY(stg_MUT_ARR_PTRS_CLEAN_entry);
RTS_ENTRY(stg_MUT_ARR_PTRS_DIRTY_entry);
165
RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_entry);
166
RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN0_entry);
167 168
RTS_ENTRY(stg_MUT_VAR_CLEAN_entry);
RTS_ENTRY(stg_MUT_VAR_DIRTY_entry);
169
RTS_ENTRY(stg_END_TSO_QUEUE_entry);
170
RTS_ENTRY(stg_MSG_WAKEUP_entry);
171
RTS_ENTRY(stg_MSG_TRY_WAKEUP_entry);
172
RTS_ENTRY(stg_MSG_THROWTO_entry);
173
RTS_ENTRY(stg_MSG_BLACKHOLE_entry);
174
RTS_ENTRY(stg_MSG_NULL_entry);
175 176 177
RTS_ENTRY(stg_catch_entry);
RTS_ENTRY(stg_PAP_entry);
RTS_ENTRY(stg_AP_entry);
178
RTS_ENTRY(stg_AP_NOUPD_entry);
179 180 181
RTS_ENTRY(stg_AP_STACK_entry);
RTS_ENTRY(stg_dummy_ret_entry);
RTS_ENTRY(stg_raise_entry);
Simon Marlow's avatar
Simon Marlow committed
182
RTS_ENTRY(stg_raise_ret_ret);
tharris@microsoft.com's avatar
tharris@microsoft.com committed
183 184
RTS_ENTRY(stg_END_STM_WATCH_QUEUE_entry);
RTS_ENTRY(stg_END_INVARIANT_CHECK_QUEUE_entry);
185 186
RTS_ENTRY(stg_END_STM_CHUNK_LIST_entry);
RTS_ENTRY(stg_NO_TREC_entry);
187
RTS_ENTRY(stg_TVAR_entry);
tharris@microsoft.com's avatar
tharris@microsoft.com committed
188 189 190
RTS_ENTRY(stg_TVAR_WATCH_QUEUE_entry);
RTS_ENTRY(stg_INVARIANT_CHECK_QUEUE_entry);
RTS_ENTRY(stg_ATOMIC_INVARIANT_entry);
191 192
RTS_ENTRY(stg_TREC_CHUNK_entry);
RTS_ENTRY(stg_TREC_HEADER_entry);
193 194 195 196 197


RTS_ENTRY(stg_unblockAsyncExceptionszh_ret_ret);
RTS_ENTRY(stg_blockAsyncExceptionszh_ret_ret);
RTS_ENTRY(stg_catch_frame_ret);
198 199
RTS_ENTRY(stg_catch_retry_frame_ret);
RTS_ENTRY(stg_atomically_frame_ret);
200
RTS_ENTRY(stg_atomically_waiting_frame_ret);
201
RTS_ENTRY(stg_catch_stm_frame_ret);
202

203 204
/* closures */

205 206 207 208 209
RTS_CLOSURE(stg_END_TSO_QUEUE_closure);
RTS_CLOSURE(stg_NO_FINALIZER_closure);
RTS_CLOSURE(stg_dummy_ret_closure);
RTS_CLOSURE(stg_forceIO_closure);

tharris@microsoft.com's avatar
tharris@microsoft.com committed
210 211
RTS_CLOSURE(stg_END_STM_WATCH_QUEUE_closure);
RTS_CLOSURE(stg_END_INVARIANT_CHECK_QUEUE_closure);
212 213 214
RTS_CLOSURE(stg_END_STM_CHUNK_LIST_closure);
RTS_CLOSURE(stg_NO_TREC_closure);

215
RTS_ENTRY(stg_NO_FINALIZER_entry);
216

217 218 219 220
#if IN_STG_CODE
extern DLL_IMPORT_RTS StgWordArray stg_CHARLIKE_closure;
extern DLL_IMPORT_RTS StgWordArray stg_INTLIKE_closure;
#else
221 222
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_closure[];
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_closure[];
223 224 225 226 227 228
#endif

/* StgStartup */

RTS_RET_INFO(stg_forceIO_info);
RTS_ENTRY(stg_forceIO_ret);
229

230 231
RTS_RET_INFO(stg_noforceIO_info);
RTS_ENTRY(stg_noforceIO_ret);
232

233
/* standard entry points */
234

235 236
/* standard selector thunks */

237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
RTS_ENTRY(stg_sel_ret_0_upd_ret);
RTS_ENTRY(stg_sel_ret_1_upd_ret);
RTS_ENTRY(stg_sel_ret_2_upd_ret);
RTS_ENTRY(stg_sel_ret_3_upd_ret);
RTS_ENTRY(stg_sel_ret_4_upd_ret);
RTS_ENTRY(stg_sel_ret_5_upd_ret);
RTS_ENTRY(stg_sel_ret_6_upd_ret);
RTS_ENTRY(stg_sel_ret_7_upd_ret);
RTS_ENTRY(stg_sel_ret_8_upd_ret);
RTS_ENTRY(stg_sel_ret_9_upd_ret);
RTS_ENTRY(stg_sel_ret_10_upd_ret);
RTS_ENTRY(stg_sel_ret_11_upd_ret);
RTS_ENTRY(stg_sel_ret_12_upd_ret);
RTS_ENTRY(stg_sel_ret_13_upd_ret);
RTS_ENTRY(stg_sel_ret_14_upd_ret);
RTS_ENTRY(stg_sel_ret_15_upd_ret);

RTS_INFO(stg_sel_0_upd_info);
RTS_INFO(stg_sel_1_upd_info);
RTS_INFO(stg_sel_2_upd_info);
RTS_INFO(stg_sel_3_upd_info);
RTS_INFO(stg_sel_4_upd_info);
RTS_INFO(stg_sel_5_upd_info);
RTS_INFO(stg_sel_6_upd_info);
RTS_INFO(stg_sel_7_upd_info);
RTS_INFO(stg_sel_8_upd_info);
RTS_INFO(stg_sel_9_upd_info);
RTS_INFO(stg_sel_10_upd_info);
RTS_INFO(stg_sel_11_upd_info);
RTS_INFO(stg_sel_12_upd_info);
RTS_INFO(stg_sel_13_upd_info);
RTS_INFO(stg_sel_14_upd_info);
RTS_INFO(stg_sel_15_upd_info);

RTS_ENTRY(stg_sel_0_upd_entry);
RTS_ENTRY(stg_sel_1_upd_entry);
RTS_ENTRY(stg_sel_2_upd_entry);
RTS_ENTRY(stg_sel_3_upd_entry);
RTS_ENTRY(stg_sel_4_upd_entry);
RTS_ENTRY(stg_sel_5_upd_entry);
RTS_ENTRY(stg_sel_6_upd_entry);
RTS_ENTRY(stg_sel_7_upd_entry);
RTS_ENTRY(stg_sel_8_upd_entry);
RTS_ENTRY(stg_sel_9_upd_entry);
RTS_ENTRY(stg_sel_10_upd_entry);
RTS_ENTRY(stg_sel_11_upd_entry);
RTS_ENTRY(stg_sel_12_upd_entry);
RTS_ENTRY(stg_sel_13_upd_entry);
RTS_ENTRY(stg_sel_14_upd_entry);
RTS_ENTRY(stg_sel_15_upd_entry);

RTS_ENTRY(stg_sel_ret_0_noupd_ret);
RTS_ENTRY(stg_sel_ret_1_noupd_ret);
RTS_ENTRY(stg_sel_ret_2_noupd_ret);
RTS_ENTRY(stg_sel_ret_3_noupd_ret);
RTS_ENTRY(stg_sel_ret_4_noupd_ret);
RTS_ENTRY(stg_sel_ret_5_noupd_ret);
RTS_ENTRY(stg_sel_ret_6_noupd_ret);
RTS_ENTRY(stg_sel_ret_7_noupd_ret);
RTS_ENTRY(stg_sel_ret_8_noupd_ret);
RTS_ENTRY(stg_sel_ret_9_noupd_ret);
RTS_ENTRY(stg_sel_ret_10_noupd_ret);
RTS_ENTRY(stg_sel_ret_11_noupd_ret);
RTS_ENTRY(stg_sel_ret_12_noupd_ret);
RTS_ENTRY(stg_sel_ret_13_noupd_ret);
RTS_ENTRY(stg_sel_ret_14_noupd_ret);
RTS_ENTRY(stg_sel_ret_15_noupd_ret);

RTS_INFO(stg_sel_0_noupd_info);
RTS_INFO(stg_sel_1_noupd_info);
RTS_INFO(stg_sel_2_noupd_info);
RTS_INFO(stg_sel_3_noupd_info);
RTS_INFO(stg_sel_4_noupd_info);
RTS_INFO(stg_sel_5_noupd_info);
RTS_INFO(stg_sel_6_noupd_info);
RTS_INFO(stg_sel_7_noupd_info);
RTS_INFO(stg_sel_8_noupd_info);
RTS_INFO(stg_sel_9_noupd_info);
RTS_INFO(stg_sel_10_noupd_info);
RTS_INFO(stg_sel_11_noupd_info);
RTS_INFO(stg_sel_12_noupd_info);
RTS_INFO(stg_sel_13_noupd_info);
RTS_INFO(stg_sel_14_noupd_info);
RTS_INFO(stg_sel_15_noupd_info);

RTS_ENTRY(stg_sel_0_noupd_entry);
RTS_ENTRY(stg_sel_1_noupd_entry);
RTS_ENTRY(stg_sel_2_noupd_entry);
RTS_ENTRY(stg_sel_3_noupd_entry);
RTS_ENTRY(stg_sel_4_noupd_entry);
RTS_ENTRY(stg_sel_5_noupd_entry);
RTS_ENTRY(stg_sel_6_noupd_entry);
RTS_ENTRY(stg_sel_7_noupd_entry);
RTS_ENTRY(stg_sel_8_noupd_entry);
RTS_ENTRY(stg_sel_9_noupd_entry);
RTS_ENTRY(stg_sel_10_noupd_entry);
RTS_ENTRY(stg_sel_11_noupd_entry);
RTS_ENTRY(stg_sel_12_noupd_entry);
RTS_ENTRY(stg_sel_13_noupd_entry);
RTS_ENTRY(stg_sel_14_noupd_entry);
RTS_ENTRY(stg_sel_15_noupd_entry);

/* standard ap thunks */

RTS_THUNK_INFO(stg_ap_1_upd_info);
RTS_THUNK_INFO(stg_ap_2_upd_info);
RTS_THUNK_INFO(stg_ap_3_upd_info);
RTS_THUNK_INFO(stg_ap_4_upd_info);
RTS_THUNK_INFO(stg_ap_5_upd_info);
RTS_THUNK_INFO(stg_ap_6_upd_info);
RTS_THUNK_INFO(stg_ap_7_upd_info);

RTS_ENTRY(stg_ap_1_upd_entry);
RTS_ENTRY(stg_ap_2_upd_entry);
RTS_ENTRY(stg_ap_3_upd_entry);
RTS_ENTRY(stg_ap_4_upd_entry);
RTS_ENTRY(stg_ap_5_upd_entry);
RTS_ENTRY(stg_ap_6_upd_entry);
RTS_ENTRY(stg_ap_7_upd_entry);

/* standard application routines (see also rts/gen_apply.py, 
 * and compiler/codeGen/CgStackery.lhs).
 */
RTS_RET_INFO(stg_ap_v_info);
RTS_RET_INFO(stg_ap_f_info);
RTS_RET_INFO(stg_ap_d_info);
RTS_RET_INFO(stg_ap_l_info);
RTS_RET_INFO(stg_ap_n_info);
RTS_RET_INFO(stg_ap_p_info);
RTS_RET_INFO(stg_ap_pv_info);
RTS_RET_INFO(stg_ap_pp_info);
RTS_RET_INFO(stg_ap_ppv_info);
RTS_RET_INFO(stg_ap_ppp_info);
RTS_RET_INFO(stg_ap_pppv_info);
RTS_RET_INFO(stg_ap_pppp_info);
RTS_RET_INFO(stg_ap_ppppp_info);
RTS_RET_INFO(stg_ap_pppppp_info);

RTS_ENTRY(stg_ap_v_ret);
RTS_ENTRY(stg_ap_f_ret);
RTS_ENTRY(stg_ap_d_ret);
RTS_ENTRY(stg_ap_l_ret);
RTS_ENTRY(stg_ap_n_ret);
RTS_ENTRY(stg_ap_p_ret);
RTS_ENTRY(stg_ap_pv_ret);
RTS_ENTRY(stg_ap_pp_ret);
RTS_ENTRY(stg_ap_ppv_ret);
RTS_ENTRY(stg_ap_ppp_ret);
RTS_ENTRY(stg_ap_pppv_ret);
RTS_ENTRY(stg_ap_pppp_ret);
RTS_ENTRY(stg_ap_ppppp_ret);
RTS_ENTRY(stg_ap_pppppp_ret);
389

390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
RTS_FUN(stg_ap_0_fast);
RTS_FUN(stg_ap_v_fast);
RTS_FUN(stg_ap_f_fast);
RTS_FUN(stg_ap_d_fast);
RTS_FUN(stg_ap_l_fast);
RTS_FUN(stg_ap_n_fast);
RTS_FUN(stg_ap_p_fast);
RTS_FUN(stg_ap_pv_fast);
RTS_FUN(stg_ap_pp_fast);
RTS_FUN(stg_ap_ppv_fast);
RTS_FUN(stg_ap_ppp_fast);
RTS_FUN(stg_ap_pppv_fast);
RTS_FUN(stg_ap_pppp_fast);
RTS_FUN(stg_ap_ppppp_fast);
RTS_FUN(stg_ap_pppppp_fast);
405
RTS_FUN(stg_PAP_apply);
406

407 408
/* standard GC & stack check entry points, all defined in HeapStackCheck.hc */

409 410
RTS_RET_INFO(stg_enter_info);
RTS_ENTRY(stg_enter_ret);
411 412
RTS_RET_INFO(stg_enter_checkbh_info);
RTS_ENTRY(stg_enter_checkbh_ret);
413 414 415 416 417 418 419

RTS_RET_INFO(stg_gc_void_info);
RTS_ENTRY(stg_gc_void_ret);

RTS_FUN(__stg_gc_enter_1);

RTS_FUN(stg_gc_noregs);
420

421 422 423
RTS_RET_INFO(stg_gc_unpt_r1_info);
RTS_ENTRY(stg_gc_unpt_r1_ret);
RTS_FUN(stg_gc_unpt_r1);
424

425 426 427
RTS_RET_INFO(stg_gc_unbx_r1_info);
RTS_ENTRY(stg_gc_unbx_r1_ret);
RTS_FUN(stg_gc_unbx_r1);
428

429 430 431
RTS_RET_INFO(stg_gc_f1_info);
RTS_ENTRY(stg_gc_f1_ret);
RTS_FUN(stg_gc_f1);
432

433 434 435
RTS_RET_INFO(stg_gc_d1_info);
RTS_ENTRY(stg_gc_d1_ret);
RTS_FUN(stg_gc_d1);
436

437 438 439
RTS_RET_INFO(stg_gc_l1_info);
RTS_ENTRY(stg_gc_l1_ret);
RTS_FUN(stg_gc_l1);
440

441 442 443
RTS_FUN(__stg_gc_fun);
RTS_RET_INFO(stg_gc_fun_info);
RTS_ENTRY(stg_gc_fun_ret);
444

445 446 447
RTS_RET_INFO(stg_gc_gen_info);
RTS_ENTRY(stg_gc_gen_ret);
RTS_FUN(stg_gc_gen);
448

449 450
RTS_ENTRY(stg_ut_1_0_unreg_ret);
RTS_RET_INFO(stg_ut_1_0_unreg_info);
451

452 453 454 455 456 457 458 459
RTS_FUN(stg_gc_gen_hp);
RTS_FUN(stg_gc_ut);
RTS_FUN(stg_gen_yield);
RTS_FUN(stg_yield_noregs);
RTS_FUN(stg_yield_to_interpreter);
RTS_FUN(stg_gen_block);
RTS_FUN(stg_block_noregs);
RTS_FUN(stg_block_1);
sof's avatar
sof committed
460 461
RTS_FUN(stg_block_blackhole);
RTS_FUN(stg_block_blackhole_finally);
462 463 464 465
RTS_FUN(stg_block_takemvar);
RTS_ENTRY(stg_block_takemvar_ret);
RTS_FUN(stg_block_putmvar);
RTS_ENTRY(stg_block_putmvar_ret);
466
#ifdef mingw32_HOST_OS
467
RTS_FUN(stg_block_async);
468
RTS_ENTRY(stg_block_async_ret);
sof's avatar
sof committed
469
RTS_FUN(stg_block_async_void);
470
RTS_ENTRY(stg_block_async_void_ret);
471
#endif
472
RTS_FUN(stg_block_stmwait);
473
RTS_FUN(stg_block_throwto);
474
RTS_ENTRY(stg_block_throwto_ret);
475
RTS_RET_INFO(stg_block_throwto_info);
476 477 478 479 480 481 482

/* Entry/exit points from StgStartup.cmm */

RTS_RET_INFO(stg_stop_thread_info);
RTS_ENTRY(stg_stop_thread_ret);

RTS_FUN(stg_returnToStackTop);
483
RTS_FUN(stg_returnToSched);
484
RTS_FUN(stg_returnToSchedNotPaused);
485
RTS_FUN(stg_returnToSchedButFirst);
486
RTS_FUN(stg_threadFinished);
487 488 489 490

RTS_FUN(stg_init_finish);
RTS_FUN(stg_init);

491 492
RTS_FUN(StgReturn);

493 494 495 496
/* -----------------------------------------------------------------------------
   PrimOps
   -------------------------------------------------------------------------- */

497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
RTS_FUN(stg_plusIntegerzh);
RTS_FUN(stg_minusIntegerzh);
RTS_FUN(stg_timesIntegerzh);
RTS_FUN(stg_gcdIntegerzh);
RTS_FUN(stg_quotRemIntegerzh);
RTS_FUN(stg_quotIntegerzh);
RTS_FUN(stg_remIntegerzh);
RTS_FUN(stg_divExactIntegerzh);
RTS_FUN(stg_divModIntegerzh);

RTS_FUN(stg_cmpIntegerIntzh);
RTS_FUN(stg_cmpIntegerzh);
RTS_FUN(stg_integer2Intzh);
RTS_FUN(stg_integer2Wordzh);
RTS_FUN(stg_gcdIntegerIntzh);
RTS_FUN(stg_gcdIntzh);

RTS_FUN(stg_int2Integerzh);
RTS_FUN(stg_word2Integerzh);

RTS_FUN(stg_decodeFloatzuIntzh);
RTS_FUN(stg_decodeDoublezh);
RTS_FUN(stg_decodeDoublezu2Intzh);

RTS_FUN(stg_andIntegerzh);
RTS_FUN(stg_orIntegerzh);
RTS_FUN(stg_xorIntegerzh);
RTS_FUN(stg_complementIntegerzh);
525

Simon Marlow's avatar
Simon Marlow committed
526
#if SIZEOF_HSINT == 4
527

528 529
RTS_FUN(stg_int64ToIntegerzh);
RTS_FUN(stg_word64ToIntegerzh);
530 531

#endif
532

533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
RTS_FUN(stg_unsafeThawArrayzh);
RTS_FUN(stg_newByteArrayzh);
RTS_FUN(stg_newPinnedByteArrayzh);
RTS_FUN(stg_newAlignedPinnedByteArrayzh);
RTS_FUN(stg_newArrayzh);

RTS_FUN(stg_newMutVarzh);
RTS_FUN(stg_atomicModifyMutVarzh);

RTS_FUN(stg_isEmptyMVarzh);
RTS_FUN(stg_newMVarzh);
RTS_FUN(stg_takeMVarzh);
RTS_FUN(stg_putMVarzh);
RTS_FUN(stg_tryTakeMVarzh);
RTS_FUN(stg_tryPutMVarzh);

RTS_FUN(stg_waitReadzh);
RTS_FUN(stg_waitWritezh);
RTS_FUN(stg_delayzh);
552
#ifdef mingw32_HOST_OS
553 554 555
RTS_FUN(stg_asyncReadzh);
RTS_FUN(stg_asyncWritezh);
RTS_FUN(stg_asyncDoProczh);
sof's avatar
sof committed
556
#endif
557

558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603
RTS_FUN(stg_catchzh);
RTS_FUN(stg_raisezh);
RTS_FUN(stg_raiseIOzh);

RTS_FUN(stg_makeStableNamezh);
RTS_FUN(stg_makeStablePtrzh);
RTS_FUN(stg_deRefStablePtrzh);

RTS_FUN(stg_forkzh);
RTS_FUN(stg_forkOnzh);
RTS_FUN(stg_yieldzh);
RTS_FUN(stg_killThreadzh);
RTS_FUN(stg_asyncExceptionsBlockedzh);
RTS_FUN(stg_blockAsyncExceptionszh);
RTS_FUN(stg_unblockAsyncExceptionszh);
RTS_FUN(stg_myThreadIdzh);
RTS_FUN(stg_labelThreadzh);
RTS_FUN(stg_isCurrentThreadBoundzh);
RTS_FUN(stg_threadStatuszh);

RTS_FUN(stg_mkWeakzh);
RTS_FUN(stg_mkWeakForeignzh);
RTS_FUN(stg_mkWeakForeignEnvzh);
RTS_FUN(stg_finalizzeWeakzh);
RTS_FUN(stg_deRefWeakzh);

RTS_FUN(stg_newBCOzh);
RTS_FUN(stg_mkApUpd0zh);

RTS_FUN(stg_retryzh);
RTS_FUN(stg_catchRetryzh);
RTS_FUN(stg_catchSTMzh);
RTS_FUN(stg_atomicallyzh);
RTS_FUN(stg_newTVarzh);
RTS_FUN(stg_readTVarzh);
RTS_FUN(stg_readTVarIOzh);
RTS_FUN(stg_writeTVarzh);
RTS_FUN(stg_checkzh);

RTS_FUN(stg_unpackClosurezh);
RTS_FUN(stg_getApStackValzh);
RTS_FUN(stg_getSparkzh);

RTS_FUN(stg_noDuplicatezh);

RTS_FUN(stg_traceCcszh);
604
RTS_FUN(stg_traceEventzh);
605

606
/* Other misc stuff */
607
// See wiki:Commentary/Compiler/Backends/PprC#Prototypes
608 609 610

#if IN_STG_CODE && !IN_STGCRUN

611 612 613 614 615
// Interpreter.c
extern StgWord rts_stop_next_breakpoint[];
extern StgWord rts_stop_on_exception[];
extern StgWord rts_breakpoint_io_action[];

616 617 618 619 620 621 622 623 624
// Schedule.c
extern StgWord RTS_VAR(blocked_queue_hd), RTS_VAR(blocked_queue_tl);
extern StgWord RTS_VAR(sleeping_queue);
extern StgWord RTS_VAR(blackhole_queue);
extern StgWord RTS_VAR(sched_mutex);

// Apply.cmm
// canned bitmap for each arg type
extern StgWord stg_arg_bitmaps[];
625 626
extern StgWord stg_ap_stack_entries[];
extern StgWord stg_stack_save_entries[];
627 628

// Storage.c
629
extern unsigned int RTS_VAR(g0);
630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650
extern unsigned int RTS_VAR(alloc_blocks_lim);
extern StgWord RTS_VAR(weak_ptr_list);
extern StgWord RTS_VAR(atomic_modify_mutvar_mutex);

// RtsFlags
extern StgWord RTS_VAR(RtsFlags); // bogus type

// Stable.c
extern StgWord RTS_VAR(stable_ptr_table);

// Profiling.c
extern unsigned int RTS_VAR(era);
extern StgWord      RTS_VAR(CCCS);	        /* current CCS */
extern unsigned int RTS_VAR(entering_PAP);
extern StgWord      RTS_VAR(CC_LIST);               /* registered CC list */
extern StgWord      RTS_VAR(CCS_LIST);         /* registered CCS list */
extern unsigned int RTS_VAR(CC_ID);	/* global ids */
extern unsigned int RTS_VAR(CCS_ID);

#endif

651
#endif /* STGMISCCLOSURES_H */