| 3653 | } |
| 3654 | |
| 3655 | void |
| 3656 | pmap_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 | |
| 3674 | static __inline void |
| 3675 | pmap_pte_attr(pt_entry_t *pte, vm_memattr_t ma) |
no test coverage detected