diff options
author | Anton Kling <anton@kling.gg> | 2024-07-06 20:46:22 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-07-06 20:46:22 +0200 |
commit | 6d6289f0fb3b07b0d1a02f671df6b096318d4a4c (patch) | |
tree | 1d87fcf6374af7d4ab82cb46e1777a2ce1d3b11d /kernel/queue.h | |
parent | 8e66b83b705e257b78ec98abdb86e7f8b3b5c775 (diff) |
Kernel: Add queue syscall and improve TCP
Diffstat (limited to 'kernel/queue.h')
-rw-r--r-- | kernel/queue.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/kernel/queue.h b/kernel/queue.h new file mode 100644 index 0000000..0885f16 --- /dev/null +++ b/kernel/queue.h @@ -0,0 +1,29 @@ +#include <lib/relist.h> +#include <sched/scheduler.h> +#include <typedefs.h> + +#define QUEUE_WAIT_READ (1 << 0) +#define QUEUE_WAIT_WRITE (1 << 1) + +#define QUEUE_MOD_ADD 0 +#define QUEUE_MOD_CHANGE 1 +#define QUEUE_MOD_DELETE 2 + +struct queue_entry { + int fd; + u8 listen; + int data_type; + void *data; +}; + +struct queue_list { + struct relist entries; // Store this as a binary tree(red black trees + // are used by epoll) as file + // descriptors will be used for lookups + process_t *process; +}; + +int queue_create(void); +int queue_mod_entries(int fd, int flag, struct queue_entry *entries, + int num_entries); +int queue_wait(int fd, struct queue_entry *events, int num_events); |