summaryrefslogtreecommitdiffstats
path: root/include/arch
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2025-09-10 13:28:28 -0400
committerJon Santmyer <jon@jonsantmyer.com>2025-09-10 13:28:28 -0400
commit7f350e7ee1c2c38e5ac0b6c22c17388f6c78f0b5 (patch)
treeaef9904e2495ce840319f2815cd859c47294c88a /include/arch
parent032a7bc4d79efea100a00cf3464bea3249a07ff6 (diff)
downloadjove-kernel-7f350e7ee1c2c38e5ac0b6c22c17388f6c78f0b5.tar.gz
jove-kernel-7f350e7ee1c2c38e5ac0b6c22c17388f6c78f0b5.tar.bz2
jove-kernel-7f350e7ee1c2c38e5ac0b6c22c17388f6c78f0b5.zip
refactor paging code. regression on loading init program
Diffstat (limited to 'include/arch')
-rw-r--r--include/arch/x86_64/page-mapping.h12
-rw-r--r--include/arch/x86_64/page.h13
2 files changed, 17 insertions, 8 deletions
diff --git a/include/arch/x86_64/page-mapping.h b/include/arch/x86_64/page-mapping.h
index fd620ea..8389132 100644
--- a/include/arch/x86_64/page-mapping.h
+++ b/include/arch/x86_64/page-mapping.h
@@ -3,13 +3,19 @@
#include "arch/x86_64/page.h"
-pmle_t *page_mapping_traverse(pmle_t *pml4, uint8_t depth, uint16_t *path);
+pmle_t *pml4_traverse(pmle_t *pml4, uint8_t depth, uint16_t *path);
/**@FUNC Get the pmle associated with this virtual address down to a given depth.
* At depth=0, gets &pml4[pml4i]
* At depth=1, gets &pml4[pml4i][pml3i]
* At depth=2, gets &pml4[pml4i][pml3i][pml2i]
- * etc...*/
-pmle_t *mem_mapping_vptr_mapping(pmle_t *pml4, uint8_t depth, uintptr_t vptr);
+ * etc...
+ * @PARAM pml4 table to get mapping from.
+ * @PARAM depth how deep to traverse for the mapping.
+ * @PARAM vptr address to get mapping for.
+ * @RETURN pointer to pmle (if exists)*/
+pmle_t *pml4_get_mapping(pmle_t *pml4, uint8_t depth, uintptr_t vptr);
+
+int pml4_try_map(pmle_t *pml4, uintptr_t pptr, uintptr_t vptr);
#endif
diff --git a/include/arch/x86_64/page.h b/include/arch/x86_64/page.h
index 7c6186a..910b898 100644
--- a/include/arch/x86_64/page.h
+++ b/include/arch/x86_64/page.h
@@ -36,13 +36,16 @@ typedef uint16_t pmli_t;
#define PML_SHL(l) (((l) * 9) + 3)
#define PML_I_FOR_LAYER(v, l) (((v) >> PML_SHL(l)) % 512)
-uintptr_t vmem_ident_tophys(void *vptr);
-void *vmem_phys_tovirt(uintptr_t pptr);
-uintptr_t vmem_tophys_koff(uintptr_t v);
+uintptr_t vptr_tophys(void *vptr);
+uintptr_t vptr_tophys_koff(uintptr_t v);
+
+void *pptr_tovirt_ident(uintptr_t pptr);
void *pmle_get_page(pmle_t entry);
-uint8_t pmle_level(pmle_t entry);
-int untyped_retype_page(objdir_entry_t *untyped_entry, void **dest_ptr);
+void pml4_setup_init(void);
+void pml4_setup(pmle_t *pml4);
+
+void pml4_get_path(uintptr_t vptr, uint8_t depth, uint16_t *path);
#endif