Add a way to generate tracing events programmatically
[ghc.git] / includes / stg / MiscClosures.h
1 /* ----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2009
4 *
5 * Declarations for various symbols exported by the RTS.
6 *
7 * ToDo: many of the symbols in here don't need to be exported, but
8 * our Cmm code generator doesn't know how to generate local symbols
9 * for the RTS bits (it assumes all RTS symbols are external).
10 *
11 * See wiki:Commentary/Compiler/Backends/PprC#Prototypes
12 *
13 * Do not #include this file directly: #include "Rts.h" instead.
14 *
15 * To understand the structure of the RTS headers, see the wiki:
16 * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
17 *
18 * --------------------------------------------------------------------------*/
19
20 #ifndef STGMISCCLOSURES_H
21 #define STGMISCCLOSURES_H
22
23 #if IN_STG_CODE
24 # define RTS_RET_INFO(i) extern W_(i)[]
25 # define RTS_FUN_INFO(i) extern W_(i)[]
26 # define RTS_THUNK_INFO(i) extern W_(i)[]
27 # define RTS_INFO(i) extern W_(i)[]
28 # define RTS_CLOSURE(i) extern W_(i)[]
29 # define RTS_FUN(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
30 #else
31 # define RTS_RET_INFO(i) extern DLL_IMPORT_RTS const StgRetInfoTable i
32 # define RTS_FUN_INFO(i) extern DLL_IMPORT_RTS const StgFunInfoTable i
33 # define RTS_THUNK_INFO(i) extern DLL_IMPORT_RTS const StgThunkInfoTable i
34 # define RTS_INFO(i) extern DLL_IMPORT_RTS const StgInfoTable i
35 # define RTS_CLOSURE(i) extern DLL_IMPORT_RTS StgClosure i
36 # define RTS_FUN(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
37 #endif
38
39 #ifdef TABLES_NEXT_TO_CODE
40 # define RTS_ENTRY(f) /* nothing */
41 #else
42 # define RTS_ENTRY(f) RTS_FUN(f)
43 #endif
44
45 /* Stack frames */
46 RTS_RET_INFO(stg_upd_frame_info);
47 RTS_RET_INFO(stg_marked_upd_frame_info);
48 RTS_RET_INFO(stg_noupd_frame_info);
49 RTS_RET_INFO(stg_catch_frame_info);
50 RTS_RET_INFO(stg_catch_retry_frame_info);
51 RTS_RET_INFO(stg_atomically_frame_info);
52 RTS_RET_INFO(stg_atomically_waiting_frame_info);
53 RTS_RET_INFO(stg_catch_stm_frame_info);
54 RTS_RET_INFO(stg_unblockAsyncExceptionszh_ret_info);
55
56 RTS_ENTRY(stg_upd_frame_ret);
57 RTS_ENTRY(stg_marked_upd_frame_ret);
58
59 // RTS_FUN(stg_interp_constr_entry);
60 //
61 // This is referenced using the FFI in the compiler (ByteCodeItbls),
62 // so we can't give it the correct type here because the prototypes
63 // would clash (FFI references are always declared with type StgWord[]
64 // in the generated C code).
65
66 /* Magic glue code for when compiled code returns a value in R1/F1/D1
67 or a VoidRep to the interpreter. */
68 RTS_RET_INFO(stg_ctoi_R1p_info);
69 RTS_RET_INFO(stg_ctoi_R1unpt_info);
70 RTS_RET_INFO(stg_ctoi_R1n_info);
71 RTS_RET_INFO(stg_ctoi_F1_info);
72 RTS_RET_INFO(stg_ctoi_D1_info);
73 RTS_RET_INFO(stg_ctoi_L1_info);
74 RTS_RET_INFO(stg_ctoi_V_info);
75
76 RTS_ENTRY(stg_ctoi_R1p_ret);
77 RTS_ENTRY(stg_ctoi_R1unpt_ret);
78 RTS_ENTRY(stg_ctoi_R1n_ret);
79 RTS_ENTRY(stg_ctoi_F1_ret);
80 RTS_ENTRY(stg_ctoi_D1_ret);
81 RTS_ENTRY(stg_ctoi_L1_ret);
82 RTS_ENTRY(stg_ctoi_V_ret);
83
84 RTS_RET_INFO(stg_apply_interp_info);
85 RTS_ENTRY(stg_apply_interp_ret);
86
87 RTS_INFO(stg_IND_info);
88 RTS_INFO(stg_IND_direct_info);
89 RTS_INFO(stg_IND_STATIC_info);
90 RTS_INFO(stg_IND_PERM_info);
91 RTS_INFO(stg_IND_OLDGEN_info);
92 RTS_INFO(stg_IND_OLDGEN_PERM_info);
93 RTS_INFO(stg_CAF_UNENTERED_info);
94 RTS_INFO(stg_CAF_ENTERED_info);
95 RTS_INFO(stg_WHITEHOLE_info);
96 RTS_INFO(stg_BLACKHOLE_info);
97 RTS_INFO(__stg_EAGER_BLACKHOLE_info);
98 RTS_INFO(stg_CAF_BLACKHOLE_info);
99
100 RTS_FUN_INFO(stg_BCO_info);
101 RTS_INFO(stg_EVACUATED_info);
102 RTS_INFO(stg_WEAK_info);
103 RTS_INFO(stg_DEAD_WEAK_info);
104 RTS_INFO(stg_STABLE_NAME_info);
105 RTS_INFO(stg_MVAR_CLEAN_info);
106 RTS_INFO(stg_MVAR_DIRTY_info);
107 RTS_INFO(stg_TSO_info);
108 RTS_INFO(stg_ARR_WORDS_info);
109 RTS_INFO(stg_MUT_ARR_WORDS_info);
110 RTS_INFO(stg_MUT_ARR_PTRS_CLEAN_info);
111 RTS_INFO(stg_MUT_ARR_PTRS_DIRTY_info);
112 RTS_INFO(stg_MUT_ARR_PTRS_FROZEN_info);
113 RTS_INFO(stg_MUT_ARR_PTRS_FROZEN0_info);
114 RTS_INFO(stg_MUT_VAR_CLEAN_info);
115 RTS_INFO(stg_MUT_VAR_DIRTY_info);
116 RTS_INFO(stg_END_TSO_QUEUE_info);
117 RTS_INFO(stg_MUT_CONS_info);
118 RTS_INFO(stg_catch_info);
119 RTS_INFO(stg_PAP_info);
120 RTS_INFO(stg_AP_info);
121 RTS_INFO(stg_AP_NOUPD_info);
122 RTS_INFO(stg_AP_STACK_info);
123 RTS_INFO(stg_dummy_ret_info);
124 RTS_INFO(stg_raise_info);
125 RTS_INFO(stg_raise_ret_info);
126 RTS_INFO(stg_TVAR_WATCH_QUEUE_info);
127 RTS_INFO(stg_INVARIANT_CHECK_QUEUE_info);
128 RTS_INFO(stg_ATOMIC_INVARIANT_info);
129 RTS_INFO(stg_TVAR_info);
130 RTS_INFO(stg_TREC_CHUNK_info);
131 RTS_INFO(stg_TREC_HEADER_info);
132 RTS_INFO(stg_END_STM_WATCH_QUEUE_info);
133 RTS_INFO(stg_END_INVARIANT_CHECK_QUEUE_info);
134 RTS_INFO(stg_END_STM_CHUNK_LIST_info);
135 RTS_INFO(stg_NO_TREC_info);
136
137 RTS_ENTRY(stg_IND_entry);
138 RTS_ENTRY(stg_IND_direct_entry);
139 RTS_ENTRY(stg_IND_STATIC_entry);
140 RTS_ENTRY(stg_IND_PERM_entry);
141 RTS_ENTRY(stg_IND_OLDGEN_entry);
142 RTS_ENTRY(stg_IND_OLDGEN_PERM_entry);
143 RTS_ENTRY(stg_CAF_UNENTERED_entry);
144 RTS_ENTRY(stg_CAF_ENTERED_entry);
145 RTS_ENTRY(stg_WHITEHOLE_entry);
146 RTS_ENTRY(stg_BLACKHOLE_entry);
147 RTS_ENTRY(__stg_EAGER_BLACKHOLE_entry);
148 RTS_ENTRY(stg_CAF_BLACKHOLE_entry);
149 RTS_ENTRY(stg_BCO_entry);
150 RTS_ENTRY(stg_EVACUATED_entry);
151 RTS_ENTRY(stg_WEAK_entry);
152 RTS_ENTRY(stg_DEAD_WEAK_entry);
153 RTS_ENTRY(stg_STABLE_NAME_entry);
154 RTS_ENTRY(stg_FULL_MVAR_entry);
155 RTS_ENTRY(stg_EMPTY_MVAR_entry);
156 RTS_ENTRY(stg_TSO_entry);
157 RTS_ENTRY(stg_ARR_WORDS_entry);
158 RTS_ENTRY(stg_MUT_ARR_WORDS_entry);
159 RTS_ENTRY(stg_MUT_ARR_PTRS_CLEAN_entry);
160 RTS_ENTRY(stg_MUT_ARR_PTRS_DIRTY_entry);
161 RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_entry);
162 RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN0_entry);
163 RTS_ENTRY(stg_MUT_VAR_CLEAN_entry);
164 RTS_ENTRY(stg_MUT_VAR_DIRTY_entry);
165 RTS_ENTRY(stg_END_TSO_QUEUE_entry);
166 RTS_ENTRY(stg_MUT_CONS_entry);
167 RTS_ENTRY(stg_catch_entry);
168 RTS_ENTRY(stg_PAP_entry);
169 RTS_ENTRY(stg_AP_entry);
170 RTS_ENTRY(stg_AP_NOUPD_entry);
171 RTS_ENTRY(stg_AP_STACK_entry);
172 RTS_ENTRY(stg_dummy_ret_entry);
173 RTS_ENTRY(stg_raise_entry);
174 RTS_ENTRY(stg_raise_ret_ret);
175 RTS_ENTRY(stg_END_STM_WATCH_QUEUE_entry);
176 RTS_ENTRY(stg_END_INVARIANT_CHECK_QUEUE_entry);
177 RTS_ENTRY(stg_END_STM_CHUNK_LIST_entry);
178 RTS_ENTRY(stg_NO_TREC_entry);
179 RTS_ENTRY(stg_TVAR_entry);
180 RTS_ENTRY(stg_TVAR_WATCH_QUEUE_entry);
181 RTS_ENTRY(stg_INVARIANT_CHECK_QUEUE_entry);
182 RTS_ENTRY(stg_ATOMIC_INVARIANT_entry);
183 RTS_ENTRY(stg_TREC_CHUNK_entry);
184 RTS_ENTRY(stg_TREC_HEADER_entry);
185
186
187 RTS_ENTRY(stg_unblockAsyncExceptionszh_ret_ret);
188 RTS_ENTRY(stg_blockAsyncExceptionszh_ret_ret);
189 RTS_ENTRY(stg_catch_frame_ret);
190 RTS_ENTRY(stg_catch_retry_frame_ret);
191 RTS_ENTRY(stg_atomically_frame_ret);
192 RTS_ENTRY(stg_atomically_waiting_frame_ret);
193 RTS_ENTRY(stg_catch_stm_frame_ret);
194
195 /* closures */
196
197 RTS_CLOSURE(stg_END_TSO_QUEUE_closure);
198 RTS_CLOSURE(stg_NO_FINALIZER_closure);
199 RTS_CLOSURE(stg_dummy_ret_closure);
200 RTS_CLOSURE(stg_forceIO_closure);
201
202 RTS_CLOSURE(stg_END_STM_WATCH_QUEUE_closure);
203 RTS_CLOSURE(stg_END_INVARIANT_CHECK_QUEUE_closure);
204 RTS_CLOSURE(stg_END_STM_CHUNK_LIST_closure);
205 RTS_CLOSURE(stg_NO_TREC_closure);
206
207 RTS_ENTRY(stg_NO_FINALIZER_entry);
208 RTS_ENTRY(stg_END_EXCEPTION_LIST_entry);
209 RTS_ENTRY(stg_EXCEPTION_CONS_entry);
210
211 #if IN_STG_CODE
212 extern DLL_IMPORT_RTS StgWordArray stg_CHARLIKE_closure;
213 extern DLL_IMPORT_RTS StgWordArray stg_INTLIKE_closure;
214 #else
215 extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_closure[];
216 extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_closure[];
217 #endif
218
219 /* StgStartup */
220
221 RTS_RET_INFO(stg_forceIO_info);
222 RTS_ENTRY(stg_forceIO_ret);
223
224 RTS_RET_INFO(stg_noforceIO_info);
225 RTS_ENTRY(stg_noforceIO_ret);
226
227 /* standard entry points */
228
229 /* standard selector thunks */
230
231 RTS_ENTRY(stg_sel_ret_0_upd_ret);
232 RTS_ENTRY(stg_sel_ret_1_upd_ret);
233 RTS_ENTRY(stg_sel_ret_2_upd_ret);
234 RTS_ENTRY(stg_sel_ret_3_upd_ret);
235 RTS_ENTRY(stg_sel_ret_4_upd_ret);
236 RTS_ENTRY(stg_sel_ret_5_upd_ret);
237 RTS_ENTRY(stg_sel_ret_6_upd_ret);
238 RTS_ENTRY(stg_sel_ret_7_upd_ret);
239 RTS_ENTRY(stg_sel_ret_8_upd_ret);
240 RTS_ENTRY(stg_sel_ret_9_upd_ret);
241 RTS_ENTRY(stg_sel_ret_10_upd_ret);
242 RTS_ENTRY(stg_sel_ret_11_upd_ret);
243 RTS_ENTRY(stg_sel_ret_12_upd_ret);
244 RTS_ENTRY(stg_sel_ret_13_upd_ret);
245 RTS_ENTRY(stg_sel_ret_14_upd_ret);
246 RTS_ENTRY(stg_sel_ret_15_upd_ret);
247
248 RTS_INFO(stg_sel_0_upd_info);
249 RTS_INFO(stg_sel_1_upd_info);
250 RTS_INFO(stg_sel_2_upd_info);
251 RTS_INFO(stg_sel_3_upd_info);
252 RTS_INFO(stg_sel_4_upd_info);
253 RTS_INFO(stg_sel_5_upd_info);
254 RTS_INFO(stg_sel_6_upd_info);
255 RTS_INFO(stg_sel_7_upd_info);
256 RTS_INFO(stg_sel_8_upd_info);
257 RTS_INFO(stg_sel_9_upd_info);
258 RTS_INFO(stg_sel_10_upd_info);
259 RTS_INFO(stg_sel_11_upd_info);
260 RTS_INFO(stg_sel_12_upd_info);
261 RTS_INFO(stg_sel_13_upd_info);
262 RTS_INFO(stg_sel_14_upd_info);
263 RTS_INFO(stg_sel_15_upd_info);
264
265 RTS_ENTRY(stg_sel_0_upd_entry);
266 RTS_ENTRY(stg_sel_1_upd_entry);
267 RTS_ENTRY(stg_sel_2_upd_entry);
268 RTS_ENTRY(stg_sel_3_upd_entry);
269 RTS_ENTRY(stg_sel_4_upd_entry);
270 RTS_ENTRY(stg_sel_5_upd_entry);
271 RTS_ENTRY(stg_sel_6_upd_entry);
272 RTS_ENTRY(stg_sel_7_upd_entry);
273 RTS_ENTRY(stg_sel_8_upd_entry);
274 RTS_ENTRY(stg_sel_9_upd_entry);
275 RTS_ENTRY(stg_sel_10_upd_entry);
276 RTS_ENTRY(stg_sel_11_upd_entry);
277 RTS_ENTRY(stg_sel_12_upd_entry);
278 RTS_ENTRY(stg_sel_13_upd_entry);
279 RTS_ENTRY(stg_sel_14_upd_entry);
280 RTS_ENTRY(stg_sel_15_upd_entry);
281
282 RTS_ENTRY(stg_sel_ret_0_noupd_ret);
283 RTS_ENTRY(stg_sel_ret_1_noupd_ret);
284 RTS_ENTRY(stg_sel_ret_2_noupd_ret);
285 RTS_ENTRY(stg_sel_ret_3_noupd_ret);
286 RTS_ENTRY(stg_sel_ret_4_noupd_ret);
287 RTS_ENTRY(stg_sel_ret_5_noupd_ret);
288 RTS_ENTRY(stg_sel_ret_6_noupd_ret);
289 RTS_ENTRY(stg_sel_ret_7_noupd_ret);
290 RTS_ENTRY(stg_sel_ret_8_noupd_ret);
291 RTS_ENTRY(stg_sel_ret_9_noupd_ret);
292 RTS_ENTRY(stg_sel_ret_10_noupd_ret);
293 RTS_ENTRY(stg_sel_ret_11_noupd_ret);
294 RTS_ENTRY(stg_sel_ret_12_noupd_ret);
295 RTS_ENTRY(stg_sel_ret_13_noupd_ret);
296 RTS_ENTRY(stg_sel_ret_14_noupd_ret);
297 RTS_ENTRY(stg_sel_ret_15_noupd_ret);
298
299 RTS_INFO(stg_sel_0_noupd_info);
300 RTS_INFO(stg_sel_1_noupd_info);
301 RTS_INFO(stg_sel_2_noupd_info);
302 RTS_INFO(stg_sel_3_noupd_info);
303 RTS_INFO(stg_sel_4_noupd_info);
304 RTS_INFO(stg_sel_5_noupd_info);
305 RTS_INFO(stg_sel_6_noupd_info);
306 RTS_INFO(stg_sel_7_noupd_info);
307 RTS_INFO(stg_sel_8_noupd_info);
308 RTS_INFO(stg_sel_9_noupd_info);
309 RTS_INFO(stg_sel_10_noupd_info);
310 RTS_INFO(stg_sel_11_noupd_info);
311 RTS_INFO(stg_sel_12_noupd_info);
312 RTS_INFO(stg_sel_13_noupd_info);
313 RTS_INFO(stg_sel_14_noupd_info);
314 RTS_INFO(stg_sel_15_noupd_info);
315
316 RTS_ENTRY(stg_sel_0_noupd_entry);
317 RTS_ENTRY(stg_sel_1_noupd_entry);
318 RTS_ENTRY(stg_sel_2_noupd_entry);
319 RTS_ENTRY(stg_sel_3_noupd_entry);
320 RTS_ENTRY(stg_sel_4_noupd_entry);
321 RTS_ENTRY(stg_sel_5_noupd_entry);
322 RTS_ENTRY(stg_sel_6_noupd_entry);
323 RTS_ENTRY(stg_sel_7_noupd_entry);
324 RTS_ENTRY(stg_sel_8_noupd_entry);
325 RTS_ENTRY(stg_sel_9_noupd_entry);
326 RTS_ENTRY(stg_sel_10_noupd_entry);
327 RTS_ENTRY(stg_sel_11_noupd_entry);
328 RTS_ENTRY(stg_sel_12_noupd_entry);
329 RTS_ENTRY(stg_sel_13_noupd_entry);
330 RTS_ENTRY(stg_sel_14_noupd_entry);
331 RTS_ENTRY(stg_sel_15_noupd_entry);
332
333 /* standard ap thunks */
334
335 RTS_THUNK_INFO(stg_ap_1_upd_info);
336 RTS_THUNK_INFO(stg_ap_2_upd_info);
337 RTS_THUNK_INFO(stg_ap_3_upd_info);
338 RTS_THUNK_INFO(stg_ap_4_upd_info);
339 RTS_THUNK_INFO(stg_ap_5_upd_info);
340 RTS_THUNK_INFO(stg_ap_6_upd_info);
341 RTS_THUNK_INFO(stg_ap_7_upd_info);
342
343 RTS_ENTRY(stg_ap_1_upd_entry);
344 RTS_ENTRY(stg_ap_2_upd_entry);
345 RTS_ENTRY(stg_ap_3_upd_entry);
346 RTS_ENTRY(stg_ap_4_upd_entry);
347 RTS_ENTRY(stg_ap_5_upd_entry);
348 RTS_ENTRY(stg_ap_6_upd_entry);
349 RTS_ENTRY(stg_ap_7_upd_entry);
350
351 /* standard application routines (see also rts/gen_apply.py,
352 * and compiler/codeGen/CgStackery.lhs).
353 */
354 RTS_RET_INFO(stg_ap_v_info);
355 RTS_RET_INFO(stg_ap_f_info);
356 RTS_RET_INFO(stg_ap_d_info);
357 RTS_RET_INFO(stg_ap_l_info);
358 RTS_RET_INFO(stg_ap_n_info);
359 RTS_RET_INFO(stg_ap_p_info);
360 RTS_RET_INFO(stg_ap_pv_info);
361 RTS_RET_INFO(stg_ap_pp_info);
362 RTS_RET_INFO(stg_ap_ppv_info);
363 RTS_RET_INFO(stg_ap_ppp_info);
364 RTS_RET_INFO(stg_ap_pppv_info);
365 RTS_RET_INFO(stg_ap_pppp_info);
366 RTS_RET_INFO(stg_ap_ppppp_info);
367 RTS_RET_INFO(stg_ap_pppppp_info);
368
369 RTS_ENTRY(stg_ap_v_ret);
370 RTS_ENTRY(stg_ap_f_ret);
371 RTS_ENTRY(stg_ap_d_ret);
372 RTS_ENTRY(stg_ap_l_ret);
373 RTS_ENTRY(stg_ap_n_ret);
374 RTS_ENTRY(stg_ap_p_ret);
375 RTS_ENTRY(stg_ap_pv_ret);
376 RTS_ENTRY(stg_ap_pp_ret);
377 RTS_ENTRY(stg_ap_ppv_ret);
378 RTS_ENTRY(stg_ap_ppp_ret);
379 RTS_ENTRY(stg_ap_pppv_ret);
380 RTS_ENTRY(stg_ap_pppp_ret);
381 RTS_ENTRY(stg_ap_ppppp_ret);
382 RTS_ENTRY(stg_ap_pppppp_ret);
383
384 RTS_FUN(stg_ap_0_fast);
385 RTS_FUN(stg_ap_v_fast);
386 RTS_FUN(stg_ap_f_fast);
387 RTS_FUN(stg_ap_d_fast);
388 RTS_FUN(stg_ap_l_fast);
389 RTS_FUN(stg_ap_n_fast);
390 RTS_FUN(stg_ap_p_fast);
391 RTS_FUN(stg_ap_pv_fast);
392 RTS_FUN(stg_ap_pp_fast);
393 RTS_FUN(stg_ap_ppv_fast);
394 RTS_FUN(stg_ap_ppp_fast);
395 RTS_FUN(stg_ap_pppv_fast);
396 RTS_FUN(stg_ap_pppp_fast);
397 RTS_FUN(stg_ap_ppppp_fast);
398 RTS_FUN(stg_ap_pppppp_fast);
399 RTS_FUN(stg_PAP_apply);
400
401 /* standard GC & stack check entry points, all defined in HeapStackCheck.hc */
402
403 RTS_RET_INFO(stg_enter_info);
404 RTS_ENTRY(stg_enter_ret);
405
406 RTS_RET_INFO(stg_gc_void_info);
407 RTS_ENTRY(stg_gc_void_ret);
408
409 RTS_FUN(__stg_gc_enter_1);
410
411 RTS_FUN(stg_gc_noregs);
412
413 RTS_RET_INFO(stg_gc_unpt_r1_info);
414 RTS_ENTRY(stg_gc_unpt_r1_ret);
415 RTS_FUN(stg_gc_unpt_r1);
416
417 RTS_RET_INFO(stg_gc_unbx_r1_info);
418 RTS_ENTRY(stg_gc_unbx_r1_ret);
419 RTS_FUN(stg_gc_unbx_r1);
420
421 RTS_RET_INFO(stg_gc_f1_info);
422 RTS_ENTRY(stg_gc_f1_ret);
423 RTS_FUN(stg_gc_f1);
424
425 RTS_RET_INFO(stg_gc_d1_info);
426 RTS_ENTRY(stg_gc_d1_ret);
427 RTS_FUN(stg_gc_d1);
428
429 RTS_RET_INFO(stg_gc_l1_info);
430 RTS_ENTRY(stg_gc_l1_ret);
431 RTS_FUN(stg_gc_l1);
432
433 RTS_FUN(__stg_gc_fun);
434 RTS_RET_INFO(stg_gc_fun_info);
435 RTS_ENTRY(stg_gc_fun_ret);
436
437 RTS_RET_INFO(stg_gc_gen_info);
438 RTS_ENTRY(stg_gc_gen_ret);
439 RTS_FUN(stg_gc_gen);
440
441 RTS_ENTRY(stg_ut_1_0_unreg_ret);
442 RTS_RET_INFO(stg_ut_1_0_unreg_info);
443
444 RTS_FUN(stg_gc_gen_hp);
445 RTS_FUN(stg_gc_ut);
446 RTS_FUN(stg_gen_yield);
447 RTS_FUN(stg_yield_noregs);
448 RTS_FUN(stg_yield_to_interpreter);
449 RTS_FUN(stg_gen_block);
450 RTS_FUN(stg_block_noregs);
451 RTS_FUN(stg_block_1);
452 RTS_FUN(stg_block_blackhole);
453 RTS_FUN(stg_block_blackhole_finally);
454 RTS_FUN(stg_block_takemvar);
455 RTS_ENTRY(stg_block_takemvar_ret);
456 RTS_FUN(stg_block_putmvar);
457 RTS_ENTRY(stg_block_putmvar_ret);
458 #ifdef mingw32_HOST_OS
459 RTS_FUN(stg_block_async);
460 RTS_ENTRY(stg_block_async_ret);
461 RTS_FUN(stg_block_async_void);
462 RTS_ENTRY(stg_block_async_void_ret);
463 #endif
464 RTS_FUN(stg_block_stmwait);
465 RTS_FUN(stg_block_throwto);
466 RTS_ENTRY(stg_block_throwto_ret);
467 RTS_RET_INFO(stg_block_throwto_info);
468
469 /* Entry/exit points from StgStartup.cmm */
470
471 RTS_RET_INFO(stg_stop_thread_info);
472 RTS_ENTRY(stg_stop_thread_ret);
473
474 RTS_FUN(stg_returnToStackTop);
475 RTS_FUN(stg_returnToSched);
476 RTS_FUN(stg_returnToSchedNotPaused);
477 RTS_FUN(stg_returnToSchedButFirst);
478 RTS_FUN(stg_threadFinished);
479
480 RTS_FUN(stg_init_finish);
481 RTS_FUN(stg_init);
482
483 RTS_FUN(StgReturn);
484
485 /* -----------------------------------------------------------------------------
486 PrimOps
487 -------------------------------------------------------------------------- */
488
489 RTS_FUN(stg_plusIntegerzh);
490 RTS_FUN(stg_minusIntegerzh);
491 RTS_FUN(stg_timesIntegerzh);
492 RTS_FUN(stg_gcdIntegerzh);
493 RTS_FUN(stg_quotRemIntegerzh);
494 RTS_FUN(stg_quotIntegerzh);
495 RTS_FUN(stg_remIntegerzh);
496 RTS_FUN(stg_divExactIntegerzh);
497 RTS_FUN(stg_divModIntegerzh);
498
499 RTS_FUN(stg_cmpIntegerIntzh);
500 RTS_FUN(stg_cmpIntegerzh);
501 RTS_FUN(stg_integer2Intzh);
502 RTS_FUN(stg_integer2Wordzh);
503 RTS_FUN(stg_gcdIntegerIntzh);
504 RTS_FUN(stg_gcdIntzh);
505
506 RTS_FUN(stg_int2Integerzh);
507 RTS_FUN(stg_word2Integerzh);
508
509 RTS_FUN(stg_decodeFloatzuIntzh);
510 RTS_FUN(stg_decodeDoublezh);
511 RTS_FUN(stg_decodeDoublezu2Intzh);
512
513 RTS_FUN(stg_andIntegerzh);
514 RTS_FUN(stg_orIntegerzh);
515 RTS_FUN(stg_xorIntegerzh);
516 RTS_FUN(stg_complementIntegerzh);
517
518 #if SIZEOF_HSINT == 4
519
520 RTS_FUN(stg_int64ToIntegerzh);
521 RTS_FUN(stg_word64ToIntegerzh);
522
523 #endif
524
525 RTS_FUN(stg_unsafeThawArrayzh);
526 RTS_FUN(stg_newByteArrayzh);
527 RTS_FUN(stg_newPinnedByteArrayzh);
528 RTS_FUN(stg_newAlignedPinnedByteArrayzh);
529 RTS_FUN(stg_newArrayzh);
530
531 RTS_FUN(stg_newMutVarzh);
532 RTS_FUN(stg_atomicModifyMutVarzh);
533
534 RTS_FUN(stg_isEmptyMVarzh);
535 RTS_FUN(stg_newMVarzh);
536 RTS_FUN(stg_takeMVarzh);
537 RTS_FUN(stg_putMVarzh);
538 RTS_FUN(stg_tryTakeMVarzh);
539 RTS_FUN(stg_tryPutMVarzh);
540
541 RTS_FUN(stg_waitReadzh);
542 RTS_FUN(stg_waitWritezh);
543 RTS_FUN(stg_delayzh);
544 #ifdef mingw32_HOST_OS
545 RTS_FUN(stg_asyncReadzh);
546 RTS_FUN(stg_asyncWritezh);
547 RTS_FUN(stg_asyncDoProczh);
548 #endif
549
550 RTS_FUN(stg_catchzh);
551 RTS_FUN(stg_raisezh);
552 RTS_FUN(stg_raiseIOzh);
553
554 RTS_FUN(stg_makeStableNamezh);
555 RTS_FUN(stg_makeStablePtrzh);
556 RTS_FUN(stg_deRefStablePtrzh);
557
558 RTS_FUN(stg_forkzh);
559 RTS_FUN(stg_forkOnzh);
560 RTS_FUN(stg_yieldzh);
561 RTS_FUN(stg_killThreadzh);
562 RTS_FUN(stg_asyncExceptionsBlockedzh);
563 RTS_FUN(stg_blockAsyncExceptionszh);
564 RTS_FUN(stg_unblockAsyncExceptionszh);
565 RTS_FUN(stg_myThreadIdzh);
566 RTS_FUN(stg_labelThreadzh);
567 RTS_FUN(stg_isCurrentThreadBoundzh);
568 RTS_FUN(stg_threadStatuszh);
569
570 RTS_FUN(stg_mkWeakzh);
571 RTS_FUN(stg_mkWeakForeignzh);
572 RTS_FUN(stg_mkWeakForeignEnvzh);
573 RTS_FUN(stg_finalizzeWeakzh);
574 RTS_FUN(stg_deRefWeakzh);
575
576 RTS_FUN(stg_newBCOzh);
577 RTS_FUN(stg_mkApUpd0zh);
578
579 RTS_FUN(stg_retryzh);
580 RTS_FUN(stg_catchRetryzh);
581 RTS_FUN(stg_catchSTMzh);
582 RTS_FUN(stg_atomicallyzh);
583 RTS_FUN(stg_newTVarzh);
584 RTS_FUN(stg_readTVarzh);
585 RTS_FUN(stg_readTVarIOzh);
586 RTS_FUN(stg_writeTVarzh);
587 RTS_FUN(stg_checkzh);
588
589 RTS_FUN(stg_unpackClosurezh);
590 RTS_FUN(stg_getApStackValzh);
591 RTS_FUN(stg_getSparkzh);
592
593 RTS_FUN(stg_noDuplicatezh);
594
595 RTS_FUN(stg_traceCcszh);
596 RTS_FUN(stg_traceEventzh);
597
598 /* Other misc stuff */
599 // See wiki:Commentary/Compiler/Backends/PprC#Prototypes
600
601 #if IN_STG_CODE && !IN_STGCRUN
602
603 // Interpreter.c
604 extern StgWord rts_stop_next_breakpoint[];
605 extern StgWord rts_stop_on_exception[];
606 extern StgWord rts_breakpoint_io_action[];
607
608 // Schedule.c
609 extern StgWord RTS_VAR(blocked_queue_hd), RTS_VAR(blocked_queue_tl);
610 extern StgWord RTS_VAR(sleeping_queue);
611 extern StgWord RTS_VAR(blackhole_queue);
612 extern StgWord RTS_VAR(sched_mutex);
613
614 // Apply.cmm
615 // canned bitmap for each arg type
616 extern StgWord stg_arg_bitmaps[];
617 extern StgWord stg_ap_stack_entries[];
618 extern StgWord stg_stack_save_entries[];
619
620 // Storage.c
621 extern unsigned int RTS_VAR(alloc_blocks);
622 extern unsigned int RTS_VAR(alloc_blocks_lim);
623 extern StgWord RTS_VAR(weak_ptr_list);
624 extern StgWord RTS_VAR(atomic_modify_mutvar_mutex);
625
626 // RtsFlags
627 extern StgWord RTS_VAR(RtsFlags); // bogus type
628
629 // Stable.c
630 extern StgWord RTS_VAR(stable_ptr_table);
631
632 // Profiling.c
633 extern unsigned int RTS_VAR(era);
634 extern StgWord RTS_VAR(CCCS); /* current CCS */
635 extern unsigned int RTS_VAR(entering_PAP);
636 extern StgWord RTS_VAR(CC_LIST); /* registered CC list */
637 extern StgWord RTS_VAR(CCS_LIST); /* registered CCS list */
638 extern unsigned int RTS_VAR(CC_ID); /* global ids */
639 extern unsigned int RTS_VAR(CCS_ID);
640
641 #endif
642
643 #endif /* STGMISCCLOSURES_H */