One exit_task_glue to rule them all.
This commit is contained in:
parent
6a4a85f452
commit
96516e9ca2
8 changed files with 23 additions and 10 deletions
11
src/rt/new_exit.ll
Normal file
11
src/rt/new_exit.ll
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
declare fastcc i32 @rust_native_rust_1(i32, i32)
|
||||
|
||||
declare i32 @upcall_exit(i32)
|
||||
|
||||
define void @rust_new_exit_task_glue(i32, i32, i32, i32, i32) {
|
||||
entry:
|
||||
%5 = inttoptr i32 %0 to void (i32, i32, i32, i32)*
|
||||
tail call fastcc void %5(i32 %1, i32 %2, i32 %3, i32 %4)
|
||||
%6 = tail call fastcc i32 @rust_native_rust_1(i32 ptrtoint (i32 (i32)* @upcall_exit to i32), i32 %2)
|
||||
ret void
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ rust_start(uintptr_t main_fn, rust_crate const *crate, int argc,
|
|||
}
|
||||
|
||||
uintptr_t main_args[4] = {0, 0, 0, (uintptr_t)args->args};
|
||||
dom->root_task->start(crate->get_exit_task_glue(),
|
||||
dom->root_task->start((uintptr_t)rust_new_exit_task_glue,
|
||||
main_fn,
|
||||
(uintptr_t)&main_args, sizeof(main_args));
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,6 @@ rust_crate::get_activate_glue() const {
|
|||
return (activate_glue_ty) ((uintptr_t)this + activate_glue_off);
|
||||
}
|
||||
|
||||
uintptr_t
|
||||
rust_crate::get_exit_task_glue() const {
|
||||
return ((uintptr_t)this + exit_task_glue_off);
|
||||
}
|
||||
|
||||
uintptr_t
|
||||
rust_crate::get_unwind_glue() const {
|
||||
return ((uintptr_t)this + unwind_glue_off);
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ rust_dom::start_main_loop() {
|
|||
|
||||
DLOG(this, dom, "started domain loop");
|
||||
DLOG(this, dom, "activate glue: " PTR ", exit glue: " PTR,
|
||||
root_crate->get_activate_glue(), root_crate->get_exit_task_glue());
|
||||
root_crate->get_activate_glue(), rust_new_exit_task_glue);
|
||||
|
||||
while (number_of_live_tasks() > 0) {
|
||||
A(this, kernel->is_deadlocked() == false, "deadlock");
|
||||
|
|
|
|||
|
|
@ -251,7 +251,6 @@ public:
|
|||
uintptr_t get_yield_glue() const;
|
||||
uintptr_t get_unwind_glue() const;
|
||||
uintptr_t get_gc_glue() const;
|
||||
uintptr_t get_exit_task_glue() const;
|
||||
|
||||
struct mem_area
|
||||
{
|
||||
|
|
@ -358,6 +357,8 @@ public:
|
|||
void flush();
|
||||
};
|
||||
|
||||
extern "C" void rust_new_exit_task_glue();
|
||||
|
||||
#include "rust_dwarf.h"
|
||||
|
||||
class
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ rust_task_test::worker::run() {
|
|||
rust_handle<rust_dom> *handle =
|
||||
kernel->create_domain(crate, "test");
|
||||
rust_dom *domain = handle->referent();
|
||||
domain->root_task->start(crate->get_exit_task_glue(),
|
||||
domain->root_task->start((uintptr_t)rust_new_exit_task_glue,
|
||||
(uintptr_t)&task_entry, (uintptr_t)NULL, 0);
|
||||
domain->start_main_loop();
|
||||
kernel->destroy_domain(domain);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue