Changeset 25a76ab8 in mainline for kernel/generic/src/ipc/ipc.c


Ignore:
Timestamp:
2010-05-08T07:53:23Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
051bc69a
Parents:
6c39a907 (diff), 1317380 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ipc.c

    r6c39a907 r25a76ab8  
    218218        answerbox_t *callerbox = call->callerbox;
    219219        bool do_lock = ((!selflocked) || callerbox != (&TASK->answerbox));
     220        ipl_t ipl;
    220221
    221222        /* Count sent answer */
     223        ipl = interrupts_disable();
    222224        spinlock_lock(&TASK->lock);
    223225        TASK->ipc_info.answer_sent++;
    224226        spinlock_unlock(&TASK->lock);
     227        interrupts_restore(ipl);
    225228
    226229        call->flags |= IPC_CALL_ANSWERED;
     
    281284static void _ipc_call(phone_t *phone, answerbox_t *box, call_t *call)
    282285{
     286        ipl_t ipl;
     287
    283288        /* Count sent ipc call */
     289        ipl = interrupts_disable();
    284290        spinlock_lock(&TASK->lock);
    285291        TASK->ipc_info.call_sent++;
    286292        spinlock_unlock(&TASK->lock);
     293        interrupts_restore(ipl);
    287294
    288295        if (!(call->flags & IPC_CALL_FORWARDED)) {
     
    386393int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox, int mode)
    387394{
     395        ipl_t ipl;
     396
    388397        /* Count forwarded calls */
     398        ipl = interrupts_disable();
    389399        spinlock_lock(&TASK->lock);
    390400        TASK->ipc_info.forwarded++;
    391401        spinlock_unlock(&TASK->lock);
     402        interrupts_restore(ipl);
    392403
    393404        spinlock_lock(&oldbox->lock);
     
    422433        call_t *request;
    423434        ipl_t ipl;
     435        uint64_t irq_cnt = 0;
     436        uint64_t answer_cnt = 0;
     437        uint64_t call_cnt = 0;
    424438        int rc;
    425439
     
    431445        spinlock_lock(&box->lock);
    432446        if (!list_empty(&box->irq_notifs)) {
    433 
    434447                /* Count recieved IRQ notification */
    435                 spinlock_lock(&TASK->lock);
    436                 TASK->ipc_info.irq_notif_recieved++;
    437                 spinlock_unlock(&TASK->lock);
     448                irq_cnt++;     
    438449
    439450                ipl = interrupts_disable();
     
    447458        } else if (!list_empty(&box->answers)) {
    448459                /* Count recieved answer */
    449                 spinlock_lock(&TASK->lock);
    450                 TASK->ipc_info.answer_recieved++;
    451                 spinlock_unlock(&TASK->lock);
     460                answer_cnt++;
    452461
    453462                /* Handle asynchronous answers */
     
    457466        } else if (!list_empty(&box->calls)) {
    458467                /* Count recieved call */
    459                 spinlock_lock(&TASK->lock);
    460                 TASK->ipc_info.call_recieved++;
    461                 spinlock_unlock(&TASK->lock);
     468                call_cnt++;
    462469
    463470                /* Handle requests */
     
    472479        }
    473480        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
    474490        return request;
    475491}
     
    675691        call_t *call;
    676692        link_t *tmp;
     693        ipl_t ipl;
    677694       
     695        ipl = interrupts_disable();
    678696        spinlock_lock(&tasks_lock);
    679697        task = task_find_by_id(taskid);
     
    681699                spinlock_lock(&task->lock);
    682700        spinlock_unlock(&tasks_lock);
    683         if (!task)
     701        if (!task) {
     702                interrupts_restore(ipl);
    684703                return;
     704        }
    685705
    686706        /* Print opened phones & details */
     
    765785        spinlock_unlock(&task->answerbox.lock);
    766786        spinlock_unlock(&task->lock);
     787        interrupts_restore(ipl);
    767788}
    768789
Note: See TracChangeset for help on using the changeset viewer.