summaryrefslogtreecommitdiff
path: root/kernel/include
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-23 13:57:18 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-23 13:57:18 -0400
commit974fcf5d87ee315601f797e609b1030ef5b329b8 (patch)
tree9dfad38f5b25fba41e1529008c91367a960c8f7f /kernel/include
parentsome paging updates (more to come) (diff)
downloadcomus-974fcf5d87ee315601f797e609b1030ef5b329b8.tar.gz
comus-974fcf5d87ee315601f797e609b1030ef5b329b8.tar.bz2
comus-974fcf5d87ee315601f797e609b1030ef5b329b8.zip
update paging code
Diffstat (limited to 'kernel/include')
-rw-r--r--kernel/include/comus/error.h2
-rw-r--r--kernel/include/comus/memory.h28
2 files changed, 4 insertions, 26 deletions
diff --git a/kernel/include/comus/error.h b/kernel/include/comus/error.h
index a4c8184..46478bc 100644
--- a/kernel/include/comus/error.h
+++ b/kernel/include/comus/error.h
@@ -23,8 +23,6 @@
// kernel error codes
#define E_EMPTY_QUEUE (-100)
#define E_NO_PCBS (-101)
-#define E_NO_PTE (-102)
-#define E_LOAD_LIMIT (-103)
// exit status values
#define EXIT_SUCCESS (0)
diff --git a/kernel/include/comus/memory.h b/kernel/include/comus/memory.h
index 109f23f..942e7a8 100644
--- a/kernel/include/comus/memory.h
+++ b/kernel/include/comus/memory.h
@@ -128,10 +128,9 @@ void mem_unmapaddr(mem_ctx_t ctx, void *virt);
*
* @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, unsigned int flags, bool lazy);
+void *mem_alloc_page(mem_ctx_t ctx, unsigned int flags);
/**
* Allocate a single page of memory at the given vitural address with the given paging structure
@@ -139,11 +138,9 @@ void *mem_alloc_page(mem_ctx_t ctx, unsigned int flags, bool lazy);
* @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, unsigned int flags,
- bool lazy);
+void *mem_alloc_page_at(mem_ctx_t ctx, void *virt, unsigned int flags);
/**
* Allocate size_t amount of contiguous virtual pages with the given paging structure
@@ -151,11 +148,9 @@ void *mem_alloc_page_at(mem_ctx_t ctx, void *virt, unsigned int flags,
* @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, unsigned int flags,
- bool lazy);
+void *mem_alloc_pages(mem_ctx_t ctx, size_t count, unsigned int flags);
/**
* Allocate size_t amount of contiguous virtual pages at a given virtural address with the given paging structure
@@ -164,11 +159,10 @@ void *mem_alloc_pages(mem_ctx_t ctx, size_t count, unsigned int flags,
* @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,
- unsigned int flags, bool lazy);
+ unsigned int flags);
/**
* Free allocated pages with the given paging structure.
@@ -178,13 +172,6 @@ void *mem_alloc_pages_at(mem_ctx_t ctx, size_t count, void *virt,
void mem_free_pages(mem_ctx_t ctx, void *ptr);
/**
- * Load a not allocated but properly mapped page
- *
- * @returns 0 on success, negative error code on failure
- */
-int mem_load_page(mem_ctx_t ctx, void *virt);
-
-/**
* Allocates at least len bytes of memory starting at
* physical address addr. Returned address can be
* any virtural address.
@@ -225,11 +212,4 @@ void *kalloc_pages(size_t count);
*/
void kfree_pages(void *ptr);
-/**
- * Load a not allocated but properly mapped page
- *
- * @returns 0 on success, negative error code on failure
- */
-int kload_page(void *virt);
-
#endif /* memory.h */