From e1e299083d1469177f4e5787a78c136923091f3a Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Thu, 28 Jul 2022 22:07:42 +0200 Subject: amd64/mem/vmap: add struct contents and functions --- arch/amd64/mem/vmap.h | 18 ++++++++++++++++-- 1 file 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 #include +/* 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 -- cgit v1.2.3