Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 97d42d5 in mainline for kernel/generic/src/ipc/event.c


Ignore:
Timestamp:
2011-05-17T15:10:16Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
0a02653
Parents:
0d8a304
Message:

get rid of KLOG_LATENCY (thanks to the event notification unmask callback this is no longer needed)

File:
1 edited

Legend:

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

    r0d8a304 r97d42d5  
    5959                events[i].imethod = 0;
    6060                events[i].masked = false;
    61                 events[i].unmask_cb = NULL;
     61                events[i].unmask_callback = NULL;
    6262        }
    6363}
     
    8686/** Define a callback function for the event unmask event.
    8787 *
    88  * @param evno Event type.
    89  * @param cb   Callback function to be called when the event is unmasked.
    90  *
    91  */
    92 void 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;
     88 * @param evno     Event type.
     89 * @param callback Callback function to be called when
     90 *                 the event is unmasked.
     91 *
     92 */
     93void 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;
    9899        spinlock_unlock(&events[evno].lock);
    99100}
     
    206207static void event_unmask(event_type_t evno)
    207208{
    208         void (*cb)(void);
    209209        ASSERT(evno < EVENT_END);
    210210       
    211211        spinlock_lock(&events[evno].lock);
    212212        events[evno].masked = false;
    213         cb = events[evno].unmask_cb;
     213        event_callback_t callback = events[evno].unmask_callback;
    214214        spinlock_unlock(&events[evno].lock);
    215215       
    216216        /*
    217          * Check if there is an unmask callback function defined for this event.
     217         * Check if there is an unmask callback
     218         * function defined for this event.
    218219         */
    219         if (cb)
    220             cb();
     220        if (callback != NULL)
     221                callback();
    221222}
    222223
Note: See TracChangeset for help on using the changeset viewer.