Making more of the rust_task structure directly accessible from Rust.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user