51,7 → 51,7 |
#include <debug.h> |
|
#include <print.h> |
#include <console/klog.h> |
#include <console/console.h> |
#include <proc/thread.h> |
#include <arch/interrupt.h> |
#include <ipc/irq.h> |
67,7 → 67,7 |
*/ |
static void _ipc_call_init(call_t *call) |
{ |
memsetb((uintptr_t) call, sizeof(*call), 0); |
memsetb(call, sizeof(*call), 0); |
call->callerbox = &TASK->answerbox; |
call->sender = TASK; |
call->buffer = NULL; |
516,10 → 516,10 |
ipc_answerbox_slam_phones(&TASK->kernel_box, have_kb_thread); |
|
if (have_kb_thread) { |
klog_printf("join kb_thread.."); |
printf("join kb_thread..\n"); |
thread_join(TASK->kb_thread); |
thread_detach(TASK->kb_thread); |
klog_printf("join done"); |
printf("join done\n"); |
TASK->kb_thread = NULL; |
} |
|
652,7 → 652,7 |
default: |
break; |
} |
printf("active: %d\n", |
printf("active: %ld\n", |
atomic_get(&task->phones[i].active_calls)); |
} |
mutex_unlock(&task->phones[i].lock); |
665,8 → 665,9 |
for (tmp = task->answerbox.calls.next; tmp != &task->answerbox.calls; |
tmp = tmp->next) { |
call = list_get_instance(tmp, call_t, link); |
printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d " |
"A4:%d A5:%d Flags:%x\n", call, call->sender->taskid, |
printf("Callid: %p Srctask:%" PRIu64 " M:%" PRIun |
" A1:%" PRIun " A2:%" PRIun " A3:%" PRIun |
" A4:%" PRIun " A5:%" PRIun " Flags:%x\n", call, call->sender->taskid, |
IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data), |
IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), |
IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data), |
674,12 → 675,13 |
} |
/* Print answerbox - calls */ |
printf("ABOX - DISPATCHED CALLS:\n"); |
for (tmp = task->answerbox.dispatched_calls.next; |
tmp != &task->answerbox.dispatched_calls; |
tmp = tmp->next) { |
for (tmp = task->answerbox.dispatched_calls.next; |
tmp != &task->answerbox.dispatched_calls; |
tmp = tmp->next) { |
call = list_get_instance(tmp, call_t, link); |
printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d " |
"A4:%d A5:%d Flags:%x\n", call, call->sender->taskid, |
printf("Callid: %p Srctask:%" PRIu64 " M:%" PRIun |
" A1:%" PRIun " A2:%" PRIun " A3:%" PRIun |
" A4:%" PRIun " A5:%" PRIun " Flags:%x\n", call, call->sender->taskid, |
IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data), |
IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), |
IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data), |
690,7 → 692,8 |
for (tmp = task->answerbox.answers.next; tmp != &task->answerbox.answers; |
tmp = tmp->next) { |
call = list_get_instance(tmp, call_t, link); |
printf("Callid:%p M:%d A1:%d A2:%d A3:%d A4:%d A5:%d Flags:%x\n", |
printf("Callid:%p M:%" PRIun " A1:%" PRIun " A2:%" PRIun |
" A3:%" PRIun " A4:%" PRIun " A5:%" PRIun " Flags:%x\n", |
call, IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data), |
IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), |
IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data), |
702,7 → 705,7 |
} |
|
#include <ipc/ipcrsc.h> |
#include <console/klog.h> |
#include <print.h> |
#include <udebug/udebug_ipc.h> |
|
static void kbox_thread_proc(void *arg) |
713,11 → 716,11 |
ipl_t ipl; |
|
(void)arg; |
klog_printf("kbox_thread_proc()"); |
printf("kbox_thread_proc()\n"); |
done = false; |
|
while (!done) { |
//klog_printf("kbox: wait for call"); |
//printf("kbox: wait for call\n"); |
call = ipc_wait_for_call(&TASK->kernel_box, SYNCH_NO_TIMEOUT, |
SYNCH_FLAGS_NONE); |
|
729,12 → 732,12 |
} |
|
if (method == IPC_M_PHONE_HUNGUP) { |
klog_printf("kbox: handle hangup message"); |
printf("kbox: handle hangup message\n"); |
|
/* Was it our debugger, who hung up? */ |
if (call->sender == TASK->udebug.debugger) { |
/* Terminate debugging session (if any) */ |
klog_printf("kbox: terminate debug session"); |
printf("kbox: terminate debug session\n"); |
ipl = interrupts_disable(); |
spinlock_lock(&TASK->lock); |
udebug_task_cleanup(TASK); |
741,10 → 744,10 |
spinlock_unlock(&TASK->lock); |
interrupts_restore(ipl); |
} else { |
klog_printf("kbox: was not debugger"); |
printf("kbox: was not debugger\n"); |
} |
|
klog_printf("kbox: continue with hangup message"); |
printf("kbox: continue with hangup message\n"); |
IPC_SET_RETVAL(call->data, 0); |
ipc_answer(&TASK->kernel_box, call); |
|
755,7 → 758,7 |
/* Last phone has been disconnected */ |
TASK->kb_thread = NULL; |
done = true; |
klog_printf("phone list is empty"); |
printf("phone list is empty\n"); |
} |
spinlock_unlock(&TASK->answerbox.lock); |
spinlock_unlock(&TASK->lock); |
764,7 → 767,7 |
} |
} |
|
klog_printf("kbox: finished"); |
printf("kbox: finished\n"); |
} |
|
|