summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-12-06 20:57:20 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-12-06 20:57:20 +0000
commit06811f8b859a05f9e03926e7738072c6f7fbbc50 (patch)
tree398a2d7680dfa249a5a2dbbf60f625e96988442e /sys/arch/mips64
parent03433864b95120162a7f43c2099393d501ba6abc (diff)
Change the signature of PMAP_PREFER from void PMAP_PREFER(..., vaddr_t *) to
vaddr_t PMAP_PREFER(..., vaddr_t). This allows better compiler optimization when the function is inlined, and avoids accessing memory on architectures when we can pass function arguments in registers.
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/include/pmap.h4
-rw-r--r--sys/arch/mips64/mips64/pmap.c17
2 files changed, 9 insertions, 12 deletions
diff --git a/sys/arch/mips64/include/pmap.h b/sys/arch/mips64/include/pmap.h
index ee632dfcffa..2bf522895f7 100644
--- a/sys/arch/mips64/include/pmap.h
+++ b/sys/arch/mips64/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.22 2010/11/28 20:30:51 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.23 2010/12/06 20:57:17 miod Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
@@ -131,7 +131,7 @@ extern struct pmap *const kernel_pmap_ptr;
void pmap_bootstrap(void);
int pmap_is_page_ro( pmap_t, vaddr_t, pt_entry_t);
void pmap_kenter_cache(vaddr_t va, paddr_t pa, vm_prot_t prot, int cache);
-void pmap_prefer(vaddr_t, vaddr_t *);
+vaddr_t pmap_prefer(vaddr_t, vaddr_t);
void pmap_set_modify(vm_page_t);
void pmap_page_cache(vm_page_t, int);
diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c
index d404043f642..f90562c99ec 100644
--- a/sys/arch/mips64/mips64/pmap.c
+++ b/sys/arch/mips64/mips64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.51 2010/11/28 20:30:54 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.52 2010/12/06 20:57:17 miod Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -1119,16 +1119,13 @@ pmap_extract(pmap_t pmap, vaddr_t va, paddr_t *pap)
* Find first virtual address >= *vap that
* will not cause cache aliases.
*/
-void
-pmap_prefer(paddr_t foff, vaddr_t *vap)
+vaddr_t
+pmap_prefer(paddr_t foff, vaddr_t va)
{
- if (CpuCacheAliasMask != 0) {
-#if 1
- *vap += (foff - *vap) & (CpuCacheAliasMask | PAGE_MASK);
-#else
- *vap += (*vap ^ foff) & CpuCacheAliasMask;
-#endif
- }
+ if (CpuCacheAliasMask != 0)
+ va += (foff - va) & (CpuCacheAliasMask | PAGE_MASK);
+
+ return va;
}
/*