summaryrefslogtreecommitdiff
path: root/sys/arch/mvme68k
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-06-24 14:04:05 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-06-24 14:04:05 +0000
commit76c79aee42660b862a952765e9872d54cd1895be (patch)
tree990870ef5adc957f5607a278b18adb49ca05976a /sys/arch/mvme68k
parentfea465563a4c0910177afebb066fae27ddebc71a (diff)
Replace physaccess() usage with pmap_kenter_cache().
Diffstat (limited to 'sys/arch/mvme68k')
-rw-r--r--sys/arch/mvme68k/include/cpu.h4
-rw-r--r--sys/arch/mvme68k/mvme68k/autoconf.c27
-rw-r--r--sys/arch/mvme68k/mvme68k/vm_machdep.c39
3 files changed, 21 insertions, 49 deletions
diff --git a/sys/arch/mvme68k/include/cpu.h b/sys/arch/mvme68k/include/cpu.h
index c7536919082..201ce6c7e5c 100644
--- a/sys/arch/mvme68k/include/cpu.h
+++ b/sys/arch/mvme68k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.23 2006/06/11 20:48:13 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.24 2006/06/24 14:04:02 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -206,8 +206,6 @@ int intr_findvec(int, int);
void dma_cachectl(caddr_t, int);
paddr_t kvtop(vaddr_t);
-void physaccess(vaddr_t, paddr_t, size_t, int);
-void physunaccess(vaddr_t, size_t);
#endif /* _KERNEL */
#endif /* _MVME68K_CPU_H_ */
diff --git a/sys/arch/mvme68k/mvme68k/autoconf.c b/sys/arch/mvme68k/mvme68k/autoconf.c
index 0ce4f800225..b52448cfdc0 100644
--- a/sys/arch/mvme68k/mvme68k/autoconf.c
+++ b/sys/arch/mvme68k/mvme68k/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.33 2006/01/11 07:22:00 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.34 2006/06/24 14:04:04 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -86,6 +86,8 @@
#include <machine/cpu.h>
#include <machine/pte.h>
+#include <uvm/uvm_extern.h>
+
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
@@ -213,7 +215,7 @@ mapiodev(pa, size)
int size;
{
int error;
- vaddr_t kva;
+ vaddr_t va, iova;
if (size <= 0)
return NULL;
@@ -224,13 +226,20 @@ mapiodev(pa, size)
#endif
error = extent_alloc(extio, size, EX_NOALIGN, 0, EX_NOBOUNDARY,
- EX_NOWAIT | EX_MALLOCOK, (u_long *)&kva);
+ EX_NOWAIT | EX_MALLOCOK, &iova);
if (error != 0)
return NULL;
- physaccess(kva, pa, size, PG_RW | PG_CI);
- return (kva);
+ va = iova;
+ while (size != 0) {
+ pmap_kenter_cache(va, pa, PG_RW | PG_CI);
+ size -= PAGE_SIZE;
+ va += PAGE_SIZE;
+ pa += PAGE_SIZE;
+ }
+ pmap_update(pmap_kernel());
+ return (iova);
}
void
@@ -246,12 +255,14 @@ unmapiodev(kva, size)
if (kva < extiobase || kva >= extiobase + ctob(EIOMAPSIZE))
panic("unmapiodev: bad address");
#endif
- physunaccess(kva, size);
-
- error = extent_free(extio, (u_long)kva, size, EX_NOWAIT);
+ pmap_kremove(kva, size);
+ pmap_update(pmap_kernel());
+ error = extent_free(extio, kva, size, EX_NOWAIT);
+#ifdef DIAGNOSTIC
if (error != 0)
printf("unmapiodev: extent_free failed\n");
+#endif
}
/*
diff --git a/sys/arch/mvme68k/mvme68k/vm_machdep.c b/sys/arch/mvme68k/mvme68k/vm_machdep.c
index 523b194df00..b482555b13d 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.41 2006/06/23 13:46:05 mickey Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.42 2006/06/24 14:04:04 miod Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -224,43 +224,6 @@ pagemove(from, to, size)
}
/*
- * Map `size' bytes of physical memory starting at `paddr' into
- * kernel VA space at `vaddr'. Read/write and cache-inhibit status
- * are specified by `prot'.
- */
-void
-physaccess(vaddr, paddr, size, prot)
- vaddr_t vaddr;
- paddr_t paddr;
- size_t size;
- int prot;
-{
- pt_entry_t *pte;
- u_int page;
-
- pte = kvtopte(vaddr);
- page = (u_int)paddr & PG_FRAME;
- for (size = btoc(size); size; size--) {
- *pte++ = PG_V | prot | page;
- page += NBPG;
- }
- TBIAS();
-}
-
-void
-physunaccess(vaddr, size)
- vaddr_t vaddr;
- size_t size;
-{
- pt_entry_t *pte;
-
- pte = kvtopte(vaddr);
- for (size = btoc(size); size; size--)
- *pte++ = PG_NV;
- TBIAS();
-}
-
-/*
* Convert kernel VA to physical address
*/
paddr_t