267,15 → 267,8 |
} |
|
/* Allocate a buffer and copy down the threads' ids */ |
//FIXME!!! must not malloc when locks are held |
id_buffer = malloc(num_threads * sizeof(unative_t), 0); |
if (!id_buffer) { |
spinlock_unlock(&TASK->lock); |
interrupts_restore(ipl); |
id_buffer = malloc(num_threads * sizeof(unative_t), 0); // ??? |
|
return ENOMEM; |
} |
|
copied_ids = 0; |
for (cur = TASK->th_head.next; cur != &TASK->th_head; cur = cur->next) { |
t = list_get_instance(cur, thread_t, th_link); |
309,10 → 302,6 |
|
klog_printf("udebug_args_read()"); |
|
/* Prepare a buffer to hold the arguments */ |
arg_buffer = malloc(6 * sizeof(unative_t), 0); |
if (!arg_buffer) return ENOMEM; |
|
ipl = interrupts_disable(); |
|
/* On success, this will lock t->debug_lock */ |
331,6 → 320,7 |
} |
|
/* Copy to a local buffer before releasing the lock */ |
arg_buffer = malloc(6 * sizeof(unative_t), 0); // ??? |
memcpy(arg_buffer, t->syscall_args, 6 * sizeof(unative_t)); |
|
_thread_op_end(t); |
349,10 → 339,6 |
|
klog_printf("udebug_regs_read()"); |
|
/* Prepare a buffer to hold the registers */ |
regs_buffer = malloc(sizeof(istate_t), 0); |
if (!regs_buffer) return ENOMEM; |
|
ipl = interrupts_disable(); |
|
/* On success, this will lock t->debug_lock */ |
370,7 → 356,8 |
return EBUSY; |
} |
|
/* Copy to the allocated buffer */ |
/* Copy to an allocated buffer */ |
regs_buffer = malloc(sizeof(istate_t), 0); // ??? |
memcpy(regs_buffer, state, sizeof(istate_t)); |
|
_thread_op_end(t); |
426,9 → 413,7 |
|
klog_printf("udebug_mem_read()"); |
|
data_buffer = malloc(n, 0); |
if (!data_buffer) return ENOMEM; |
|
data_buffer = malloc(n, 0); // ??? |
klog_printf("udebug_mem_read: src=%u, size=%u", uspace_addr, n); |
|
/* NOTE: this is not strictly from a syscall... but that shouldn't |