Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2804 → Rev 2805

/branches/tracing/kernel/generic/src/ipc/sysipc.c
361,7 → 361,43
spinlock_unlock(&ta->lock);
}
 
static int debug_args_read(call_t *call, phone_t *phone)
{
thread_t *t;
link_t *l;
task_t *ta;
void *uspace_buffer;
unative_t to_copy;
int rc;
 
klog_printf("debug_args_read()");
// FIXME: verify task/thread state
 
ta = get_lock_callee_task(phone);
klog_printf("task %llu", ta->taskid);
 
l = ta->th_head.next;
if (l != &TASK->th_head) {
t = list_get_instance(l, thread_t, th_link);
/* t = requested thread */
uspace_buffer = (void *)IPC_GET_ARG2(call->data);
to_copy = IPC_GET_ARG3(call->data);
rc = copy_to_uspace(uspace_buffer, t->syscall_args, to_copy);
if (rc != 0) {
spinlock_unlock(&ta->lock);
klog_printf("debug_args_read() - copy failed");
return rc;
}
IPC_SET_ARG1(call->data, to_copy);
}
 
spinlock_unlock(&ta->lock);
 
klog_printf("debug_args_read() done");
return 1; /* actually need becksend with retval 0 */
}
 
 
/** Called before the request is sent.
*
* @param call Call structure with the request.
414,11 → 450,13
case IPC_M_DEBUG_BEGIN:
/* actually need possibility of backsend with 0 result code */
rc = debug_begin(call, phone);
if (rc != 0) return rc;
break;
return rc;
case IPC_M_DEBUG_GO:
debug_go(call, phone);
break;
case IPC_M_DEBUG_ARGS_READ:
rc = debug_args_read(call, phone);
return rc;
default:
break;
}