Subversion Repositories HelenOS

Rev

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

Rev 2804 Rev 2805
Line 359... Line 359...
359
    }
359
    }
360
 
360
 
361
    spinlock_unlock(&ta->lock);
361
    spinlock_unlock(&ta->lock);
362
}
362
}
363
 
363
 
-
 
364
static int debug_args_read(call_t *call, phone_t *phone)
-
 
365
{
-
 
366
    thread_t *t;
-
 
367
    link_t *l;
-
 
368
    task_t *ta;
-
 
369
    void *uspace_buffer;
-
 
370
    unative_t to_copy;
-
 
371
    int rc;
-
 
372
 
-
 
373
    klog_printf("debug_args_read()");
-
 
374
    // FIXME: verify task/thread state
-
 
375
 
-
 
376
    ta = get_lock_callee_task(phone);
-
 
377
    klog_printf("task %llu", ta->taskid);
-
 
378
 
-
 
379
    l = ta->th_head.next;
-
 
380
    if (l != &TASK->th_head) {
-
 
381
        t = list_get_instance(l, thread_t, th_link);
-
 
382
        /* t = requested thread */
-
 
383
        uspace_buffer = (void *)IPC_GET_ARG2(call->data);
-
 
384
        to_copy = IPC_GET_ARG3(call->data);
-
 
385
        rc = copy_to_uspace(uspace_buffer, t->syscall_args, to_copy);
-
 
386
        if (rc != 0) {
-
 
387
            spinlock_unlock(&ta->lock);
-
 
388
            klog_printf("debug_args_read() - copy failed");
-
 
389
            return rc;
-
 
390
        }
-
 
391
        IPC_SET_ARG1(call->data, to_copy);
-
 
392
    }
-
 
393
 
-
 
394
    spinlock_unlock(&ta->lock);
-
 
395
 
-
 
396
    klog_printf("debug_args_read() done");
-
 
397
    return 1; /* actually need becksend with retval 0 */
-
 
398
}
-
 
399
 
364
 
400
 
365
/** Called before the request is sent.
401
/** Called before the request is sent.
366
 *
402
 *
367
 * @param call      Call structure with the request.
403
 * @param call      Call structure with the request.
368
 * @param phone     Phone that the call will be sent through.
404
 * @param phone     Phone that the call will be sent through.
Line 412... Line 448...
412
        }
448
        }
413
        break;
449
        break;
414
    case IPC_M_DEBUG_BEGIN:
450
    case IPC_M_DEBUG_BEGIN:
415
        /* actually need possibility of backsend with 0 result code */
451
        /* actually need possibility of backsend with 0 result code */
416
        rc = debug_begin(call, phone);
452
        rc = debug_begin(call, phone);
417
        if (rc != 0) return rc;
453
        return rc;
418
        break;
-
 
419
    case IPC_M_DEBUG_GO:
454
    case IPC_M_DEBUG_GO:
420
        debug_go(call, phone);
455
        debug_go(call, phone);
421
        break;
456
        break;
-
 
457
    case IPC_M_DEBUG_ARGS_READ:
-
 
458
        rc = debug_args_read(call, phone);
-
 
459
        return rc;
422
    default:
460
    default:
423
        break;
461
        break;
424
    }
462
    }
425
    return 0;
463
    return 0;
426
}
464
}