diff options
author | Marvin Borner | 2020-06-17 18:31:46 +0200 |
---|---|---|
committer | Marvin Borner | 2020-06-17 18:31:46 +0200 |
commit | eed77bd2970a00d1394ed027ceca5b646e4671ce (patch) | |
tree | c44643d98aed2b6818f2b33417c0dea9c5853094 /src/kernel/events/event.c | |
parent | 49dfa1f4021026bf7c4d77817959c8aa24067016 (diff) |
Started rewrite
Diffstat (limited to 'src/kernel/events/event.c')
-rw-r--r-- | src/kernel/events/event.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/kernel/events/event.c b/src/kernel/events/event.c deleted file mode 100644 index a50e0c7..0000000 --- a/src/kernel/events/event.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <common.h> -#include <stddef.h> -#include <stdint.h> -#include <system.h> - -typedef u32 (*event_func)(u8 *); - -u32 (*event_table[])() = { [MAP_KEYBOARD] = NULL, [MAP_MOUSE] = NULL }; - -u32 event_map(u32 id, u8 *function) -{ - if (id >= sizeof(event_map) / sizeof(*event_map)) - return -1; - - event_table[id] = (u32)function; - return 0; -} - -u32 event_trigger(u32 id, u8 *data) -{ - assert(id < sizeof(event_map) / sizeof(*event_map)); - - event_func location = (event_func)event_table[id]; - if (!location) { - warn("Event %d not mapped!", id); - return -1; - } - - location(data); - return 0; -}
\ No newline at end of file |