32,19 → 32,6 |
return ta; |
} |
|
static thread_t *get_task_thread_by_id(task_t *ta, thread_id_t tid) |
{ |
thread_t *t; |
link_t *cur; |
|
for (cur = ta->th_head.next; cur != &ta->th_head; cur = cur->next) { |
t = list_get_instance(cur, thread_t, th_link); |
if (tid == t->tid) return t; |
} |
|
return NULL; |
} |
|
static int udebug_rp_begin(call_t *call, phone_t *phone) |
{ |
task_t *ta; |
86,9 → 73,10 |
klog_printf("debug_go()"); |
ta = get_lock_callee_task(phone); |
|
// FIXME: must save this in thread struct, not task struct!!! |
ta->debug_go_call = call; |
t = get_task_thread_by_id(ta, IPC_GET_ARG2(call->data)); |
if (t == NULL) { |
t = (thread_t *) IPC_GET_ARG2(call->data); |
if (!thread_exists(t)) { |
spinlock_unlock(&ta->lock); |
return ENOENT; |
} |
114,8 → 102,8 |
|
ta = get_lock_callee_task(phone); |
klog_printf("task %llu", ta->taskid); |
t = get_task_thread_by_id(ta, IPC_GET_ARG2(call->data)); |
if (t == NULL) { |
t = (thread_t *) IPC_GET_ARG2(call->data); |
if (!thread_exists(t)) { |
spinlock_unlock(&ta->lock); |
return ENOENT; |
} |
168,8 → 156,8 |
if ((t->flags & THREAD_FLAG_USPACE) == 0) |
continue; |
|
//FIXME: id cropped!! |
tid = (unative_t) t->tid; |
/* Using thread struct pointer for identification */ |
tid = (unative_t) t; |
|
to_copy = sizeof(unative_t); |
if (copied + to_copy >= buf_size) |