diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-08-17 14:42:28 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-08-17 14:42:40 -0700 |
| commit | ae89ea223de2fe5e9c9a5cdd2fa85a93828a7daa (patch) | |
| tree | 1a28bb09eaeaf105bd84cc62c6a3e6c9ae2a8b8f /src/rt/rust_builtin.cpp | |
| parent | efac7c9a197fa3ff3497ce99a2dda8693b3ef683 (diff) | |
| download | rust-ae89ea223de2fe5e9c9a5cdd2fa85a93828a7daa.tar.gz rust-ae89ea223de2fe5e9c9a5cdd2fa85a93828a7daa.zip | |
Making more of the rust_task structure directly accessible from Rust.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 2675368fd88..aa00de961b8 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -712,7 +712,7 @@ unpin_task(rust_task *task) { extern "C" CDECL rust_task_id get_task_id(rust_task *task) { - return task->id; + return task->user.id; } extern "C" CDECL rust_task_id @@ -720,30 +720,16 @@ new_task(rust_task *task) { return task->kernel->create_task(task, NULL); } -extern "C" CDECL registers_t * -get_task_context(rust_task *task, rust_task_id id) { - rust_task *target = task->kernel->get_task_by_id(id); - registers_t *regs = &target->ctx.regs; - // This next line is a little dangerous.. It means we can only safely call - // this when starting a task. - regs->esp = target->rust_sp; - return regs; -} - extern "C" CDECL void -drop_task(rust_task *task, rust_task_id tid) { - rust_task *target = task->kernel->get_task_by_id(tid); +drop_task(rust_task *task, rust_task *target) { if(target) { target->deref(); - // Deref twice because get_task_by_id does once. - target->deref(); } } extern "C" CDECL rust_task * get_task_pointer(rust_task *task, rust_task_id id) { - rust_task *t = task->kernel->get_task_by_id(id); - return t; + return task->kernel->get_task_by_id(id); } extern "C" CDECL void |
