@@ -288,38 +288,6 @@ upcall_s_dynastack_free(s_dynastack_free_args *args) {
288
288
return rust_scheduler::get_task ()->dynastack .free (args->ptr );
289
289
}
290
290
291
- struct rust_new_stack2_args {
292
- void *new_stack;
293
- size_t stk_sz;
294
- void *args_addr;
295
- size_t args_sz;
296
- };
297
-
298
- // A new stack function suitable for calling through
299
- // upcall_call_shim_on_c_stack
300
- extern " C" CDECL void
301
- upcall_new_stack (struct rust_new_stack2_args *args) {
302
- rust_task *task = rust_scheduler::get_task ();
303
- args->new_stack = task->new_stack (args->stk_sz ,
304
- args->args_addr ,
305
- args->args_sz );
306
- }
307
-
308
- extern " C" CDECL void
309
- upcall_del_stack () {
310
- rust_task *task = rust_scheduler::get_task ();
311
- task->del_stack ();
312
- }
313
-
314
- // Landing pads need to call this to insert the
315
- // correct limit into TLS.
316
- // NB: This must be called on the Rust stack
317
- extern " C" CDECL void
318
- upcall_reset_stack_limit () {
319
- rust_task *task = rust_scheduler::get_task ();
320
- task->reset_stack_limit ();
321
- }
322
-
323
291
extern " C" _Unwind_Reason_Code
324
292
__gxx_personality_v0 (int version,
325
293
_Unwind_Action actions,
@@ -506,6 +474,42 @@ upcall_log_type(const type_desc *tydesc, uint8_t *data, uint32_t level) {
506
474
upcall_s_log_type (&args);
507
475
}
508
476
477
+ struct rust_new_stack2_args {
478
+ void *new_stack;
479
+ size_t stk_sz;
480
+ void *args_addr;
481
+ size_t args_sz;
482
+ };
483
+
484
+ // A new stack function suitable for calling through
485
+ // upcall_call_shim_on_c_stack
486
+ // FIXME: Convert this to the same arrangement as
487
+ // the other upcalls, simplify __morestack
488
+ extern " C" CDECL void
489
+ upcall_new_stack (struct rust_new_stack2_args *args) {
490
+ rust_task *task = rust_scheduler::get_task ();
491
+ args->new_stack = task->new_stack (args->stk_sz ,
492
+ args->args_addr ,
493
+ args->args_sz );
494
+ }
495
+
496
+ // FIXME: As above
497
+ extern " C" CDECL void
498
+ upcall_del_stack () {
499
+ rust_task *task = rust_scheduler::get_task ();
500
+ task->del_stack ();
501
+ }
502
+
503
+ // Landing pads need to call this to insert the
504
+ // correct limit into TLS.
505
+ // NB: This must run on the Rust stack because it
506
+ // needs to acquire the value of the stack pointer
507
+ extern " C" CDECL void
508
+ upcall_reset_stack_limit () {
509
+ rust_task *task = rust_scheduler::get_task ();
510
+ task->reset_stack_limit ();
511
+ }
512
+
509
513
//
510
514
// Local Variables:
511
515
// mode: C++
0 commit comments