The VM_MEMATTR_ constants are enumerated, not a bitset. Compare accordingly.

Submitted by:	Ian Lepore <freebsd@damnhippie.dyndns.org>
This commit is contained in:
Olivier Houchard 2012-12-22 01:03:23 +00:00
parent 53e075c0b9
commit 8c06ac50fc
2 changed files with 8 additions and 8 deletions

View File

@ -2663,7 +2663,7 @@ pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
if (!(prot & VM_PROT_EXECUTE) && m)
npte |= L2_XN;
if (!(m->md.pv_memattr & VM_MEMATTR_UNCACHEABLE))
if (m->md.pv_memattr != VM_MEMATTR_UNCACHEABLE)
npte |= pte_l2_s_cache_mode;
if (m && m == opg) {

View File

@ -1366,7 +1366,7 @@ pmap_fix_cache(struct vm_page *pg, pmap_t pm, vm_offset_t va)
(pv->pv_flags & PVF_NC)) {
pv->pv_flags &= ~PVF_NC;
if (!(pg->md.pv_memattr & VM_MEMATTR_UNCACHEABLE))
if (pg->md.pv_memattr != VM_MEMATTR_UNCACHEABLE)
pmap_set_cache_entry(pv, pm, va, 1);
continue;
}
@ -1376,7 +1376,7 @@ pmap_fix_cache(struct vm_page *pg, pmap_t pm, vm_offset_t va)
!pmwc && (pv->pv_flags & PVF_NC)) {
pv->pv_flags &= ~(PVF_NC | PVF_MWC);
if (!(pg->md.pv_memattr & VM_MEMATTR_UNCACHEABLE))
if (pg->md.pv_memattr != VM_MEMATTR_UNCACHEABLE)
pmap_set_cache_entry(pv, pm, va, 1);
}
}
@ -1428,8 +1428,8 @@ pmap_clearbit(struct vm_page *pg, u_int maskbits)
if (!(oflags & maskbits)) {
if ((maskbits & PVF_WRITE) && (pv->pv_flags & PVF_NC)) {
if (!(pg->md.pv_memattr &
VM_MEMATTR_UNCACHEABLE)) {
if (pg->md.pv_memattr !=
VM_MEMATTR_UNCACHEABLE) {
PMAP_LOCK(pm);
l2b = pmap_get_l2_bucket(pm, va);
ptep = &l2b->l2b_kva[l2pte_index(va)];
@ -1466,8 +1466,8 @@ pmap_clearbit(struct vm_page *pg, u_int maskbits)
* permission.
*/
if (maskbits & PVF_WRITE) {
if (!(pg->md.pv_memattr &
VM_MEMATTR_UNCACHEABLE))
if (pg->md.pv_memattr !=
VM_MEMATTR_UNCACHEABLE)
npte |= pte_l2_s_cache_mode;
pv->pv_flags &= ~(PVF_NC | PVF_MWC);
}
@ -3399,7 +3399,7 @@ pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
(m->oflags & VPO_UNMANAGED) == 0)
vm_page_aflag_set(m, PGA_WRITEABLE);
}
if (!(m->md.pv_memattr & VM_MEMATTR_UNCACHEABLE))
if (m->md.pv_memattr != VM_MEMATTR_UNCACHEABLE)
npte |= pte_l2_s_cache_mode;
if (m && m == opg) {
/*