Changeset 170332d in mainline


Ignore:
Timestamp:
2010-04-26T11:35:36Z (14 years ago)
Author:
Jakub Jermar <jermar@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
556f9892
Parents:
d69f959
Message:

Disable interrupts when taking TASK→lock.

File:
1 edited

Legend:

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

    rd69f959 r170332d  
    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);
     
    680691        call_t *call;
    681692        link_t *tmp;
     693        ipl_t ipl;
    682694       
     695        ipl = interrupts_disable();
    683696        spinlock_lock(&tasks_lock);
    684697        task = task_find_by_id(taskid);
     
    686699                spinlock_lock(&task->lock);
    687700        spinlock_unlock(&tasks_lock);
    688         if (!task)
     701        if (!task) {
     702                interrupts_restore(ipl);
    689703                return;
     704        }
    690705
    691706        /* Print opened phones & details */
     
    770785        spinlock_unlock(&task->answerbox.lock);
    771786        spinlock_unlock(&task->lock);
     787        interrupts_restore(ipl);
    772788}
    773789
Note: See TracChangeset for help on using the changeset viewer.