summaryrefslogtreecommitdiffstats
path: root/lib/libjove/include/arch/x86_64/object-pagemap.h
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2025-08-19 15:04:04 -0400
committerJon Santmyer <jon@jonsantmyer.com>2025-08-19 15:04:04 -0400
commit858a52c06a4615bd58a6a906333f2ad707d41c0a (patch)
tree16870cd4d67da283567a72a74d28c04464da292a /lib/libjove/include/arch/x86_64/object-pagemap.h
parent65ba015d6c1f248d36ad01a653bc49637804b15b (diff)
downloadjove-os-858a52c06a4615bd58a6a906333f2ad707d41c0a.tar.gz
jove-os-858a52c06a4615bd58a6a906333f2ad707d41c0a.tar.bz2
jove-os-858a52c06a4615bd58a6a906333f2ad707d41c0a.zip
usermode pager
Diffstat (limited to 'lib/libjove/include/arch/x86_64/object-pagemap.h')
-rw-r--r--lib/libjove/include/arch/x86_64/object-pagemap.h44
1 files changed, 41 insertions, 3 deletions
diff --git a/lib/libjove/include/arch/x86_64/object-pagemap.h b/lib/libjove/include/arch/x86_64/object-pagemap.h
index 55b0570..48e959e 100644
--- a/lib/libjove/include/arch/x86_64/object-pagemap.h
+++ b/lib/libjove/include/arch/x86_64/object-pagemap.h
@@ -2,13 +2,51 @@
#define _LIBJOVE_ARCH_x86_64_OBJECT_PAGEMAP_H 1
#include <jove/object-typed.h>
+#include <jove/object-dir.h>
+#include <jove/object-untyped.h>
-typedef struct KernelObjectPageMapping
+typedef struct KernelObjectPageMap
{
KernelObjectTyped typed;
- uint8_t level;
-} KernelObjectPageMapping;
+} KernelObjectPageMap;
+KernelObjectPageMap *jove_object_as_pagemap(KernelObjectTyped *typed);
+/**@FUNC Populates a given region of memory for a page map value.
+ * @PARAM pagemap address of pagemap cache object.
+ * @PARAM dir directory this memory is a member of.
+ * @PARAM memb index into directory to place object.*/
+void _jove_alloc_pagemap_inplace(
+ KernelObjectPageMap *pagemap,
+ KernelObjectDirectory *dir,
+ uint8_t memb);
+
+/**@FUNC Allocates a region of memory to represent a page map.
+ * @PARAM dir directory to place new value in.
+ * @PARAM memb index into directory to place object.
+ * @RETURN newly allocated object. NULL on failure.
+ * Possible failures:
+ * EJOVE_FULL: Slot is already taken by an existing object.
+ * EJOVE_NOALLOC: libjove does not have an allocator yet.*/
+KernelObjectPageMap* _jove_alloc_pagemap(
+ KernelObjectDirectory *dir,
+ uint8_t memb);
+
+int jove_pagemap_exists(
+ KernelObjectPageMap *map,
+ uint8_t depth,
+ uint16_t *path);
+
+JoveError jove_pagemap_map(
+ KernelObjectPageMap *map,
+ uint8_t depth,
+ uint16_t *path,
+ KernelObjectUntyped *page);
+
+JoveError jove_pagemap_map_unmap(
+ KernelObjectPageMap *map,
+ uint8_t depth,
+ uint16_t *path,
+ KernelObjectUntyped *dest);
#endif