Enforce that 'pmap_kenter()' is only used to establish cacheable mappings.
Mappings with other cacheability attributes can be established, if needed, by using 'pmap_kenter_attr()'. Suggested by: jchandra, imp
This commit is contained in:
parent
87b6f1855b
commit
5df4b6be91
@ -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);
|
||||
|
@ -828,7 +828,7 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user