Changes in kernel/generic/src/ipc/ipc.c [c713aa56:170332d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
rc713aa56 r170332d 218 218 answerbox_t *callerbox = call->callerbox; 219 219 bool do_lock = ((!selflocked) || callerbox != (&TASK->answerbox)); 220 ipl_t ipl; 221 222 /* Count sent answer */ 223 ipl = interrupts_disable(); 224 spinlock_lock(&TASK->lock); 225 TASK->ipc_info.answer_sent++; 226 spinlock_unlock(&TASK->lock); 227 interrupts_restore(ipl); 220 228 221 229 call->flags |= IPC_CALL_ANSWERED; … … 276 284 static void _ipc_call(phone_t *phone, answerbox_t *box, call_t *call) 277 285 { 286 ipl_t ipl; 287 288 /* Count sent ipc call */ 289 ipl = interrupts_disable(); 290 spinlock_lock(&TASK->lock); 291 TASK->ipc_info.call_sent++; 292 spinlock_unlock(&TASK->lock); 293 interrupts_restore(ipl); 294 278 295 if (!(call->flags & IPC_CALL_FORWARDED)) { 279 296 atomic_inc(&phone->active_calls); … … 376 393 int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox, int mode) 377 394 { 395 ipl_t ipl; 396 397 /* Count forwarded calls */ 398 ipl = interrupts_disable(); 399 spinlock_lock(&TASK->lock); 400 TASK->ipc_info.forwarded++; 401 spinlock_unlock(&TASK->lock); 402 interrupts_restore(ipl); 403 378 404 spinlock_lock(&oldbox->lock); 379 405 list_remove(&call->link); … … 407 433 call_t *request; 408 434 ipl_t ipl; 435 uint64_t irq_cnt = 0; 436 uint64_t answer_cnt = 0; 437 uint64_t call_cnt = 0; 409 438 int rc; 410 439 … … 416 445 spinlock_lock(&box->lock); 417 446 if (!list_empty(&box->irq_notifs)) { 447 /* Count recieved IRQ notification */ 448 irq_cnt++; 449 418 450 ipl = interrupts_disable(); 419 451 spinlock_lock(&box->irq_lock); … … 425 457 interrupts_restore(ipl); 426 458 } else if (!list_empty(&box->answers)) { 459 /* Count recieved answer */ 460 answer_cnt++; 461 427 462 /* Handle asynchronous answers */ 428 463 request = list_get_instance(box->answers.next, call_t, link); … … 430 465 atomic_dec(&request->data.phone->active_calls); 431 466 } else if (!list_empty(&box->calls)) { 467 /* Count recieved call */ 468 call_cnt++; 469 432 470 /* Handle requests */ 433 471 request = list_get_instance(box->calls.next, call_t, link); … … 441 479 } 442 480 spinlock_unlock(&box->lock); 481 482 ipl = interrupts_disable(); 483 spinlock_lock(&TASK->lock); 484 TASK->ipc_info.irq_notif_recieved += irq_cnt; 485 TASK->ipc_info.answer_recieved += answer_cnt; 486 TASK->ipc_info.call_recieved += call_cnt; 487 spinlock_unlock(&TASK->lock); 488 interrupts_restore(ipl); 489 443 490 return request; 444 491 } … … 644 691 call_t *call; 645 692 link_t *tmp; 693 ipl_t ipl; 646 694 695 ipl = interrupts_disable(); 647 696 spinlock_lock(&tasks_lock); 648 697 task = task_find_by_id(taskid); … … 650 699 spinlock_lock(&task->lock); 651 700 spinlock_unlock(&tasks_lock); 652 if (!task) 701 if (!task) { 702 interrupts_restore(ipl); 653 703 return; 704 } 654 705 655 706 /* Print opened phones & details */ … … 734 785 spinlock_unlock(&task->answerbox.lock); 735 786 spinlock_unlock(&task->lock); 787 interrupts_restore(ipl); 736 788 } 737 789
Note:
See TracChangeset
for help on using the changeset viewer.