diff options
-rw-r--r-- | sys/mips/include/pmap.h | 1 | ||||
-rw-r--r-- | sys/mips/mips/pmap.c | 11 | ||||
-rw-r--r-- | sys/mips/sibyte/sb_zbpci.c | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/sys/mips/include/pmap.h b/sys/mips/include/pmap.h index e6aada9..558a018 100644 --- a/sys/mips/include/pmap.h +++ b/sys/mips/include/pmap.h @@ -154,6 +154,7 @@ void pmap_unmapdev(vm_offset_t, vm_size_t); vm_offset_t pmap_steal_memory(vm_size_t size); int page_is_managed(vm_offset_t pa); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); +void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr); void pmap_kremove(vm_offset_t va); void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kenter_temporary_free(vm_paddr_t pa); diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index 6d212f7..c39554f 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -828,7 +828,7 @@ retry: /* * add a wired page to the kva */ -static void +void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr) { pt_entry_t *pte; @@ -849,14 +849,11 @@ pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr) void pmap_kenter(vm_offset_t va, vm_paddr_t pa) { - int attr; - if (is_cacheable_mem(pa)) - attr = PTE_C_CACHE; - else - attr = PTE_C_UNCACHED; + KASSERT(is_cacheable_mem(pa), + ("pmap_kenter: memory at 0x%lx is not cacheable", (u_long)pa)); - pmap_kenter_attr(va, pa, attr); + pmap_kenter_attr(va, pa, PTE_C_CACHE); } /* diff --git a/sys/mips/sibyte/sb_zbpci.c b/sys/mips/sibyte/sb_zbpci.c index 9a09645..243ed08 100644 --- a/sys/mips/sibyte/sb_zbpci.c +++ b/sys/mips/sibyte/sb_zbpci.c @@ -349,7 +349,7 @@ zbpci_config_space_va(int bus, int slot, int func, int reg, int bytes) pa_page = pa & ~(PAGE_SIZE - 1); if (zbpci_config_space[cpu].paddr != pa_page) { pmap_kremove(va_page); - pmap_kenter(va_page, pa_page); + pmap_kenter_attr(va_page, pa_page, PTE_C_UNCACHED); zbpci_config_space[cpu].paddr = pa_page; } return (va_page + (pa - pa_page)); |