summaryrefslogtreecommitdiffstats
path: root/include/arch/x86_64/page-mapping.h
blob: 83891326b417e388c33a248fb5df5e7a517091e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef _JOVE_ARCH_x86_64_PAGE_MAPPING_H
#define _JOVE_ARCH_x86_64_PAGE_MAPPING_H 1

#include "arch/x86_64/page.h"

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...
 * @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