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