MOS Source Code
Loading...
Searching...
No Matches
do_map.c
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
4
6
7static void pml1e_do_map_callback(pml1_t pml1, pml1e_t *e, ptr_t vaddr, void *data)
8{
9 MOS_UNUSED(pml1);
10 MOS_UNUSED(vaddr);
11 struct pagetable_do_map_data *map_data = data;
12 platform_pml1e_set_pfn(e, map_data->pfn);
13 platform_pml1e_set_flags(e, map_data->flags);
15 if (map_data->do_refcount)
16 pmm_ref_one(map_data->pfn);
17 map_data->pfn++;
18}
19
20static void pml2e_do_map_callback(pml2_t pml2, pml2e_t *e, ptr_t vaddr, void *data)
21{
22 MOS_UNUSED(pml2);
23 MOS_UNUSED(vaddr);
24 struct pagetable_do_map_data *map_data = data;
25 platform_pml2e_set_flags(e, map_data->flags);
26}
27
28static void pml3e_do_map_callback(pml3_t pml3, pml3e_t *e, ptr_t vaddr, void *data)
29{
30 MOS_UNUSED(pml3);
31 MOS_UNUSED(vaddr);
32 struct pagetable_do_map_data *map_data = data;
33 platform_pml3e_set_flags(e, map_data->flags);
34}
35
36static void pml4e_do_map_callback(pml4_t pml4, pml4e_t *e, ptr_t vaddr, void *data)
37{
38 MOS_UNUSED(pml4);
39 MOS_UNUSED(vaddr);
40 struct pagetable_do_map_data *map_data = data;
41 platform_pml4e_set_flags(e, map_data->flags);
42}
43
45 .pml1e_callback = pml1e_do_map_callback,
46 .pml2e_pre_traverse = pml2e_do_map_callback,
47 .pml3e_pre_traverse = pml3e_do_map_callback,
48 .pml4e_pre_traverse = pml4e_do_map_callback,
49};
void platform_pml2e_set_flags(pml2e_t *pml2, vm_flags flags)
Definition mm.c:125
void platform_pml4e_set_flags(pml4e_t *pml4, vm_flags flags)
Definition mm.c:225
void platform_pml1e_set_pfn(pml1e_t *pml1, pfn_t pfn)
Definition mm.c:83
void platform_invalidate_tlb(ptr_t vaddr)
Definition mm.c:72
void platform_pml1e_set_flags(pml1e_t *pml1, vm_flags flags)
Definition mm.c:95
void platform_pml3e_set_flags(pml3e_t *pml3, vm_flags flags)
Definition mm.c:175
const pagetable_walk_options_t pagetable_do_map_callbacks
Definition do_map.c:44
static void pml1e_do_map_callback(pml1_t pml1, pml1e_t *e, ptr_t vaddr, void *data)
Definition do_map.c:7
static void pml2e_do_map_callback(pml2_t pml2, pml2e_t *e, ptr_t vaddr, void *data)
Definition do_map.c:20
static void pml3e_do_map_callback(pml3_t pml3, pml3e_t *e, ptr_t vaddr, void *data)
Definition do_map.c:28
static void pml4e_do_map_callback(pml4_t pml4, pml4e_t *e, ptr_t vaddr, void *data)
Definition do_map.c:36
#define pmm_ref_one(thing)
Definition pmm.h:146
#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
unsigned long ptr_t
Definition types.h:25