Skip to content

Commit b81c3b8

Browse files
committed
---
yaml --- r: 6602 b: refs/heads/master c: 3d7b89b h: refs/heads/master v: v3
1 parent c236ccb commit b81c3b8

File tree

2 files changed

+37
-33
lines changed

2 files changed

+37
-33
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 00636e3155647f843fb1f8e8c981429feb8dd7f2
2+
refs/heads/master: 3d7b89bc4dc63632ee0003869811933ddc1962e9

trunk/src/rt/rust_upcall.cpp

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -288,38 +288,6 @@ upcall_s_dynastack_free(s_dynastack_free_args *args) {
288288
return rust_scheduler::get_task()->dynastack.free(args->ptr);
289289
}
290290

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-
323291
extern "C" _Unwind_Reason_Code
324292
__gxx_personality_v0(int version,
325293
_Unwind_Action actions,
@@ -506,6 +474,42 @@ upcall_log_type(const type_desc *tydesc, uint8_t *data, uint32_t level) {
506474
upcall_s_log_type(&args);
507475
}
508476

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+
509513
//
510514
// Local Variables:
511515
// mode: C++

0 commit comments

Comments
 (0)