From 8a9208612eec8ddae4c418485d848ecfa0613699 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 30 Oct 2023 22:12:14 +0100 Subject: Meta: Move kernel and userland to their own folders. This is to allow both the kernel and the userland to share certain header files and to make the folder structure a bit more clear. --- kernel/fs/fifo.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 kernel/fs/fifo.h (limited to 'kernel/fs/fifo.h') diff --git a/kernel/fs/fifo.h b/kernel/fs/fifo.h new file mode 100644 index 0000000..1ba7168 --- /dev/null +++ b/kernel/fs/fifo.h @@ -0,0 +1,27 @@ +typedef struct S_FIFO_FILE FIFO_FILE; +#ifndef FIFO_H +#define FIFO_H +#include "vfs.h" +#include +#include + +struct S_FIFO_FILE { + char *buffer; + uint64_t buffer_len; + uint64_t write_len; + uint8_t is_blocking; + uint8_t has_data; + uint8_t can_write; +}; + +int create_fifo(void); +FIFO_FILE *create_fifo_object(void); +int fifo_object_write(uint8_t *buffer, uint64_t offset, uint64_t len, + FIFO_FILE *file); +int fifo_object_read(uint8_t *buffer, uint64_t offset, uint64_t len, + FIFO_FILE *file); +int fifo_write(uint8_t *buffer, uint64_t offset, uint64_t len, + vfs_fd_t *fd); +int fifo_read(uint8_t *buffer, uint64_t offset, uint64_t len, + vfs_fd_t *fd); +#endif -- cgit v1.2.3