Changes in kernel/generic/src/ipc/ipc.c [95319bd:170332d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
r95319bd r170332d 218 218 answerbox_t *callerbox = call->callerbox; 219 219 bool do_lock = ((!selflocked) || callerbox != (&TASK->answerbox)); 220 ipl_t ipl; 220 221 221 222 /* Count sent answer */ 223 ipl = interrupts_disable(); 222 224 spinlock_lock(&TASK->lock); 223 225 TASK->ipc_info.answer_sent++; 224 226 spinlock_unlock(&TASK->lock); 227 interrupts_restore(ipl); 225 228 226 229 call->flags |= IPC_CALL_ANSWERED; … … 281 284 static void _ipc_call(phone_t *phone, answerbox_t *box, call_t *call) 282 285 { 286 ipl_t ipl; 287 283 288 /* Count sent ipc call */ 289 ipl = interrupts_disable(); 284 290 spinlock_lock(&TASK->lock); 285 291 TASK->ipc_info.call_sent++; 286 292 spinlock_unlock(&TASK->lock); 293 interrupts_restore(ipl); 287 294 288 295 if (!(call->flags & IPC_CALL_FORWARDED)) { … … 386 393 int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox, int mode) 387 394 { 395 ipl_t ipl; 396 388 397 /* Count forwarded calls */ 398 ipl = interrupts_disable(); 389 399 spinlock_lock(&TASK->lock); 390 400 TASK->ipc_info.forwarded++; 391 401 spinlock_unlock(&TASK->lock); 402 interrupts_restore(ipl); 392 403 393 404 spinlock_lock(&oldbox->lock); … … 422 433 call_t *request; 423 434 ipl_t ipl; 435 uint64_t irq_cnt = 0; 436 uint64_t answer_cnt = 0; 437 uint64_t call_cnt = 0; 424 438 int rc; 425 439 … … 431 445 spinlock_lock(&box->lock); 432 446 if (!list_empty(&box->irq_notifs)) { 433 434 447 /* Count recieved IRQ notification */ 435 spinlock_lock(&TASK->lock); 436 TASK->ipc_info.irq_notif_recieved++; 437 spinlock_unlock(&TASK->lock); 448 irq_cnt++; 438 449 439 450 ipl = interrupts_disable(); … … 447 458 } else if (!list_empty(&box->answers)) { 448 459 /* Count recieved answer */ 449 spinlock_lock(&TASK->lock); 450 TASK->ipc_info.answer_recieved++; 451 spinlock_unlock(&TASK->lock); 460 answer_cnt++; 452 461 453 462 /* Handle asynchronous answers */ … … 457 466 } else if (!list_empty(&box->calls)) { 458 467 /* Count recieved call */ 459 spinlock_lock(&TASK->lock); 460 TASK->ipc_info.call_recieved++; 461 spinlock_unlock(&TASK->lock); 468 call_cnt++; 462 469 463 470 /* Handle requests */ … … 472 479 } 473 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 474 490 return request; 475 491 } … … 675 691 call_t *call; 676 692 link_t *tmp; 693 ipl_t ipl; 677 694 695 ipl = interrupts_disable(); 678 696 spinlock_lock(&tasks_lock); 679 697 task = task_find_by_id(taskid); … … 681 699 spinlock_lock(&task->lock); 682 700 spinlock_unlock(&tasks_lock); 683 if (!task) 701 if (!task) { 702 interrupts_restore(ipl); 684 703 return; 704 } 685 705 686 706 /* Print opened phones & details */ … … 765 785 spinlock_unlock(&task->answerbox.lock); 766 786 spinlock_unlock(&task->lock); 787 interrupts_restore(ipl); 767 788 } 768 789
Note:
See TracChangeset
for help on using the changeset viewer.