summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-09-10 18:29:45 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-09-10 18:29:45 +0000
commitdc9f06d0330e3e7e4470e3ea0dc68bebaef4bff9 (patch)
tree1503c1f1af5126456f6dc9827abc9b960308687f /sys/arch/sparc
parent7730c554bf1c303d60002833793768dbd9a6a681 (diff)
Change the pmap_zero_page and pmap_copy_page API to take the struct vm_page *
instead of the pa. Most callers already had it handy and those who didn't only called it for managed pages and were outside time-critical code. This will allow us to make those functions clean and fast on sparc and sparc64 letting us to avoid unnecessary cache flushes. deraadt@ miod@ drahn@ ok.
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/include/pmap.h14
-rw-r--r--sys/arch/sparc/sparc/pmap.c24
2 files changed, 20 insertions, 18 deletions
diff --git a/sys/arch/sparc/include/pmap.h b/sys/arch/sparc/include/pmap.h
index 2a03b363b8f..d4bc88aba33 100644
--- a/sys/arch/sparc/include/pmap.h
+++ b/sys/arch/sparc/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.32 2002/03/14 03:16:00 millert Exp $ */
+/* $OpenBSD: pmap.h,v 1.33 2002/09/10 18:29:43 art Exp $ */
/* $NetBSD: pmap.h,v 1.30 1997/08/04 20:00:47 pk Exp $ */
/*
@@ -315,7 +315,6 @@ void pmap_writetext(unsigned char *, int);
#if defined(SUN4) || defined(SUN4C)
boolean_t pmap_clear_modify4_4c(struct vm_page *);
boolean_t pmap_clear_reference4_4c(struct vm_page *);
-void pmap_copy_page4_4c(paddr_t, paddr_t);
int pmap_enter4_4c(pmap_t, vaddr_t, paddr_t, vm_prot_t, int);
boolean_t pmap_extract4_4c(pmap_t, vaddr_t, paddr_t *);
boolean_t pmap_is_modified4_4c(struct vm_page *);
@@ -324,7 +323,8 @@ void pmap_kenter_pa4_4c(vaddr_t, paddr_t, vm_prot_t);
void pmap_kremove4_4c(vaddr_t, vsize_t);
void pmap_page_protect4_4c(struct vm_page *, vm_prot_t);
void pmap_protect4_4c(pmap_t, vaddr_t, vaddr_t, vm_prot_t);
-void pmap_zero_page4_4c(paddr_t);
+void pmap_copy_page4_4c(struct vm_page *, struct vm_page *);
+void pmap_zero_page4_4c(struct vm_page *);
void pmap_changeprot4_4c(pmap_t, vaddr_t, vm_prot_t, int);
#endif
@@ -333,7 +333,6 @@ void pmap_changeprot4_4c(pmap_t, vaddr_t, vm_prot_t, int);
#if defined(SUN4M)
boolean_t pmap_clear_modify4m(struct vm_page *);
boolean_t pmap_clear_reference4m(struct vm_page *);
-void pmap_copy_page4m(paddr_t, paddr_t);
int pmap_enter4m(pmap_t, vaddr_t, paddr_t, vm_prot_t, int);
boolean_t pmap_extract4m(pmap_t, vaddr_t, paddr_t *);
boolean_t pmap_is_modified4m(struct vm_page *);
@@ -342,7 +341,8 @@ void pmap_kenter_pa4m(vaddr_t, paddr_t, vm_prot_t);
void pmap_kremove4m(vaddr_t, vsize_t);
void pmap_page_protect4m(struct vm_page *, vm_prot_t);
void pmap_protect4m(pmap_t, vaddr_t, vaddr_t, vm_prot_t);
-void pmap_zero_page4m(paddr_t);
+void pmap_copy_page4m(struct vm_page *, struct vm_page *);
+void pmap_zero_page4m(struct vm_page *);
void pmap_changeprot4m(pmap_t, vaddr_t, vm_prot_t, int);
#endif /* defined SUN4M */
@@ -382,7 +382,6 @@ void pmap_changeprot4m(pmap_t, vaddr_t, vm_prot_t, int);
extern boolean_t (*pmap_clear_modify_p)(struct vm_page *);
extern boolean_t (*pmap_clear_reference_p)(struct vm_page *);
-extern void (*pmap_copy_page_p)(paddr_t, paddr_t);
extern int (*pmap_enter_p)(pmap_t, vaddr_t, paddr_t,
vm_prot_t, int);
extern boolean_t (*pmap_extract_p)(pmap_t, vaddr_t, paddr_t *);
@@ -394,7 +393,8 @@ extern void (*pmap_page_protect_p)(struct vm_page *,
vm_prot_t);
extern void (*pmap_protect_p)(pmap_t, vaddr_t, vaddr_t,
vm_prot_t);
-extern void (*pmap_zero_page_p)(paddr_t);
+extern void (*pmap_copy_page_p)(struct vm_page *, struct vm_page *);
+extern void (*pmap_zero_page_p)(struct vm_page *);
extern void (*pmap_changeprot_p)(pmap_t, vaddr_t,
vm_prot_t, int);
diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c
index 0a6d2ad1d3e..8835f82b675 100644
--- a/sys/arch/sparc/sparc/pmap.c
+++ b/sys/arch/sparc/sparc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.128 2002/09/06 22:46:48 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.129 2002/09/10 18:29:43 art Exp $ */
/* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */
/*
@@ -511,7 +511,6 @@ void pv_unlink4_4c(struct pvlist *, struct pmap *, vaddr_t);
/* from pmap.h: */
boolean_t (*pmap_clear_modify_p)(struct vm_page *);
boolean_t (*pmap_clear_reference_p)(struct vm_page *);
-void (*pmap_copy_page_p)(paddr_t, paddr_t);
int (*pmap_enter_p)(pmap_t, vaddr_t, paddr_t, vm_prot_t, int);
boolean_t (*pmap_extract_p)(pmap_t, vaddr_t, paddr_t *);
boolean_t (*pmap_is_modified_p)(struct vm_page *);
@@ -520,7 +519,8 @@ void (*pmap_kenter_pa_p)(vaddr_t, paddr_t, vm_prot_t);
void (*pmap_kremove_p)(vaddr_t, vsize_t);
void (*pmap_page_protect_p)(struct vm_page *, vm_prot_t);
void (*pmap_protect_p)(pmap_t, vaddr_t, vaddr_t, vm_prot_t);
-void (*pmap_zero_page_p)(paddr_t);
+void (*pmap_copy_page_p)(struct vm_page *, struct vm_page *);
+void (*pmap_zero_page_p)(struct vm_page *);
void (*pmap_changeprot_p)(pmap_t, vaddr_t, vm_prot_t, int);
/* local: */
void (*pmap_rmk_p)(struct pmap *, vaddr_t, vaddr_t, int, int);
@@ -5920,9 +5920,9 @@ pmap_is_referenced4m(pg)
#if defined(SUN4) || defined(SUN4C)
void
-pmap_zero_page4_4c(pa)
- paddr_t pa;
+pmap_zero_page4_4c(struct vm_page *pg)
{
+ paddr_t pa = VM_PAGE_TO_PHYS(pg);
caddr_t va;
int pte;
struct pvlist *pv;
@@ -5953,9 +5953,10 @@ pmap_zero_page4_4c(pa)
* the processor.
*/
void
-pmap_copy_page4_4c(src, dst)
- paddr_t src, dst;
+pmap_copy_page4_4c(struct vm_page *srcpg, struct vm_page *dstpg)
{
+ paddr_t src = VM_PAGE_TO_PHYS(srcpg);
+ paddr_t dst = VM_PAGE_TO_PHYS(dstpg);
caddr_t sva, dva;
int spte, dpte;
struct pvlist *pv;
@@ -5991,9 +5992,9 @@ pmap_copy_page4_4c(src, dst)
* XXX might be faster to use destination's context and allow cache to fill?
*/
void
-pmap_zero_page4m(pa)
- paddr_t pa;
+pmap_zero_page4m(struct vm_page *pg)
{
+ paddr_t pa = VM_PAGE_TO_PHYS(pg);
int pte;
struct pvlist *pv;
static int *ptep;
@@ -6036,9 +6037,10 @@ pmap_zero_page4m(pa)
* the processor.
*/
void
-pmap_copy_page4m(src, dst)
- paddr_t src, dst;
+pmap_copy_page4m(struct vm_page *srcpg, struct vm_page *dstpg)
{
+ paddr_t src = VM_PAGE_TO_PHYS(srcpg);
+ paddr_t dst = VM_PAGE_TO_PHYS(dstpg);
int spte, dpte;
struct pvlist *pv;
static int *sptep, *dptep;