Changeset 0496c17 in mainline
- Timestamp:
- 2011-05-16T19:58:02Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0d8a304
- Parents:
- bec0219
- Location:
- kernel/generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ipc/event.h
rbec0219 r0496c17 53 53 /** Masked flag. */ 54 54 bool masked; 55 /** Unmask callback. */ 56 void (*unmask_cb)(void); 55 57 } event_t; 56 58 57 59 extern void event_init(void); 58 60 extern void event_cleanup_answerbox(answerbox_t *); 61 extern void event_set_unmask_callback(event_type_t, void (*)(void)); 59 62 60 63 #define event_notify_0(e, m) \ -
kernel/generic/src/console/console.c
rbec0219 r0496c17 165 165 sysinfo_set_item_val("klog.faddr", NULL, (sysarg_t) faddr); 166 166 sysinfo_set_item_val("klog.pages", NULL, KLOG_PAGES); 167 168 event_set_unmask_callback(EVENT_KLOG, klog_update); 167 169 168 170 spinlock_lock(&klog_lock); -
kernel/generic/src/ipc/event.c
rbec0219 r0496c17 59 59 events[i].imethod = 0; 60 60 events[i].masked = false; 61 events[i].unmask_cb = NULL; 61 62 } 62 63 } … … 83 84 } 84 85 86 /** Define a callback function for the event unmask event. 87 * 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; 98 spinlock_unlock(&events[evno].lock); 99 } 100 85 101 /** Send kernel notification event 86 102 * … … 190 206 static void event_unmask(event_type_t evno) 191 207 { 208 void (*cb)(void); 192 209 ASSERT(evno < EVENT_END); 193 210 194 211 spinlock_lock(&events[evno].lock); 195 212 events[evno].masked = false; 196 spinlock_unlock(&events[evno].lock); 213 cb = events[evno].unmask_cb; 214 spinlock_unlock(&events[evno].lock); 215 216 /* 217 * Check if there is an unmask callback function defined for this event. 218 */ 219 if (cb) 220 cb(); 197 221 } 198 222
Note:
See TracChangeset
for help on using the changeset viewer.