summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-08-05 20:35:47 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-08-05 20:35:47 +0000
commit215360d5278a9a8580d1fbcaefac9c86403b93eb (patch)
treed67800a813dafa0b74d4742d4ebcee190e6c8134
parente44e6580914034020fd8bebb4eda65836d295910 (diff)
Use syntaxic sugar provided by PMAP_NEW
-rw-r--r--sys/arch/mvme68k/mvme68k/machdep.c6
-rw-r--r--sys/arch/mvme68k/mvme68k/vm_machdep.c19
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c6
-rw-r--r--sys/arch/mvme88k/mvme88k/vm_machdep.c33
4 files changed, 25 insertions, 39 deletions
diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c
index 6ec80c9457b..0169e453696 100644
--- a/sys/arch/mvme68k/mvme68k/machdep.c
+++ b/sys/arch/mvme68k/mvme68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.44 2001/07/25 13:25:32 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.45 2001/08/05 20:35:43 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -383,9 +383,7 @@ again:
if (pg == NULL)
panic("cpu_startup: not enough memory for "
"buffer cache");
- pmap_enter(kernel_map->pmap, curbuf,
- VM_PAGE_TO_PHYS(pg), VM_PROT_ALL,
- VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
+ pmap_kenter_pgs(curbuf, &pg, 1);
curbuf += PAGE_SIZE;
curbufsize -= PAGE_SIZE;
}
diff --git a/sys/arch/mvme68k/mvme68k/vm_machdep.c b/sys/arch/mvme68k/mvme68k/vm_machdep.c
index d5771767e13..f7b21567d03 100644
--- a/sys/arch/mvme68k/mvme68k/vm_machdep.c
+++ b/sys/arch/mvme68k/mvme68k/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.27 2001/07/25 13:25:32 art Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.28 2001/08/05 20:35:43 miod Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -175,27 +175,22 @@ pagemove(from, to, size)
size_t size;
{
vm_offset_t pa;
+ boolean_t rv;
#ifdef DEBUG
if ((size & PAGE_MASK) != 0)
panic("pagemove");
#endif
while (size > 0) {
- pmap_extract(pmap_kernel(), (vm_offset_t)from, &pa);
+ rv = pmap_extract(pmap_kernel(), (vm_offset_t)from, &pa);
#ifdef DEBUG
-#if 0
- if (pa == 0)
+ if (rv == FALSE)
panic("pagemove 2");
- if (pmap_extract(pmap_kernel(), (vm_offset_t)to, XXX) != 0)
+ if (pmap_extract(pmap_kernel(), (vm_offset_t)to, NULL) == TRUE)
panic("pagemove 3");
#endif
-#endif
- pmap_remove(pmap_kernel(),
- (vm_offset_t)from, (vm_offset_t)from + PAGE_SIZE);
- pmap_enter(pmap_kernel(),
- (vm_offset_t)to, pa,
- VM_PROT_READ|VM_PROT_WRITE,
- VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
+ pmap_kremove((vm_offset_t)from, PAGE_SIZE);
+ pmap_kenter_pa((vm_offset_t)to, pa, VM_PROT_READ|VM_PROT_WRITE);
from += PAGE_SIZE;
to += PAGE_SIZE;
size -= PAGE_SIZE;
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index 225d8e92f3b..52cb6d7d8ea 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.46 2001/07/25 13:25:32 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.47 2001/08/05 20:35:46 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -631,9 +631,7 @@ cpu_startup()
if (pg == NULL)
panic("cpu_startup: not enough memory for "
"buffer cache");
- pmap_enter(kernel_map->pmap, curbuf,
- VM_PAGE_TO_PHYS(pg), VM_PROT_ALL,
- VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
+ pmap_kenter_pgs(curbuf, &pg, 1);
curbuf += PAGE_SIZE;
curbufsize -= PAGE_SIZE;
}
diff --git a/sys/arch/mvme88k/mvme88k/vm_machdep.c b/sys/arch/mvme88k/mvme88k/vm_machdep.c
index 8cefe462111..16b6acc478a 100644
--- a/sys/arch/mvme88k/mvme88k/vm_machdep.c
+++ b/sys/arch/mvme88k/mvme88k/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.28 2001/07/25 13:25:32 art Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.29 2001/08/05 20:35:46 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -422,8 +422,8 @@ mapiospace(caddr_t pa, int len)
pa = (caddr_t)trunc_page((paddr_t)pa);
- pmap_enter(kernel_pmap, phys_map_vaddr1, (vm_offset_t)pa,
- VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED);
+ pmap_kenter_pa(phys_map_vaddr1, (vm_offset_t)pa,
+ VM_PROT_READ|VM_PROT_WRITE);
return (phys_map_vaddr1 + off);
}
@@ -437,7 +437,7 @@ unmapiospace(vm_offset_t va)
{
va = trunc_page(va);
- pmap_remove(kernel_pmap, va, va + NBPG);
+ pmap_kremove(va, PAGE_SIZE);
}
int
@@ -492,30 +492,26 @@ pagemove(from, to, size)
caddr_t from, to;
size_t size;
{
- vm_offset_t pa;
+ paddr_t pa;
+ boolean_t rv;
#ifdef DEBUG
if ((size & PAGE_MASK) != 0)
panic("pagemove");
#endif
while (size > 0) {
- pmap_extract(kernel_pmap, (vm_offset_t)from, &pa);
+ rv = pmap_extract(kernel_pmap, (vaddr_t)from, &pa);
#ifdef DEBUG
-#if 0
- if (pa == 0)
+ if (rv == FALSE)
panic("pagemove 2");
- if (pmap_extract(kernel_pmap, (vm_offset_t)to, XXX) != 0)
+ if (pmap_extract(kernel_pmap, (vaddr_t)to, NULL) == TRUE)
panic("pagemove 3");
#endif
-#endif
- pmap_remove(kernel_pmap,
- (vm_offset_t)from, (vm_offset_t)from + NBPG);
- pmap_enter(kernel_pmap,
- (vm_offset_t)to, pa, VM_PROT_READ|VM_PROT_WRITE,
- VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
- from += NBPG;
- to += NBPG;
- size -= NBPG;
+ 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;
}
}
@@ -524,7 +520,6 @@ kvtop(va)
vm_offset_t va;
{
vm_offset_t pa;
- extern pmap_t kernel_pmap;
pmap_extract(kernel_pmap, va, &pa);
return ((u_int)pa);