1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#include "mos/mm/paging/table_ops/do_mask.h"
4
5#include "mos/platform/platform.h"
6
7static void pml1e_do_mask_callback(pml1_t pml1, pml1e_t *e, ptr_t vaddr, void *data)
8{
9 MOS_UNUSED(pml1);
10 MOS_UNUSED(vaddr);
11 if (platform_pml1e_get_present(pml1: e))
12 {
13 struct pagetable_do_mask_data *mask_data = data;
14 vm_flags flags = platform_pml1e_get_flags(pml1e: e);
15 flags &= ~mask_data->mask;
16 platform_pml1e_set_flags(pml1: e, flags);
17 platform_invalidate_tlb(vaddr);
18 }
19}
20
21const pagetable_walk_options_t pagetable_do_mask_callbacks = {
22 .pml1e_callback = pml1e_do_mask_callback,
23};
24