Subversion Repositories HelenOS

Rev

Rev 2851 | Rev 2870 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2851 Rev 2866
Line 51... Line 51...
51
 *
51
 *
52
 * This will return a pointer to the task to which the phone
52
 * This will return a pointer to the task to which the phone
53
 * is connected. It will lock the task, making sure it exists.
53
 * is connected. It will lock the task, making sure it exists.
54
 *
54
 *
55
 * Interrupts must be already disabled.
55
 * Interrupts must be already disabled.
56
 *
-
 
57
 * (TODO: make sure the udebug-cleanup of the task hasn't
-
 
58
 * started yet)
-
 
59
 */
56
 */
60
static task_t *get_lock_callee_task(phone_t *phone)
57
static task_t *get_lock_callee_task(phone_t *phone)
61
{
58
{
62
    task_t *ta;
59
    task_t *ta;
63
    task_id_t taskid;
60
    task_id_t taskid;
Line 257... Line 254...
257
 
254
 
258
        /* Only process userspace threads */
255
        /* Only process userspace threads */
259
        if ((flags & THREAD_FLAG_USPACE) != 0) {
256
        if ((flags & THREAD_FLAG_USPACE) != 0) {
260
            /* Prevent any further debug activity in thread */
257
            /* Prevent any further debug activity in thread */
261
            t->debug_active = false;
258
            t->debug_active = false;
-
 
259
            t->cur_event = 0;   /* none */
262
 
260
 
263
            /* Still has go? */
261
            /* Still has go? */
264
            if (t->debug_stop == false) {
262
            if (t->debug_stop == false) {
265
                /*
263
                /*
266
                * Yes, so clear go. As debug_active == false,
264
                * Yes, so clear go. As debug_active == false,
Line 321... Line 319...
321
        return rc;
319
        return rc;
322
    }
320
    }
323
 
321
 
324
    t->debug_go_call = call;
322
    t->debug_go_call = call;
325
    t->debug_stop = false;
323
    t->debug_stop = false;
-
 
324
    t->cur_event = 0;   /* none */
326
 
325
 
327
    /*
326
    /*
328
     * Neither t's lock nor threads_lock may be held during wakeup
327
     * Neither t's lock nor threads_lock may be held during wakeup
329
     */
328
     */
330
    waitq_wakeup(&t->go_wq, WAKEUP_FIRST);
329
    waitq_wakeup(&t->go_wq, WAKEUP_FIRST);
Line 354... Line 353...
354
    if (rc != EOK) {
353
    if (rc != EOK) {
355
        interrupts_restore(ipl);
354
        interrupts_restore(ipl);
356
        return rc;
355
        return rc;
357
    }
356
    }
358
 
357
 
359
    //FIXME: additionally we need to verify that we are inside a syscall
358
    /* Additionally we need to verify that we are inside a syscall */
-
 
359
    if (t->cur_event != UDEBUG_EVENT_SYSCALL) {
-
 
360
        _thread_op_end(t);
-
 
361
        interrupts_restore(ipl);
-
 
362
        return EINVAL;
-
 
363
    }
360
 
364
 
361
    /* Copy to a local buffer before releasing the lock */
365
    /* Copy to a local buffer before releasing the lock */
362
    memcpy(buffer, t->syscall_args, 6 * sizeof(unative_t));
366
    memcpy(buffer, t->syscall_args, 6 * sizeof(unative_t));
363
 
367
 
364
    _thread_op_end(t);
368
    _thread_op_end(t);