MOS Source Code
Loading...
Searching...
No Matches
do_unmap.c
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
4
6
7static void pml1e_do_unmap_callback(pml1_t pml1, pml1e_t *e, ptr_t vaddr, void *data)
8{
9 MOS_UNUSED(pml1);
10 MOS_UNUSED(vaddr);
11
12 struct pagetable_do_unmap_data *unmap_data = data;
14 return; // nothing to do (page isn't mapped)
15
16 const pfn_t pfn = platform_pml1e_get_pfn(e);
17 if (unmap_data->do_unref)
18 pmm_unref_one(pfn);
19
22}
23
24static void pml2e_do_unmap_callback(pml2_t pml2, pml2e_t *e, ptr_t vaddr, void *data)
25{
26 MOS_UNUSED(pml2);
27 MOS_UNUSED(e);
28 MOS_UNUSED(vaddr);
29 MOS_UNUSED(data);
30}
31
32static void pml3e_do_unmap_callback(pml3_t pml3, pml3e_t *e, ptr_t vaddr, void *data)
33{
34 MOS_UNUSED(pml3);
35 MOS_UNUSED(e);
36 MOS_UNUSED(vaddr);
37 MOS_UNUSED(data);
38}
39
40static void pml4e_do_unmap_callback(pml4_t pml4, pml4e_t *e, ptr_t vaddr, void *data)
41{
42 MOS_UNUSED(pml4);
43 MOS_UNUSED(e);
44 MOS_UNUSED(vaddr);
45 MOS_UNUSED(data);
46}
47
49 .readonly = true,
50 .pml1e_callback = pml1e_do_unmap_callback,
51 .pml2e_pre_traverse = pml2e_do_unmap_callback,
52 .pml3e_pre_traverse = pml3e_do_unmap_callback,
53 .pml4e_pre_traverse = pml4e_do_unmap_callback,
54};
pfn_t platform_pml1e_get_pfn(const pml1e_t *pml1e)
Definition mm.c:78
void platform_invalidate_tlb(ptr_t vaddr)
Definition mm.c:72
bool platform_pml1e_get_present(const pml1e_t *pml1)
Definition mm.c:90
const pagetable_walk_options_t pagetable_do_unmap_callbacks
Definition do_unmap.c:48
static void pml4e_do_unmap_callback(pml4_t pml4, pml4e_t *e, ptr_t vaddr, void *data)
Definition do_unmap.c:40
static void pml3e_do_unmap_callback(pml3_t pml3, pml3e_t *e, ptr_t vaddr, void *data)
Definition do_unmap.c:32
static void pml1e_do_unmap_callback(pml1_t pml1, pml1e_t *e, ptr_t vaddr, void *data)
Definition do_unmap.c:7
static void pml2e_do_unmap_callback(pml2_t pml2, pml2e_t *e, ptr_t vaddr, void *data)
Definition do_unmap.c:24
#define pmm_unref_one(thing)
Definition pmm.h:147
#define MOS_UNUSED(x)
Definition mos_global.h:64
pml3e_t pml4e_t
Definition pml_types.h:72
pml2e_t pml3e_t
Definition pml_types.h:60
#define pmlxe_destroy(pmlxe)
Definition pml_types.h:110
unsigned long long pfn_t
Definition types.h:41
unsigned long ptr_t
Definition types.h:25