summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-11-17 08:35:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-11-17 08:35:44 +0000
commit81127282d1cf3a3b03192800afeb6705b3ba3cc4 (patch)
treecd09a2f1dd20358a5cdb3232199de329f2d2779c /sys
parent86e9e858ee299c3a1ddf26cc4b04b096b64c5bfa (diff)
sorry miod, but this version locks the machine up rather fast
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sh/sh/vm_machdep.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sys/arch/sh/sh/vm_machdep.c b/sys/arch/sh/sh/vm_machdep.c
index b45b6c20c49..cc2ff5dce54 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.6 2006/11/16 22:27:58 miod Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.7 2006/11/17 08:35:43 deraadt Exp $ */
/* $NetBSD: vm_machdep.c,v 1.53 2006/08/31 16:49:21 matt Exp $ */
/*-
@@ -271,27 +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;
- *fpte++ = 0;
- 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());
}
/*