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

Function pmap_page_set_memattr

freebsd/mips/mips/pmap.c:3655–3672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3653}
3654
3655void
3656pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
3657{
3658
3659 /*
3660 * It appears that this function can only be called before any mappings
3661 * for the page are established. If this ever changes, this code will
3662 * need to walk the pv_list and make each of the existing mappings
3663 * uncacheable, being careful to sync caches and PTEs (and maybe
3664 * invalidate TLB?) for any current mapping it modifies.
3665 */
3666 if (TAILQ_FIRST(&m->md.pv_list) != NULL)
3667 panic("Can't change memattr on page with existing mappings");
3668
3669 /* Clean memattr portion of pv_flags */
3670 m->md.pv_flags &= ~PV_MEMATTR_MASK;
3671 m->md.pv_flags |= (ma << PV_MEMATTR_SHIFT) & PV_MEMATTR_MASK;
3672}
3673
3674static __inline void
3675pmap_pte_attr(pt_entry_t *pte, vm_memattr_t ma)

Callers 5

vm_page_initfakeFunction · 0.50
vm_page_updatefakeFunction · 0.50
vm_page_free_prepFunction · 0.50

Calls 1

panicFunction · 0.50

Tested by

no test coverage detected