diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-23 11:43:56 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-23 11:43:56 -0400 |
commit | 5619cfbf0f989cfe1cac1654a63efc4c86d06e08 (patch) | |
tree | 70fc7b896d0689c30e7ac7d77d20461bff909955 /kernel/include | |
parent | change pcb structure (move context to top) (diff) | |
download | comus-5619cfbf0f989cfe1cac1654a63efc4c86d06e08.tar.gz comus-5619cfbf0f989cfe1cac1654a63efc4c86d06e08.tar.bz2 comus-5619cfbf0f989cfe1cac1654a63efc4c86d06e08.zip |
some paging updates (more to come)
Diffstat (limited to 'kernel/include')
-rw-r--r-- | kernel/include/comus/memory.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/include/comus/memory.h b/kernel/include/comus/memory.h index 588219e..109f23f 100644 --- a/kernel/include/comus/memory.h +++ b/kernel/include/comus/memory.h @@ -127,30 +127,35 @@ void mem_unmapaddr(mem_ctx_t ctx, void *virt); * Allocate a single page of memory with the given paging structure * * @param ctx - the memory context + * @param flags - memory flags (F_PRESENT will always be set) * @param lazy - if to lazy allocate pages (alloc on fault) * @returns the vitural address aloocated or NULL on failure */ -void *mem_alloc_page(mem_ctx_t ctx, bool lazy); +void *mem_alloc_page(mem_ctx_t ctx, unsigned int flags, bool lazy); /** * Allocate a single page of memory at the given vitural address with the given paging structure * * @param ctx - the memory context * @param virt - the vitural address to allocate at + * @param flags - memory flags (F_PRESENT will always be set) * @param lazy - if to lazy allocate pages (alloc on fault) * @returns the vitural address aloocated or NULL on failure */ -void *mem_alloc_page_at(mem_ctx_t ctx, void *virt, bool lazy); +void *mem_alloc_page_at(mem_ctx_t ctx, void *virt, unsigned int flags, + bool lazy); /** * Allocate size_t amount of contiguous virtual pages with the given paging structure * * @param ctx - the memory context * @param count - the number of pages to allocate + * @param flags - memory flags (F_PRESENT will always be set) * @param lazy - if to lazy allocate pages (alloc on fault) * @returns the address allocated or NULL on failure */ -void *mem_alloc_pages(mem_ctx_t ctx, size_t count, bool lazy); +void *mem_alloc_pages(mem_ctx_t ctx, size_t count, unsigned int flags, + bool lazy); /** * Allocate size_t amount of contiguous virtual pages at a given virtural address with the given paging structure @@ -158,10 +163,12 @@ void *mem_alloc_pages(mem_ctx_t ctx, size_t count, bool lazy); * @param ctx - the memory context * @param count - the number of pages to allocate * @param virt - the vitural address to allocate at + * @param flags - memory flags (F_PRESENT will always be set) * @param lazy - if to lazy allocate pages (alloc on fault) * @returns the address allocated or NULL on failure */ -void *mem_alloc_pages_at(mem_ctx_t ctx, size_t count, void *virt, bool lazy); +void *mem_alloc_pages_at(mem_ctx_t ctx, size_t count, void *virt, + unsigned int flags, bool lazy); /** * Free allocated pages with the given paging structure. |