summaryrefslogtreecommitdiff
path: root/sys/arch/vax
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-06-08 08:09:45 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-06-08 08:09:45 +0000
commit95da2243c76760307b218cb7f05645e68a73e8af (patch)
tree594a78dc6e16ba4f07e3c1bc9c44def6966cf19e /sys/arch/vax
parent0579d34f9bf07b4a6bfebb51a83de3ac8356c01f (diff)
Change the paddr_t pmap_extract(struct pmap *, vaddr_t) interface to
boolean_t pmap_extract(struct pmap *, vaddr_t, paddr_t *). Matches NetBSD. Tested by various people on various platforms.
Diffstat (limited to 'sys/arch/vax')
-rw-r--r--sys/arch/vax/vax/bus_dma.c5
-rw-r--r--sys/arch/vax/vax/pmap.c22
-rw-r--r--sys/arch/vax/vax/sgmap.c4
-rw-r--r--sys/arch/vax/vax/vm_machdep.c6
4 files changed, 20 insertions, 17 deletions
diff --git a/sys/arch/vax/vax/bus_dma.c b/sys/arch/vax/vax/bus_dma.c
index ec111ba3d22..7434034b8b4 100644
--- a/sys/arch/vax/vax/bus_dma.c
+++ b/sys/arch/vax/vax/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.1 2000/04/27 01:10:10 bjc Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.2 2001/06/08 08:09:31 art Exp $ */
/* $NetBSD: bus_dma.c,v 1.5 1999/11/13 00:32:20 thorpej Exp $ */
/*-
@@ -585,8 +585,7 @@ _bus_dmamap_load_buffer(t, map, buf, buflen, p, flags, lastaddrp, segp, first)
/*
* Get the physical address for this segment.
*/
- curaddr = pmap_extract(pmap, (vaddr_t)vaddr);
-
+ pmap_extract(pmap, (vaddr_t)vaddr, &curaddr);
#if 0
/*
* Make sure we're in an allowed DMA range.
diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c
index a619e1d4887..93aa69ba9fe 100644
--- a/sys/arch/vax/vax/pmap.c
+++ b/sys/arch/vax/vax/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.16 2001/05/16 17:29:39 hugh Exp $ */
+/* $OpenBSD: pmap.c,v 1.17 2001/06/08 08:09:32 art Exp $ */
/* $NetBSD: pmap.c,v 1.74 1999/11/13 21:32:25 matt Exp $ */
/*
* Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden.
@@ -860,10 +860,11 @@ if(startpmapdebug)
return(virtuell+(count-pstart)+KERNBASE);
}
-paddr_t
-pmap_extract(pmap, va)
+boolean_t
+pmap_extract(pmap, va, pap)
pmap_t pmap;
vaddr_t va;
+ paddr_t *pap;
{
paddr_t pa = 0;
int *pte, sva;
@@ -874,23 +875,26 @@ if(startpmapdebug)printf("pmap_extract: pmap %p, va %lx\n",pmap, va);
if (va & KERNBASE) {
pa = kvtophys(va); /* Is 0 if not mapped */
- return(pa);
+ *pap = pa;
+ return (TRUE);
}
sva = PG_PFNUM(va);
if (va < 0x40000000) {
if (sva > (pmap->pm_p0lr & ~AST_MASK))
- return NULL;
+ return (FALSE);
pte = (int *)pmap->pm_p0br;
} else {
if (sva < pmap->pm_p1lr)
- return NULL;
+ return (FALSE);
pte = (int *)pmap->pm_p1br;
}
- if (kvtopte(&pte[sva])->pg_pfn)
- return ((pte[sva] & PG_FRAME) << VAX_PGSHIFT);
+ if (kvtopte(&pte[sva])->pg_pfn) {
+ *pap = ((pte[sva] & PG_FRAME) << VAX_PGSHIFT);
+ return (TRUE);
+ }
- return (NULL);
+ return (FALSE);
}
/*
diff --git a/sys/arch/vax/vax/sgmap.c b/sys/arch/vax/vax/sgmap.c
index 4d420a42b88..d9353f0e486 100644
--- a/sys/arch/vax/vax/sgmap.c
+++ b/sys/arch/vax/vax/sgmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sgmap.c,v 1.3 2001/02/06 04:27:45 hugh Exp $ */
+/* $OpenBSD: sgmap.c,v 1.4 2001/06/08 08:09:33 art Exp $ */
/* $NetBSD: sgmap.c,v 1.8 2000/06/29 07:14:34 mrg Exp $ */
/*-
@@ -243,7 +243,7 @@ vax_sgmap_load(t, map, buf, buflen, p, flags, sgmap)
* Get the physical address for this segment.
*/
if (p != NULL)
- pa = pmap_extract(p->p_vmspace->vm_map.pmap, va);
+ pmap_extract(p->p_vmspace->vm_map.pmap, va, &pa);
else
pa = kvtophys(va);
diff --git a/sys/arch/vax/vax/vm_machdep.c b/sys/arch/vax/vax/vm_machdep.c
index cc0fa99ecb8..7b2e7000d19 100644
--- a/sys/arch/vax/vax/vm_machdep.c
+++ b/sys/arch/vax/vax/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.20 2001/05/05 21:26:42 art Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.21 2001/06/08 08:09:33 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.67 2000/06/29 07:14:34 mrg Exp $ */
/*
@@ -348,8 +348,8 @@ vmapbuf(bp, len)
bp->b_data = (caddr_t)(taddr + off);
len = atop(len);
while (len--) {
- if ((pa = pmap_extract(vm_map_pmap(&p->p_vmspace->vm_map), faddr))
- == FALSE)
+ if (pmap_extract(vm_map_pmap(&p->p_vmspace->vm_map), faddr,
+ &pa) == FALSE)
panic("vmapbuf: null page frame");
pmap_enter(vm_map_pmap(phys_map), taddr, trunc_page(pa),
VM_PROT_READ|VM_PROT_WRITE, TRUE, VM_PROT_READ|VM_PROT_WRITE);