Rev 2825 | Rev 2827 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2825 | Rev 2826 | ||
---|---|---|---|
Line 108... | Line 108... | ||
108 | task_t *ta; |
108 | task_t *ta; |
109 | ipl_t ipl; |
109 | ipl_t ipl; |
110 | 110 | ||
111 | klog_printf("debug_go()"); |
111 | klog_printf("debug_go()"); |
112 | ta = get_lock_callee_task(phone); |
112 | ta = get_lock_callee_task(phone); |
113 | - | ||
114 | // FIXME: must save this in thread struct, not task struct!!! |
- | |
115 | ta->debug_go_call = call; |
- | |
116 | spinlock_unlock(&ta->lock); |
113 | spinlock_unlock(&ta->lock); |
- | 114 | // TODO: don't lock ta |
|
117 | 115 | ||
118 | t = (thread_t *) IPC_GET_ARG2(call->data); |
116 | t = (thread_t *) IPC_GET_ARG2(call->data); |
119 | 117 | ||
120 | ipl = interrupts_disable(); |
118 | ipl = interrupts_disable(); |
121 | spinlock_lock(&threads_lock); |
119 | spinlock_lock(&threads_lock); |
122 | 120 | ||
- | 121 | /* Verify that 't' exists and belongs to task 'ta' */ |
|
123 | if (!thread_exists(t)) { |
122 | if (!thread_exists(t) || (t->task != ta)) { |
124 | spinlock_unlock(&threads_lock); |
123 | spinlock_unlock(&threads_lock); |
125 | interrupts_restore(ipl); |
124 | interrupts_restore(ipl); |
126 | return ENOENT; |
125 | return ENOENT; |
127 | } |
126 | } |
128 | 127 | ||
- | 128 | t->debug_go_call = call; |
|
129 | t->debug_stop = false; |
129 | t->debug_stop = false; |
130 | waitq_wakeup(&t->go_wq, WAKEUP_FIRST); |
130 | waitq_wakeup(&t->go_wq, WAKEUP_FIRST); |
131 | 131 | ||
132 | spinlock_unlock(&threads_lock); |
132 | spinlock_unlock(&threads_lock); |
133 | interrupts_restore(ipl); |
133 | interrupts_restore(ipl); |