56,9 → 56,7 |
klog_printf("debug_regs_write()"); |
|
uspace_data = (void *)IPC_GET_ARG3(call->data); |
to_copy = IPC_GET_ARG4(call->data); |
if (to_copy > sizeof(istate_t)) to_copy = sizeof(istate_t); |
|
to_copy = sizeof(istate_t); |
buffer = malloc(to_copy, 0); |
|
rc = copy_from_uspace(buffer, uspace_data, to_copy); |
277,17 → 275,15 |
thread_t *t; |
unative_t uspace_addr; |
unative_t to_copy; |
unative_t buf_size; |
unative_t total_bytes; |
void *buffer; |
int rc; |
size_t n; |
|
klog_printf("debug_regs_read()"); |
|
t = (thread_t *) IPC_GET_ARG2(call->data); |
buffer = malloc(sizeof(istate_t), 0); |
|
rc = udebug_regs_read(t, &buffer, &n); |
rc = udebug_regs_read(t, buffer); |
if (rc < 0) { |
IPC_SET_RETVAL(call->data, rc); |
ipc_answer(&TASK->kernel_box, call); |
299,15 → 295,8 |
*/ |
|
uspace_addr = IPC_GET_ARG3(call->data); |
buf_size = IPC_GET_ARG4(call->data); |
to_copy = sizeof(istate_t); |
|
total_bytes = n; |
|
if (buf_size > total_bytes) |
to_copy = total_bytes; |
else |
to_copy = buf_size; |
|
IPC_SET_RETVAL(call->data, 0); |
/* ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that |
same code in process_answer() can be used |
315,7 → 304,6 |
IPC_SET_ARG1(call->data, uspace_addr); |
IPC_SET_ARG2(call->data, to_copy); |
|
IPC_SET_ARG3(call->data, total_bytes); |
call->buffer = buffer; |
|
ipc_answer(&TASK->kernel_box, call); |
325,14 → 313,11 |
{ |
thread_t *t; |
void *uspace_data; |
unative_t to_copy; |
int rc; |
|
t = (thread_t *) IPC_GET_ARG2(call->data); |
uspace_data = (void *)IPC_GET_ARG3(call->data); |
to_copy = IPC_GET_ARG4(call->data); |
|
t = (thread_t *) IPC_GET_ARG2(call->data); |
|
rc = udebug_regs_write(t, call->buffer); |
if (rc < 0) { |
IPC_SET_RETVAL(call->data, rc); |
342,9 → 327,6 |
|
/* Set answer values */ |
|
IPC_SET_ARG1(call->data, to_copy); |
IPC_SET_ARG2(call->data, sizeof(istate_t)); |
|
IPC_SET_RETVAL(call->data, 0); |
free(call->buffer); |
call->buffer = NULL; |