Changes in kernel/generic/src/ipc/event.c [8820544:cfaa35a] in mainline
- File:
-
- 1 edited
-
kernel/generic/src/ipc/event.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/event.c
r8820544 rcfaa35a 58 58 } 59 59 60 static event_t *evno2event(int evno, task_t *t ask)60 static event_t *evno2event(int evno, task_t *t) 61 61 { 62 62 ASSERT(evno < EVENT_TASK_END); 63 63 64 64 event_t *event; 65 65 66 66 if (evno < EVENT_END) 67 67 event = &events[(event_type_t) evno]; 68 68 else 69 event = &t ask->events[(event_task_type_t) evno - EVENT_END];70 69 event = &t->events[(event_task_type_t) evno - EVENT_END]; 70 71 71 return event; 72 72 } … … 86 86 event_initialize(evno2event(i, task)); 87 87 } 88 88 89 89 90 /** Unsubscribe kernel events associated with an answerbox … … 259 260 { 260 261 int res; 261 262 262 263 spinlock_lock(&event->lock); 263 264 … … 276 277 } 277 278 278 /** Unsubscribe event notifications279 *280 * @param evno Event type.281 * @param answerbox Answerbox used to send the notifications to.282 *283 * @return EOK if the subscription was successful.284 * @return EEXISTS if the notifications of the given type are285 * already subscribed.286 *287 */288 static int event_unsubscribe(event_t *event, answerbox_t *answerbox)289 {290 int res;291 292 spinlock_lock(&event->lock);293 294 if (event->answerbox == answerbox) {295 event->answerbox = NULL;296 event->counter = 0;297 event->imethod = 0;298 event->masked = false;299 res = EOK;300 } else301 res = ENOENT;302 303 spinlock_unlock(&event->lock);304 305 return res;306 }307 308 279 /** Unmask event notifications 309 280 * … … 326 297 } 327 298 328 /** Event notification s ubscription syscall wrapper299 /** Event notification syscall wrapper 329 300 * 330 301 * @param evno Event type to subscribe. … … 338 309 * 339 310 */ 340 sysarg_t sys_ ipc_event_subscribe(sysarg_t evno, sysarg_t imethod)311 sysarg_t sys_event_subscribe(sysarg_t evno, sysarg_t imethod) 341 312 { 342 313 if (evno >= EVENT_TASK_END) … … 345 316 return (sysarg_t) event_subscribe(evno2event(evno, TASK), 346 317 (sysarg_t) imethod, &TASK->answerbox); 347 }348 349 /** Event notification unsubscription syscall wrapper350 *351 * @param evno Event type to unsubscribe.352 *353 * @return EOK on success.354 * @return ELIMIT on unknown event type.355 * @return ENOENT if the notification of the given type is not356 subscribed.357 *358 */359 sysarg_t sys_ipc_event_unsubscribe(sysarg_t evno)360 {361 if (evno >= EVENT_TASK_END)362 return ELIMIT;363 364 return (sysarg_t) event_unsubscribe(evno2event(evno, TASK),365 &TASK->answerbox);366 318 } 367 319 … … 379 331 * 380 332 */ 381 sysarg_t sys_ ipc_event_unmask(sysarg_t evno)333 sysarg_t sys_event_unmask(sysarg_t evno) 382 334 { 383 335 if (evno >= EVENT_TASK_END)
Note:
See TracChangeset
for help on using the changeset viewer.
