Changeset 0108984a in mainline
- Timestamp:
- 2008-09-17T13:38:18Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c9a29d6
- Parents:
- fb9b0b0
- Location:
- kernel/generic/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc_kbox.c
rfb9b0b0 r0108984a 40 40 #include <arch.h> 41 41 #include <errno.h> 42 #include < print.h>42 #include <debug.h> 43 43 #include <udebug/udebug_ipc.h> 44 44 #include <ipc/ipc_kbox.h> … … 66 66 67 67 if (have_kb_thread) { 68 printf("join kb_thread..\n");68 LOG("join kb_thread..\n"); 69 69 thread_join(TASK->kb_thread); 70 70 thread_detach(TASK->kb_thread); 71 printf("join done\n");71 LOG("join done\n"); 72 72 TASK->kb_thread = NULL; 73 73 } … … 89 89 90 90 (void)arg; 91 printf("kbox_thread_proc()\n");91 LOG("kbox_thread_proc()\n"); 92 92 done = false; 93 93 94 94 while (!done) { 95 //printf("kbox: wait for call\n");96 95 call = ipc_wait_for_call(&TASK->kernel_box, SYNCH_NO_TIMEOUT, 97 96 SYNCH_FLAGS_NONE); … … 105 104 106 105 if (method == IPC_M_PHONE_HUNGUP) { 107 printf("kbox: handle hangup message\n");106 LOG("kbox: handle hangup message\n"); 108 107 109 108 /* Was it our debugger, who hung up? */ 110 109 if (call->sender == TASK->udebug.debugger) { 111 110 /* Terminate debugging session (if any) */ 112 printf("kbox: terminate debug session\n");111 LOG("kbox: terminate debug session\n"); 113 112 ipl = interrupts_disable(); 114 113 spinlock_lock(&TASK->lock); … … 117 116 interrupts_restore(ipl); 118 117 } else { 119 printf("kbox: was not debugger\n");118 LOG("kbox: was not debugger\n"); 120 119 } 121 120 122 printf("kbox: continue with hangup message\n");121 LOG("kbox: continue with hangup message\n"); 123 122 IPC_SET_RETVAL(call->data, 0); 124 123 ipc_answer(&TASK->kernel_box, call); … … 131 130 TASK->kb_thread = NULL; 132 131 done = true; 133 printf("phone list is empty\n");132 LOG("phone list is empty\n"); 134 133 } 135 134 spinlock_unlock(&TASK->answerbox.lock); … … 140 139 } 141 140 142 printf("kbox: finished\n");141 LOG("kbox: finished\n"); 143 142 } 144 143 -
kernel/generic/src/ipc/sysipc.c
rfb9b0b0 r0108984a 46 46 #include <udebug/udebug_ipc.h> 47 47 #include <arch/interrupt.h> 48 #include <print.h>49 48 #include <syscall/copy.h> 50 49 #include <security/cap.h> … … 900 899 return (unative_t) rc; 901 900 902 printf("sys_ipc_connect_kbox(%lld, %d)\n", taskid_arg.value);901 LOG("sys_ipc_connect_kbox(%" PRIu64 ")\n", taskid_arg.value); 903 902 904 903 return ipc_connect_kbox(taskid_arg.value); -
kernel/generic/src/udebug/udebug.c
rfb9b0b0 r0108984a 49 49 50 50 #include <synch/waitq.h> 51 #include < print.h>51 #include <debug.h> 52 52 #include <udebug/udebug.h> 53 53 #include <errno.h> … … 332 332 mutex_lock(&THREAD->udebug.lock); 333 333 334 printf("udebug_thread_b_event\n");335 printf("- check state\n");334 LOG("udebug_thread_b_event\n"); 335 LOG("- check state\n"); 336 336 337 337 /* Must only generate events when in debugging session */ 338 338 if (THREAD->udebug.debug_active != true) { 339 printf("- debug_active: %s, udebug.stop: %s\n",339 LOG("- debug_active: %s, udebug.stop: %s\n", 340 340 THREAD->udebug.debug_active ? "yes(+)" : "no(-)", 341 341 THREAD->udebug.stop ? "yes(-)" : "no(+)"); … … 345 345 } 346 346 347 printf("- trigger event\n");347 LOG("- trigger event\n"); 348 348 349 349 call = THREAD->udebug.go_call; … … 366 366 mutex_unlock(&TASK->udebug.lock); 367 367 368 printf("- sleep\n");368 LOG("- sleep\n"); 369 369 udebug_wait_for_go(&THREAD->udebug.go_wq); 370 370 … … 381 381 mutex_lock(&THREAD->udebug.lock); 382 382 383 // printf("udebug_thread_e_event\n");384 // printf("- check state\n");383 LOG("udebug_thread_e_event\n"); 384 LOG("- check state\n"); 385 385 386 386 /* Must only generate events when in debugging session */ … … 394 394 } 395 395 396 // printf("- trigger event\n");396 LOG("- trigger event\n"); 397 397 398 398 call = THREAD->udebug.go_call; … … 428 428 ipl_t ipl; 429 429 430 printf("udebug_task_cleanup()\n");431 printf("task %llu\n", ta->taskid);430 LOG("udebug_task_cleanup()\n"); 431 LOG("task %" PRIu64 "\n", ta->taskid); 432 432 433 433 udebug_int_lock(); … … 435 435 if (ta->udebug.dt_state != UDEBUG_TS_BEGINNING && 436 436 ta->udebug.dt_state != UDEBUG_TS_ACTIVE) { 437 printf("udebug_task_cleanup(): task not being debugged\n");437 LOG("udebug_task_cleanup(): task not being debugged\n"); 438 438 return EINVAL; 439 439 } … … 468 468 469 469 /* Answer GO call */ 470 printf("answer GO call with EVENT_FINISHED\n");470 LOG("answer GO call with EVENT_FINISHED\n"); 471 471 IPC_SET_RETVAL(t->udebug.go_call->data, 0); 472 472 IPC_SET_ARG1(t->udebug.go_call->data, UDEBUG_EVENT_FINISHED); -
kernel/generic/src/udebug/udebug_ipc.c
rfb9b0b0 r0108984a 36 36 */ 37 37 38 #include <print.h>39 38 #include <proc/task.h> 40 39 #include <proc/thread.h> … … 103 102 int rc; 104 103 105 //printf("debug_go()\n");106 107 104 t = (thread_t *)IPC_GET_ARG2(call->data); 108 105 … … 119 116 thread_t *t; 120 117 int rc; 121 122 printf("debug_stop()\n");123 118 124 119 t = (thread_t *)IPC_GET_ARG2(call->data); -
kernel/generic/src/udebug/udebug_ops.c
rfb9b0b0 r0108984a 36 36 */ 37 37 38 #include < print.h>38 #include <debug.h> 39 39 #include <proc/task.h> 40 40 #include <proc/thread.h> … … 163 163 link_t *cur; 164 164 165 printf("udebug_begin()\n");166 167 mutex_lock(&TASK->udebug.lock); 168 printf("debugging task %llu\n", TASK->taskid);165 LOG("udebug_begin()\n"); 166 167 mutex_lock(&TASK->udebug.lock); 168 LOG("debugging task %llu\n", TASK->taskid); 169 169 170 170 if (TASK->udebug.dt_state != UDEBUG_TS_INACTIVE) { 171 171 mutex_unlock(&TASK->udebug.lock); 172 printf("udebug_begin(): busy error\n");172 LOG("udebug_begin(): busy error\n"); 173 173 174 174 return EBUSY; … … 200 200 mutex_unlock(&TASK->udebug.lock); 201 201 202 printf("udebug_begin() done (%s)\n",202 LOG("udebug_begin() done (%s)\n", 203 203 reply ? "reply" : "stoppability wait"); 204 204 … … 210 210 int rc; 211 211 212 printf("udebug_end()\n");213 214 mutex_lock(&TASK->udebug.lock); 215 printf("task %llu\n", TASK->taskid);212 LOG("udebug_end()\n"); 213 214 mutex_lock(&TASK->udebug.lock); 215 LOG("task %" PRIu64 "\n", TASK->taskid); 216 216 217 217 rc = udebug_task_cleanup(TASK); … … 224 224 int udebug_set_evmask(udebug_evmask_t mask) 225 225 { 226 printf("udebug_set_mask()\n"); 227 228 printf("debugging task %llu\n", TASK->taskid); 226 LOG("udebug_set_mask()\n"); 229 227 230 228 mutex_lock(&TASK->udebug.lock); … … 232 230 if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) { 233 231 mutex_unlock(&TASK->udebug.lock); 234 printf("udebug_set_mask(): not active debuging session\n");232 LOG("udebug_set_mask(): not active debuging session\n"); 235 233 236 234 return EINVAL; … … 248 246 { 249 247 int rc; 250 251 // printf("udebug_go()\n");252 248 253 249 /* On success, this will lock t->udebug.lock */ … … 275 271 int rc; 276 272 277 printf("udebug_stop()\n");273 LOG("udebug_stop()\n"); 278 274 mutex_lock(&TASK->udebug.lock); 279 275 … … 299 295 * Answer GO call 300 296 */ 301 printf("udebug_stop - answering go call\n");297 LOG("udebug_stop - answering go call\n"); 302 298 303 299 /* Make sure nobody takes this call away from us */ … … 307 303 IPC_SET_RETVAL(call->data, 0); 308 304 IPC_SET_ARG1(call->data, UDEBUG_EVENT_STOP); 309 printf("udebug_stop/ipc_answer\n");305 LOG("udebug_stop/ipc_answer\n"); 310 306 311 307 THREAD->udebug.cur_event = UDEBUG_EVENT_STOP; … … 316 312 mutex_unlock(&TASK->udebug.lock); 317 313 318 printf("udebog_stop/done\n");314 LOG("udebog_stop/done\n"); 319 315 return 0; 320 316 } … … 331 327 size_t max_ids; 332 328 333 printf("udebug_thread_read()\n");329 LOG("udebug_thread_read()\n"); 334 330 335 331 /* Allocate a buffer to hold thread IDs */ … … 386 382 unative_t *arg_buffer; 387 383 388 // printf("udebug_args_read()\n");389 390 384 /* Prepare a buffer to hold the arguments */ 391 385 arg_buffer = malloc(6 * sizeof(unative_t), 0); … … 428 422 data_buffer = malloc(n, 0); 429 423 430 // printf("udebug_mem_read: src=%u, size=%u\n", uspace_addr, n);431 432 424 /* NOTE: this is not strictly from a syscall... but that shouldn't 433 425 * be a problem */
Note:
See TracChangeset
for help on using the changeset viewer.