summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-09-12 12:50:48 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-09-12 12:50:48 +0000
commit94cd548f5e458ee4007ccd36bb076cdb1633224f (patch)
treeac081ffb867356e61beac9cd473099270eba0863 /sys
parent5e160649cbb1039103e113108d099c3c2dcde44b (diff)
Change the PMAP_{MAP,UNMAP}_POOLPAGE api to take a vm_page as argument
and return a VM_PAGE. This is to allow sparc64 to cheaply record the VAC color for those pages.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/include/pmap.h6
-rw-r--r--sys/arch/hppa/include/pmap.h6
-rw-r--r--sys/arch/powerpc/include/pmap.h6
-rw-r--r--sys/arch/vax/include/pmap.h6
-rw-r--r--sys/uvm/uvm_km.c9
5 files changed, 15 insertions, 18 deletions
diff --git a/sys/arch/alpha/include/pmap.h b/sys/arch/alpha/include/pmap.h
index ce905446937..d70588646a4 100644
--- a/sys/arch/alpha/include/pmap.h
+++ b/sys/arch/alpha/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.12 2002/07/24 00:33:50 art Exp $ */
+/* $OpenBSD: pmap.h,v 1.13 2002/09/12 12:50:47 art Exp $ */
/* $NetBSD: pmap.h,v 1.37 2000/11/19 03:16:35 thorpej Exp $ */
/*-
@@ -203,8 +203,8 @@ extern pt_entry_t *VPT; /* Virtual Page Table */
/*
* Alternate mapping hooks for pool pages. Avoids thrashing the TLB.
*/
-#define PMAP_MAP_POOLPAGE(pa) ALPHA_PHYS_TO_K0SEG((pa))
-#define PMAP_UNMAP_POOLPAGE(va) ALPHA_K0SEG_TO_PHYS((va))
+#define PMAP_MAP_POOLPAGE(pg) ALPHA_PHYS_TO_K0SEG(VM_PAGE_TO_PHYS(pg))
+#define PMAP_UNMAP_POOLPAGE(va) PHYS_TO_VM_PAGE(ALPHA_K0SEG_TO_PHYS((va)))
paddr_t vtophys(vaddr_t);
diff --git a/sys/arch/hppa/include/pmap.h b/sys/arch/hppa/include/pmap.h
index 4800e61feba..0f2899093b0 100644
--- a/sys/arch/hppa/include/pmap.h
+++ b/sys/arch/hppa/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.22 2002/09/05 18:41:19 mickey Exp $ */
+/* $OpenBSD: pmap.h,v 1.23 2002/09/12 12:50:47 art Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -96,8 +96,8 @@ extern struct pdc_hwtlb pdc_hwtlb;
/*
* pool quickmaps
*/
-#define PMAP_MAP_POOLPAGE(pa) ((vaddr_t)(pa))
-#define PMAP_UNMAP_POOLPAGE(va) ((paddr_t)(va))
+#define PMAP_MAP_POOLPAGE(pg) ((vaddr_t)VM_PAGE_TO_PHYS(pg))
+#define PMAP_UNMAP_POOLPAGE(va) PHYS_TO_VM_PAGE((paddr_t)(va))
/*
* according to the parisc manual aliased va's should be
diff --git a/sys/arch/powerpc/include/pmap.h b/sys/arch/powerpc/include/pmap.h
index c13941fcc30..14d30fa66e2 100644
--- a/sys/arch/powerpc/include/pmap.h
+++ b/sys/arch/powerpc/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.28 2002/07/24 02:19:28 drahn Exp $ */
+/* $OpenBSD: pmap.h,v 1.29 2002/09/12 12:50:47 art Exp $ */
/* $NetBSD: pmap.h,v 1.1 1996/09/30 16:34:29 ws Exp $ */
/*-
@@ -117,8 +117,8 @@ boolean_t pteclrbits(paddr_t pa, u_int mask, u_int clear);
* Really simple. 0x0->0x80000000 contain 1->1 mappings of the physical
* memory. - XXX
*/
-#define PMAP_MAP_POOLPAGE(pa) ((vaddr_t)pa)
-#define PMAP_UNMAP_POOLPAGE(va) ((paddr_t)va)
+#define PMAP_MAP_POOLPAGE(pg) ((vaddr_t)VM_PAGE_TO_PHYS(pg))
+#define PMAP_UNMAP_POOLPAGE(va) PHYS_TO_VM_PAGE((paddr_t)va)
void pmap_bootstrap(u_int kernelstart, u_int kernelend);
diff --git a/sys/arch/vax/include/pmap.h b/sys/arch/vax/include/pmap.h
index cf0b83594ff..cf768e3c853 100644
--- a/sys/arch/vax/include/pmap.h
+++ b/sys/arch/vax/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.17 2002/09/10 18:29:44 art Exp $ */
+/* $OpenBSD: pmap.h,v 1.18 2002/09/12 12:50:47 art Exp $ */
/* $NetBSD: pmap.h,v 1.37 1999/08/01 13:48:07 ragge Exp $ */
/*
@@ -112,8 +112,8 @@ extern struct pmap kernel_pmap_store;
* Real nice (fast) routines to get the virtual address of a physical page
* (and vice versa).
*/
-#define PMAP_MAP_POOLPAGE(pa) ((pa) | KERNBASE)
-#define PMAP_UNMAP_POOLPAGE(va) ((va) & ~KERNBASE)
+#define PMAP_MAP_POOLPAGE(pg) (VM_PAGE_TO_PHYS(pg) | KERNBASE)
+#define PMAP_UNMAP_POOLPAGE(va) PHYS_TO_VM_PAGE((va) & ~KERNBASE)
#define PMAP_STEAL_MEMORY
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c
index b02253de261..aa7bf26bc15 100644
--- a/sys/uvm/uvm_km.c
+++ b/sys/uvm/uvm_km.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_km.c,v 1.32 2002/05/30 06:26:10 deraadt Exp $ */
+/* $OpenBSD: uvm_km.c,v 1.33 2002/09/12 12:50:47 art Exp $ */
/* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */
/*
@@ -855,7 +855,7 @@ uvm_km_alloc_poolpage1(map, obj, waitok)
} else
return (0);
}
- va = PMAP_MAP_POOLPAGE(VM_PAGE_TO_PHYS(pg));
+ va = PMAP_MAP_POOLPAGE(pg);
if (__predict_false(va == 0))
uvm_pagefree(pg);
return (va);
@@ -893,10 +893,7 @@ uvm_km_free_poolpage1(map, addr)
vaddr_t addr;
{
#if defined(PMAP_UNMAP_POOLPAGE)
- paddr_t pa;
-
- pa = PMAP_UNMAP_POOLPAGE(addr);
- uvm_pagefree(PHYS_TO_VM_PAGE(pa));
+ uvm_pagefree(PMAP_UNMAP_POOLPAGE(addr));
#else
int s;