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

Function pmap_page_set_memattr

freebsd/amd64/amd64/pmap.c:9113–9128  ·  view source on GitHub ↗

* Sets the memory attribute for the specified page. */

Source from the content-addressed store, hash-verified

9111 * Sets the memory attribute for the specified page.
9112 */
9113void
9114pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
9115{
9116
9117 m->md.pat_mode = ma;
9118
9119 /*
9120 * If "m" is a normal page, update its direct mapping. This update
9121 * can be relied upon to perform any cache operations that are
9122 * required for data coherence.
9123 */
9124 if ((m->flags & PG_FICTITIOUS) == 0 &&
9125 pmap_change_attr(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), PAGE_SIZE,
9126 m->md.pat_mode))
9127 panic("memory attribute change on the direct map failed");
9128}
9129
9130/*
9131 * Changes the specified virtual address range's memory type to that given by

Callers

nothing calls this directly

Calls 2

pmap_change_attrFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected