Rev 3013 | Rev 3016 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3013 | Rev 3014 | ||
---|---|---|---|
Line 140... | Line 140... | ||
140 | ipl = interrupts_disable(); |
140 | ipl = interrupts_disable(); |
141 | klog_printf("debugging task %llu", TASK->taskid); |
141 | klog_printf("debugging task %llu", TASK->taskid); |
142 | 142 | ||
143 | spinlock_lock(&TASK->lock); |
143 | spinlock_lock(&TASK->lock); |
144 | 144 | ||
145 | if (TASK->dt_state != UDEBUG_TS_INACTIVE) { |
145 | if (TASK->udebug.dt_state != UDEBUG_TS_INACTIVE) { |
146 | spinlock_unlock(&TASK->lock); |
146 | spinlock_unlock(&TASK->lock); |
147 | interrupts_restore(ipl); |
147 | interrupts_restore(ipl); |
148 | klog_printf("udebug_begin(): busy error"); |
148 | klog_printf("udebug_begin(): busy error"); |
149 | 149 | ||
150 | return EBUSY; |
150 | return EBUSY; |
151 | } |
151 | } |
152 | 152 | ||
153 | TASK->dt_state = UDEBUG_TS_BEGINNING; |
153 | TASK->udebug.dt_state = UDEBUG_TS_BEGINNING; |
154 | TASK->debug_begin_call = call; |
154 | TASK->udebug.begin_call = call; |
155 | TASK->debugger = call->sender; |
155 | TASK->udebug.debugger = call->sender; |
156 | 156 | ||
157 | if (TASK->not_stoppable_count == 0) { |
157 | if (TASK->udebug.not_stoppable_count == 0) { |
158 | TASK->dt_state = UDEBUG_TS_ACTIVE; |
158 | TASK->udebug.dt_state = UDEBUG_TS_ACTIVE; |
159 | TASK->debug_begin_call = NULL; |
159 | TASK->udebug.begin_call = NULL; |
160 | reply = 1; /* immediate reply */ |
160 | reply = 1; /* immediate reply */ |
161 | } else { |
161 | } else { |
162 | reply = 0; /* no reply */ |
162 | reply = 0; /* no reply */ |
163 | } |
163 | } |
164 | 164 | ||
Line 213... | Line 213... | ||
213 | ipl = interrupts_disable(); |
213 | ipl = interrupts_disable(); |
214 | klog_printf("debugging task %llu", TASK->taskid); |
214 | klog_printf("debugging task %llu", TASK->taskid); |
215 | 215 | ||
216 | spinlock_lock(&TASK->lock); |
216 | spinlock_lock(&TASK->lock); |
217 | 217 | ||
218 | if (TASK->dt_state != UDEBUG_TS_ACTIVE) { |
218 | if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) { |
219 | spinlock_unlock(&TASK->lock); |
219 | spinlock_unlock(&TASK->lock); |
220 | interrupts_restore(ipl); |
220 | interrupts_restore(ipl); |
221 | klog_printf("udebug_set_mask(): not active debuging session"); |
221 | klog_printf("udebug_set_mask(): not active debuging session"); |
222 | 222 | ||
223 | return EINVAL; |
223 | return EINVAL; |
224 | } |
224 | } |
225 | 225 | ||
226 | TASK->debug_evmask = mask; |
226 | TASK->udebug.evmask = mask; |
227 | 227 | ||
228 | spinlock_unlock(&TASK->lock); |
228 | spinlock_unlock(&TASK->lock); |
229 | interrupts_restore(ipl); |
229 | interrupts_restore(ipl); |
230 | 230 | ||
231 | return 0; |
231 | return 0; |
Line 335... | Line 335... | ||
335 | 335 | ||
336 | ipl = interrupts_disable(); |
336 | ipl = interrupts_disable(); |
337 | spinlock_lock(&TASK->lock); |
337 | spinlock_lock(&TASK->lock); |
338 | 338 | ||
339 | /* Verify task state */ |
339 | /* Verify task state */ |
340 | if (TASK->dt_state != UDEBUG_TS_ACTIVE) { |
340 | if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) { |
341 | spinlock_unlock(&TASK->lock); |
341 | spinlock_unlock(&TASK->lock); |
342 | interrupts_restore(ipl); |
342 | interrupts_restore(ipl); |
343 | 343 | ||
344 | return EINVAL; |
344 | return EINVAL; |
345 | } |
345 | } |
Line 514... | Line 514... | ||
514 | 514 | ||
515 | klog_printf("udebug_mem_write()"); |
515 | klog_printf("udebug_mem_write()"); |
516 | 516 | ||
517 | /* Verify task state */ |
517 | /* Verify task state */ |
518 | spinlock_lock(&TASK->lock); |
518 | spinlock_lock(&TASK->lock); |
519 | dts = TASK->dt_state; |
519 | dts = TASK->udebug.dt_state; |
520 | spinlock_unlock(&TASK->lock); |
520 | spinlock_unlock(&TASK->lock); |
521 | 521 | ||
522 | if (dts != UDEBUG_TS_ACTIVE) |
522 | if (dts != UDEBUG_TS_ACTIVE) |
523 | return EBUSY; |
523 | return EBUSY; |
524 | 524 |