diff options
author | Marvin Borner | 2020-08-24 12:21:23 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-24 12:21:23 +0200 |
commit | 0a4c8dd2d6048fe9851b8d92a311bba7aaa83a57 (patch) | |
tree | 5e1e235f4ff22b3233f43db768ddd373f6063856 /libc | |
parent | 0e05b395cb8868b77d91d9d614ff5ae09b3b853a (diff) |
Removed async events
Diffstat (limited to 'libc')
-rw-r--r-- | libc/inc/sys.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libc/inc/sys.h b/libc/inc/sys.h index 8bff39b..77a8069 100644 --- a/libc/inc/sys.h +++ b/libc/inc/sys.h @@ -14,14 +14,12 @@ enum sys { SYS_EXIT, // Exit current process SYS_YIELD, // Switch to next process SYS_TIME, // Get kernel time - SYS_MAP, // Map event to function - SYS_UNMAP, // Unmap event - SYS_RESOLVE, // Resolve event (needs to be executed at end of function) + SYS_REGISTER, // Register for event + SYS_UNREGISTER, // Unregister event SYS_SEND, // Send message to process SYS_RECEIVE // Receive message (non-blocking/sync) }; -enum event { EVENT_KEYBOARD, EVENT_MOUSE }; -enum message_type { MSG_NEW_WINDOW }; +enum message_type { MSG_NEW_WINDOW, EVENT_KEYBOARD, EVENT_MOUSE }; struct message { int src; @@ -56,9 +54,8 @@ int sysv(enum sys num, ...); #define yield() (int)sys0(SYS_YIELD) #define time() (int)sys0(SYS_TIME) -#define event_map(id, func) sys2(SYS_MAP, (int)(id), (int)(func)) -#define event_unmap(id, func) sys2(SYS_UNMAP, (int)(id), (int)(func)) -#define event_resolve() sys0(SYS_RESOLVE) // TODO: Find method making event_resolve obsolete +#define event_register(id) sys1(SYS_REGISTER, (int)(id)) +#define event_unregister(id) sys1(SYS_UNREGISTER, (int)(id)) #define msg_send(pid, type, msg) sys3(SYS_SEND, (int)(pid), (int)(type), (int)(msg)) #define msg_receive() (struct message *)sys0(SYS_RECEIVE) |