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