diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-15 22:49:39 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-15 22:49:39 -0400 |
commit | fea6e5f3d527e3fb33209d437f130c02c9e83680 (patch) | |
tree | cc71bfcdf893ff31882795994d7ce29f483a72bc /kernel/include | |
parent | move error.h out of symlink (diff) | |
download | comus-fea6e5f3d527e3fb33209d437f130c02c9e83680.tar.gz comus-fea6e5f3d527e3fb33209d437f130c02c9e83680.tar.bz2 comus-fea6e5f3d527e3fb33209d437f130c02c9e83680.zip |
more stub mem_ctx fns
Diffstat (limited to 'kernel/include')
-rw-r--r-- | kernel/include/comus/memory.h | 20 |
1 files changed, 19 insertions, 1 deletions
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 <stdint.h> #include <stddef.h> +#include <stdbool.h> #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 |