Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips/mips Fix up va for pmap_md_map_ephemeral_page ...
details: https://anonhg.NetBSD.org/src/rev/0337ff27986f
branches: trunk
changeset: 346712:0337ff27986f
user: skrll <skrll%NetBSD.org@localhost>
date: Fri Jul 29 15:43:02 2016 +0000
description:
Fix up va for pmap_md_map_ephemeral_page and so that cache ops get the
correct address
diffstat:
sys/arch/mips/mips/pmap_machdep.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diffs (54 lines):
diff -r 044dc45e7124 -r 0337ff27986f sys/arch/mips/mips/pmap_machdep.c
--- a/sys/arch/mips/mips/pmap_machdep.c Fri Jul 29 15:38:05 2016 +0000
+++ b/sys/arch/mips/mips/pmap_machdep.c Fri Jul 29 15:43:02 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_machdep.c,v 1.1 2016/07/11 16:15:36 matt Exp $ */
+/* $NetBSD: pmap_machdep.c,v 1.2 2016/07/29 15:43:02 skrll Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.1 2016/07/11 16:15:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.2 2016/07/29 15:43:02 skrll Exp $");
/*
* Manages physical address maps.
@@ -181,7 +181,7 @@
KASSERT(!locked_p || VM_PAGEMD_PVLIST_LOCKED_P(mdpg));
if (!MIPS_CACHE_VIRTUAL_ALIAS || !mips_cache_badalias(pv->pv_va, pa)) {
-#ifndef __mips_o32
+#ifdef _LP64
va = MIPS_PHYS_TO_XKPHYS_CACHED(pa);
#else
if (pa < MIPS_PHYS_MASK) {
@@ -198,13 +198,14 @@
struct cpu_info * const ci = curcpu();
KASSERT(ci->ci_pmap_dstbase != 0);
- va = (prot & VM_PROT_WRITE
+ vaddr_t nva = (prot & VM_PROT_WRITE
? ci->ci_pmap_dstbase
: ci->ci_pmap_srcbase)
+ mips_cache_indexof(MIPS_CACHE_VIRTUAL_ALIAS
? pv->pv_va
: pa);
+ va = (intptr_t)nva;
/*
* Now to make and write the new PTE to map the PA.
*/
@@ -229,8 +230,8 @@
(void)VM_PAGEMD_PVLIST_READLOCK(mdpg);
if (VM_PAGEMD_CACHED_P(mdpg)
&& mips_cache_badalias(pv->pv_va, va)) {
- mips_dcache_wbinv_range_index(trunc_page(pv->pv_va),
- PAGE_SIZE);
+ register_t ova = (intptr_t)trunc_page(pv->pv_va);
+ mips_dcache_wbinv_range_index(ova, PAGE_SIZE);
/*
* If there is no active mapping, remember this new one.
*/
Home |
Main Index |
Thread Index |
Old Index