MOS Source Code
Loading...
Searching...
No Matches
pml5.c
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-4.0-or-later
2
4
7
8#include <mos/mos_global.h>
9#include <mos_string.h>
10
11#if MOS_PLATFORM_PAGING_LEVELS < 5
12void pml5_traverse(pml5_t pml5, ptr_t *vaddr, size_t *n_pages, pagetable_walk_options_t callback, void *data)
13{
14 pml4_traverse(pml5.next, vaddr, n_pages, callback, data);
15}
16
17bool pml5_destroy_range(pml5_t pml5, ptr_t *vaddr, size_t *n_pages)
18{
19 // a PML5 entry is a PML4 table
20 return pml4_destroy_range(pml5.next, vaddr, n_pages);
21}
22
23pml5e_t *pml5_entry(pml5_t pml5, ptr_t vaddr)
24{
25 MOS_UNUSED(vaddr);
26 return pml5.next.table;
27}
28
29bool pml5e_is_present(const pml5e_t *pml5e)
30{
31 MOS_UNUSED(pml5e);
32 return true;
33}
34
36{
37 return (pml4_t){ .table = (pml4e_t *) pml5e };
38}
39#else
40#error "Implement PML5 support"
41#endif
bool callback(pb_istream_t *stream, uint8_t *buf, size_t count)
#define MOS_UNUSED(x)
Definition mos_global.h:64
void pml4_traverse(pml4_t pml4, ptr_t *vaddr, size_t *n_pages, pagetable_walk_options_t callback, void *data)
Definition pml4.c:16
__nodiscard bool pml4_destroy_range(pml4_t pml4, ptr_t *vaddr, size_t *n_pages)
pml5e_t * pml5_entry(pml5_t pml5, ptr_t vaddr)
Definition pml5.c:23
bool pml5e_is_present(const pml5e_t *pml5e)
Definition pml5.c:29
pml4_t pml5e_get_or_create_pml4(pml5e_t *pml5e)
Definition pml5.c:35
void pml5_traverse(pml5_t pml5, ptr_t *vaddr, size_t *n_pages, pagetable_walk_options_t callback, void *data)
Definition pml5.c:12
bool pml5_destroy_range(pml5_t pml5, ptr_t *vaddr, size_t *n_pages)
Definition pml5.c:17
pml3e_t pml4e_t
Definition pml_types.h:72
pml4e_t pml5e_t
Definition pml_types.h:79
unsigned long ptr_t
Definition types.h:25