diff options
author | Marvin Borner | 2020-08-17 13:52:51 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-17 13:52:51 +0200 |
commit | ca7d400b7705ba887df69391cb774d4de83e8bf3 (patch) | |
tree | a59b97c9405413d1cb01e05c3f0c760554cecc5c /kernel/features/event.c | |
parent | 0ba9ee15d0a229c619f35a5db04e45fe8861c3c9 (diff) |
Added event unmap
Diffstat (limited to 'kernel/features/event.c')
-rw-r--r-- | kernel/features/event.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/features/event.c b/kernel/features/event.c index 320b45a..8bdba1a 100644 --- a/kernel/features/event.c +++ b/kernel/features/event.c @@ -19,6 +19,20 @@ u32 event_map(enum event id, u32 *func) return 0; } +// TODO: Fix unmap +void event_unmap(enum event id, u32 *func) +{ + struct list *list = ((struct list *)event_table[id]); + struct node *iterator = list->head; + while (iterator->data != (void *)func) { + iterator = iterator->next; + if (!iterator) + return; + } + + list_remove(list, iterator); +} + u32 event_trigger(enum event id, u32 *data) { assert(id < sizeof(event_table) / sizeof(*event_table)); |