Implement streams IPC mechanism
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m47s

This commit is contained in:
2026-03-18 22:27:56 +01:00
parent 77ab25bcee
commit 80a728f04b
22 changed files with 311 additions and 50 deletions

29
kernel/proc/stream.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef _KERNEL_PROC_STREAM_H
#define _KERNEL_PROC_STREAM_H
#include <libk/list.h>
#include <libk/ringbuffer.h>
#include <libk/std.h>
#include <proc/suspension_q.h>
#define PROC_STREAM_MAX (1024 * 1024)
struct proc;
struct proc_resource;
struct cpu;
struct reschedule_ctx;
struct proc_stream {
struct proc_resource* resource;
struct ringbuffer ringbuffer;
};
void proc_cleanup_resource_stream (struct proc_resource* resource, struct reschedule_ctx* rctx);
void proc_stream_write (struct proc* proc, struct proc_stream* stream, struct reschedule_ctx* rctx,
void* data, size_t data_size);
size_t proc_stream_read (struct proc* proc, struct proc_stream* stream, struct reschedule_ctx* rctx,
void* out_data, size_t data_size);
#endif // _KERNEL_PROC_STREAM_H