summaryrefslogtreecommitdiff
path: root/sys/arch/sh
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sh')
-rw-r--r--sys/arch/sh/sh/vm_machdep.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/sys/arch/sh/sh/vm_machdep.c b/sys/arch/sh/sh/vm_machdep.c
index 375f3df4ec9..7e594c3d2c9 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.4 2006/11/14 19:49:48 miod Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.5 2006/11/16 00:12:19 deraadt Exp $ */
/* $NetBSD: vm_machdep.c,v 1.53 2006/08/31 16:49:21 matt Exp $ */
/*-
@@ -271,26 +271,29 @@ cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
void
pagemove(caddr_t from, caddr_t to, size_t size)
{
- pt_entry_t *fpte, *tpte;
+ paddr_t pa;
+ boolean_t rv;
#ifdef DEBUG
- if (size & PAGE_MASK)
+ if (size % PAGE_SIZE)
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) {
- *tpte++ = *fpte;
- sh_tlb_invalidate_addr(0, (vaddr_t)from);
- sh_tlb_invalidate_addr(0, (vaddr_t)to);
+ 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);
from += PAGE_SIZE;
to += PAGE_SIZE;
size -= PAGE_SIZE;
}
+ pmap_update(pmap_kernel());
}
/*