Ignore:
File:
1 edited

Legend:

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

    r97d42d5 r0496c17  
    5959                events[i].imethod = 0;
    6060                events[i].masked = false;
    61                 events[i].unmask_callback = NULL;
     61                events[i].unmask_cb = NULL;
    6262        }
    6363}
     
    8686/** Define a callback function for the event unmask event.
    8787 *
    88  * @param evno     Event type.
    89  * @param callback Callback function to be called when
    90  *                 the event is unmasked.
    91  *
    92  */
    93 void event_set_unmask_callback(event_type_t evno, event_callback_t callback)
    94 {
    95         ASSERT(evno < EVENT_END);
    96        
    97         spinlock_lock(&events[evno].lock);
    98         events[evno].unmask_callback = callback;
     88 * @param evno Event type.
     89 * @param cb   Callback function to be called when the event is unmasked.
     90 *
     91 */
     92void event_set_unmask_callback(event_type_t evno, void (*cb)(void))
     93{
     94        ASSERT(evno < EVENT_END);
     95       
     96        spinlock_lock(&events[evno].lock);
     97        events[evno].unmask_cb = cb;
    9998        spinlock_unlock(&events[evno].lock);
    10099}
     
    207206static void event_unmask(event_type_t evno)
    208207{
     208        void (*cb)(void);
    209209        ASSERT(evno < EVENT_END);
    210210       
    211211        spinlock_lock(&events[evno].lock);
    212212        events[evno].masked = false;
    213         event_callback_t callback = events[evno].unmask_callback;
     213        cb = events[evno].unmask_cb;
    214214        spinlock_unlock(&events[evno].lock);
    215215       
    216216        /*
    217          * Check if there is an unmask callback
    218          * function defined for this event.
     217         * Check if there is an unmask callback function defined for this event.
    219218         */
    220         if (callback != NULL)
    221                 callback();
     219        if (cb)
     220            cb();
    222221}
    223222
Note: See TracChangeset for help on using the changeset viewer.