summaryrefslogtreecommitdiff
path: root/sys/arch/arm
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/arm
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/arm')
-rw-r--r--sys/arch/arm/arm/pmap.c11
-rw-r--r--sys/arch/arm/include/pmap.h4
2 files changed, 7 insertions, 8 deletions
diff --git a/sys/arch/arm/arm/pmap.c b/sys/arch/arm/arm/pmap.c
index 689e1bdf64f..2be1a0f025e 100644
--- a/sys/arch/arm/arm/pmap.c
+++ b/sys/arch/arm/arm/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.28 2010/11/28 20:44:15 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.29 2010/12/06 20:57:13 miod Exp $ */
/* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */
/*
@@ -5025,17 +5025,16 @@ pmap_uarea(vaddr_t va)
uint32_t pmap_alias_dist;
uint32_t pmap_alias_bits;
-void
-pmap_prefer(vaddr_t foff, vaddr_t *vap)
+vaddr_t
+pmap_prefer(vaddr_t foff, vaddr_t va)
{
- vaddr_t va = *vap;
long d, m;
m = pmap_alias_dist;
if (m == 0) /* m=0 => no cache aliasing */
- return;
+ return va;
d = foff - va;
d &= (m - 1);
- *vap = va + d;
+ return va + d;
}
diff --git a/sys/arch/arm/include/pmap.h b/sys/arch/arm/include/pmap.h
index f3d2199c913..d5877c33475 100644
--- a/sys/arch/arm/include/pmap.h
+++ b/sys/arch/arm/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.13 2010/11/27 20:45:27 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.14 2010/12/06 20:57:15 miod Exp $ */
/* $NetBSD: pmap.h,v 1.76 2003/09/06 09:10:46 rearnsha Exp $ */
/*
@@ -617,7 +617,7 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#ifndef _LOCORE
/* pmap_prefer bits for VIPT ARMv7 */
#define PMAP_PREFER(fo, ap) pmap_prefer((fo), (ap))
-void pmap_prefer(vaddr_t, vaddr_t *);
+vaddr_t pmap_prefer(vaddr_t, vaddr_t);
extern uint32_t pmap_alias_dist;
extern uint32_t pmap_alias_bits;