summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2005-03-16 23:56:29 +0000
committercognet <cognet@FreeBSD.org>2005-03-16 23:56:29 +0000
commit860ca4946fce1fa70d54bd183f96d927034564ca (patch)
tree72fe4b79eba6ef362fa7533758c6fd7909f48d05 /sys
parente71ce99b94a4a7a3a89698ab14cf849cedb25d98 (diff)
downloadFreeBSD-src-860ca4946fce1fa70d54bd183f96d927034564ca.zip
FreeBSD-src-860ca4946fce1fa70d54bd183f96d927034564ca.tar.gz
Introduce a new function, pmap_wb_page(), which check all userland mappings for
a given page and, if the pmap is the current pmap, write back the associated cache line. Use pmap_wb_page in pmap_qenter() instead of inconditionally write back/invalidating the data cache.
Diffstat (limited to 'sys')
-rw-r--r--sys/arm/arm/pmap.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c
index beb2167..e4d11f4 100644
--- a/sys/arm/arm/pmap.c
+++ b/sys/arm/arm/pmap.c
@@ -2896,6 +2896,15 @@ pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot)
return (sva);
}
+static void
+pmap_wb_page(vm_page_t m)
+{
+ struct pv_entry *pv;
+
+ TAILQ_FOREACH(pv, &m->md.pv_list, pv_list)
+ pmap_dcache_wb_range(pv->pv_pmap, pv->pv_va, PAGE_SIZE, FALSE,
+ (pv->pv_flags & PVF_WRITE) == 0);
+}
/*
* Add a list of wired pages to the kva
@@ -2911,11 +2920,11 @@ pmap_qenter(vm_offset_t va, vm_page_t *m, int count)
int i;
for (i = 0; i < count; i++) {
+ pmap_wb_page(m[i]);
pmap_kenter_internal(va, VM_PAGE_TO_PHYS(m[i]),
KENTER_CACHE);
va += PAGE_SIZE;
}
- cpu_dcache_wbinv_all(); /* XXX: shouldn't be needed */
}
OpenPOWER on IntegriCloud