summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAlejandro Sior <aho@sior.be>2022-07-28 22:07:42 +0200
committerAlejandro Sior <aho@sior.be>2022-07-28 22:07:42 +0200
commite1e299083d1469177f4e5787a78c136923091f3a (patch)
treeec95dc9aa69baacc6b186d845b8d01b4ae7bf5c4 /arch
parent9dce228fd9997db9027b9c656920f14d589ecdb3 (diff)
amd64/mem/vmap: add struct contents and functions
Diffstat (limited to 'arch')
-rw-r--r--arch/amd64/mem/vmap.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/amd64/mem/vmap.h b/arch/amd64/mem/vmap.h
index c13b887..b7b4364 100644
--- a/arch/amd64/mem/vmap.h
+++ b/arch/amd64/mem/vmap.h
@@ -1,12 +1,26 @@
#ifndef AMD64_MEM_VMAP_H
#define AMD64_MEM_VMAP_H
+#include <rt.h>
#include <mem/vmap.h>
+/* Implementation of MemVmap for AMD64 */
typedef struct amd64_mem_vmap {
MemVmap vmap;
-
-
+
+ /* Used to store the decoded indices
+ from the translation addresses */
+ u32 idx[8];
+
+ /* Used to store the addresses of the
+ different pages being hit by a
+ translation */
+ u64 *addrs[8];
} Amd64MemVmap;
+void amd64_mem_vmap_init(Amd64MemVmap *self, void *base);
+usize amd64_mem_vmap_translate(MemVmap *inner, usize virt);
+int amd64_mem_vmap_map(MemVmap *inner, usize phys, usize virt, usize len);
+void amd64_mem_vmap_unmap(MemVmap *inner, usize virt, usize len);
+
#endif \ No newline at end of file