From ae89ea223de2fe5e9c9a5cdd2fa85a93828a7daa Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Wed, 17 Aug 2011 14:42:28 -0700 Subject: Making more of the rust_task structure directly accessible from Rust. --- src/rt/rust_task.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/rt/rust_task.cpp') diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index b8269554237..7b8160f3637 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -57,7 +57,6 @@ rust_task::rust_task(rust_scheduler *sched, rust_task_list *state, ref_count(1), stk(NULL), runtime_sp(0), - rust_sp(0), gc_alloc_chain(0), sched(sched), cache(NULL), @@ -86,7 +85,7 @@ rust_task::rust_task(rust_scheduler *sched, rust_task_list *state, user.notify_enabled = 0; stk = new_stk(sched, this, 0); - rust_sp = stk->limit; + user.rust_sp = stk->limit; } rust_task::~rust_task() @@ -99,7 +98,7 @@ rust_task::~rust_task() get_chan_by_handle(&user.notify_chan); if(target) { task_notification msg; - msg.id = id; + msg.id = user.id; msg.result = failed ? tr_failure : tr_success; target->send(&msg); @@ -107,7 +106,7 @@ rust_task::~rust_task() } } - kernel->release_task_id(id); + kernel->release_task_id(user.id); /* FIXME: tighten this up, there are some more assertions that hold at task-lifecycle events. */ @@ -166,7 +165,7 @@ rust_task::start(uintptr_t spawnee_fn, I(sched, stk->data != NULL); - char *sp = (char *)rust_sp; + char *sp = (char *)user.rust_sp; sp -= sizeof(spawn_args); @@ -178,7 +177,7 @@ rust_task::start(uintptr_t spawnee_fn, void **f = (void **)&a->f; *f = (void *)spawnee_fn; - ctx.call((void *)task_start_wrapper, a, sp); + user.ctx.call((void *)task_start_wrapper, a, sp); this->start(); } @@ -213,7 +212,7 @@ rust_task::yield(size_t time_in_us) { yield_timer.reset_us(time_in_us); // Return to the scheduler. - ctx.next->swap(ctx); + user.ctx.next->swap(user.ctx); } void -- cgit 1.4.1-3-g733a5