Changeset 04803bf in mainline for kernel/generic/src/ipc/event.c


Ignore:
Timestamp:
2011-03-21T22:00:17Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
143932e
Parents:
b50b5af2 (diff), 7308e84 (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 (needs fixes).

File:
1 edited

Legend:

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

    rb50b5af2 r04803bf  
    3838#include <ipc/event_types.h>
    3939#include <mm/slab.h>
    40 #include <arch/types.h>
     40#include <typedefs.h>
    4141#include <synch/spinlock.h>
    4242#include <console/console.h>
     
    5757                events[i].answerbox = NULL;
    5858                events[i].counter = 0;
    59                 events[i].method = 0;
     59                events[i].imethod = 0;
    6060        }
    6161}
    6262
    63 static int event_subscribe(event_type_t evno, unative_t method,
     63static int event_subscribe(event_type_t evno, sysarg_t imethod,
    6464    answerbox_t *answerbox)
    6565{
     
    7373        if (events[evno].answerbox == NULL) {
    7474                events[evno].answerbox = answerbox;
    75                 events[evno].method = method;
     75                events[evno].imethod = imethod;
    7676                events[evno].counter = 0;
    7777                res = EOK;
     
    8484}
    8585
    86 unative_t sys_event_subscribe(unative_t evno, unative_t method)
     86sysarg_t sys_event_subscribe(sysarg_t evno, sysarg_t imethod)
    8787{
    88         return (unative_t) event_subscribe((event_type_t) evno, (unative_t)
    89             method, &TASK->answerbox);
     88        return (sysarg_t) event_subscribe((event_type_t) evno, (sysarg_t)
     89            imethod, &TASK->answerbox);
    9090}
    9191
     
    113113                        events[i].answerbox = NULL;
    114114                        events[i].counter = 0;
    115                         events[i].method = 0;
     115                        events[i].imethod = 0;
    116116                }
    117117                spinlock_unlock(&events[i].lock);
     
    119119}
    120120
    121 void event_notify(event_type_t evno, unative_t a1, unative_t a2, unative_t a3,
    122     unative_t a4, unative_t a5)
     121void event_notify(event_type_t evno, sysarg_t a1, sysarg_t a2, sysarg_t a3,
     122    sysarg_t a4, sysarg_t a5)
    123123{
    124124        ASSERT(evno < EVENT_END);
     
    130130                        call->flags |= IPC_CALL_NOTIF;
    131131                        call->priv = ++events[evno].counter;
    132                         IPC_SET_METHOD(call->data, events[evno].method);
     132                        IPC_SET_IMETHOD(call->data, events[evno].imethod);
    133133                        IPC_SET_ARG1(call->data, a1);
    134134                        IPC_SET_ARG2(call->data, a2);
     
    137137                        IPC_SET_ARG5(call->data, a5);
    138138                       
    139                         ipl_t ipl = interrupts_disable();
    140                         spinlock_lock(&events[evno].answerbox->irq_lock);
     139                        irq_spinlock_lock(&events[evno].answerbox->irq_lock, true);
    141140                        list_append(&call->link, &events[evno].answerbox->irq_notifs);
    142                         spinlock_unlock(&events[evno].answerbox->irq_lock);
    143                         interrupts_restore(ipl);
     141                        irq_spinlock_unlock(&events[evno].answerbox->irq_lock, true);
    144142                       
    145143                        waitq_wakeup(&events[evno].answerbox->wq, WAKEUP_FIRST);
Note: See TracChangeset for help on using the changeset viewer.