diff options
author | Anton Kling <anton@kling.gg> | 2024-03-14 13:09:59 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-03-14 13:09:59 +0100 |
commit | 2e8b474d4219e7faaac3823e73c8d528c2698a37 (patch) | |
tree | 7d93b5fd220e8b703ba69f9b55122d15c9d619fb /kernel/queue.h | |
parent | 051ac9f1941e8bc6ad87beccb61a2d53111ba8ea (diff) |
random changes made
Diffstat (limited to 'kernel/queue.h')
-rw-r--r-- | kernel/queue.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kernel/queue.h b/kernel/queue.h new file mode 100644 index 0000000..74c7ab8 --- /dev/null +++ b/kernel/queue.h @@ -0,0 +1,25 @@ +#ifndef QUEUE_H +#define QUEUE_H +#include <lib/list.h> +#include <stddef.h> +#include <string.h> +#include <typedefs.h> + +#define EVENT_TYPE_FD 0 +#define EVENT_TYPE_TCP_SOCKET 1 + +struct event { + u8 type; // File descriptor | Socket + u32 internal_id; +}; + +struct event_queue { + struct list events; + int wait; +}; + +int queue_create(u32 *id); +int queue_add(u32 queue_id, struct event *ev, u32 size); +int queue_wait(u32 queue_id); +int queue_should_block(struct event_queue *q, int *is_empty); +#endif |