summaryrefslogtreecommitdiff
path: root/sys/arch/sh
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-11-16 22:27:59 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-11-16 22:27:59 +0000
commitf8630ce62ea8fdee3e6934cba0b3d7fddb089961 (patch)
tree4b09449be18a25371fbcbf39a73da7bd93f1addf /sys/arch/sh
parent14292b409f86e2ab712e1d1f76a8e964f6474d34 (diff)
pagemove() this time without an accidental line removal
Diffstat (limited to 'sys/arch/sh')
-rw-r--r--sys/arch/sh/sh/vm_machdep.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/sys/arch/sh/sh/vm_machdep.c b/sys/arch/sh/sh/vm_machdep.c
index 7e594c3d2c9..b45b6c20c49 100644
--- a/sys/arch/sh/sh/vm_machdep.c
+++ b/sys/arch/sh/sh/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.5 2006/11/16 00:12:19 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.6 2006/11/16 22:27:58 miod Exp $ */
/* $NetBSD: vm_machdep.c,v 1.53 2006/08/31 16:49:21 matt Exp $ */
/*-
@@ -271,29 +271,27 @@ cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
void
pagemove(caddr_t from, caddr_t to, size_t size)
{
- paddr_t pa;
- boolean_t rv;
+ pt_entry_t *fpte, *tpte;
#ifdef DEBUG
- if (size % PAGE_SIZE)
+ if (size & PAGE_MASK)
panic("pagemove: size=%08lx", (u_long) size);
#endif
+ if (SH_HAS_VIRTUAL_ALIAS)
+ sh_dcache_wbinv_range((vaddr_t)from, size);
+
+ fpte = __pmap_kpte_lookup((vaddr_t)from);
+ tpte = __pmap_kpte_lookup((vaddr_t)to);
while (size > 0) {
- rv = pmap_extract(pmap_kernel(), (vaddr_t) from, &pa);
-#ifdef DEBUG
- if (rv == FALSE)
- panic("pagemove 2");
- if (pmap_extract(pmap_kernel(), (vaddr_t) to, NULL) == TRUE)
- panic("pagemove 3");
-#endif
- pmap_kremove((vaddr_t) from, PAGE_SIZE);
- pmap_kenter_pa((vaddr_t) to, pa, VM_PROT_READ|VM_PROT_WRITE);
+ *tpte++ = *fpte;
+ *fpte++ = 0;
+ sh_tlb_invalidate_addr(0, (vaddr_t)from);
+ sh_tlb_invalidate_addr(0, (vaddr_t)to);
from += PAGE_SIZE;
to += PAGE_SIZE;
size -= PAGE_SIZE;
}
- pmap_update(pmap_kernel());
}
/*