From fea6e5f3d527e3fb33209d437f130c02c9e83680 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Tue, 15 Apr 2025 22:49:39 -0400 Subject: more stub mem_ctx fns --- kernel/include/comus/memory.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'kernel/include') diff --git a/kernel/include/comus/memory.h b/kernel/include/comus/memory.h index ee413e3..dec872d 100644 --- a/kernel/include/comus/memory.h +++ b/kernel/include/comus/memory.h @@ -11,6 +11,7 @@ #include #include +#include #define MMAP_MAX_ENTRY 64 #define PAGE_SIZE 4096 @@ -63,7 +64,24 @@ uint64_t memory_used(void); * * @returns pointer context or NULL on failure */ -mem_ctx_t alloc_mem_ctx(void); +mem_ctx_t mem_ctx_alloc(void); + +/** + * Clone a current memory context into a new one + * + * @param ctx - the memory context + * @param cow - mark all of the pages as copy on write + * + * @returns pointer context or NULL on failure + */ +mem_ctx_t mem_ctx_clone(mem_ctx_t ctx, bool cow); + +/** + * Free a memory context into a new one + * + * @param ctx - the memory context + */ +void mem_ctx_free(mem_ctx_t ctx); /** * Free a memory context -- cgit v1.2.3-freya