MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pmap_protect_pte1

Function pmap_protect_pte1

freebsd/arm/arm/pmap-v6.c:4915–4949  ·  view source on GitHub ↗

* Do the things to protect a 1mpage in a process. */

Source from the content-addressed store, hash-verified

4913 * Do the things to protect a 1mpage in a process.
4914 */
4915static void
4916pmap_protect_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t sva,
4917 vm_prot_t prot)
4918{
4919 pt1_entry_t npte1, opte1;
4920 vm_offset_t eva, va;
4921 vm_page_t m;
4922
4923 PMAP_LOCK_ASSERT(pmap, MA_OWNED);
4924 KASSERT((sva & PTE1_OFFSET) == 0,
4925 ("%s: sva is not 1mpage aligned", __func__));
4926
4927 opte1 = npte1 = pte1_load(pte1p);
4928 if (pte1_is_managed(opte1) && pte1_is_dirty(opte1)) {
4929 eva = sva + PTE1_SIZE;
4930 for (va = sva, m = PHYS_TO_VM_PAGE(pte1_pa(opte1));
4931 va < eva; va += PAGE_SIZE, m++)
4932 vm_page_dirty(m);
4933 }
4934 if ((prot & VM_PROT_WRITE) == 0)
4935 npte1 |= PTE1_RO | PTE1_NM;
4936 if ((prot & VM_PROT_EXECUTE) == 0)
4937 npte1 |= PTE1_NX;
4938
4939 /*
4940 * QQQ: Herein, execute permission is never set.
4941 * It only can be cleared. So, no icache
4942 * syncing is needed.
4943 */
4944
4945 if (npte1 != opte1) {
4946 pte1_store(pte1p, npte1);
4947 pmap_tlb_flush(pmap, sva);
4948 }
4949}
4950
4951/*
4952 * Set the physical protection on the

Callers 1

pmap_protectFunction · 0.85

Calls 8

pte1_loadFunction · 0.85
pte1_is_managedFunction · 0.85
pte1_is_dirtyFunction · 0.85
PHYS_TO_VM_PAGEFunction · 0.85
pte1_paFunction · 0.85
vm_page_dirtyFunction · 0.85
pte1_storeFunction · 0.85
pmap_tlb_flushFunction · 0.85

Tested by

no test coverage detected