summaryrefslogtreecommitdiff
path: root/sys/arch/hppa
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/hppa
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/hppa')
-rw-r--r--sys/arch/hppa/include/pmap.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/arch/hppa/include/pmap.h b/sys/arch/hppa/include/pmap.h
index 4e8003e16e8..5384ca2bd6e 100644
--- a/sys/arch/hppa/include/pmap.h
+++ b/sys/arch/hppa/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.38 2010/11/18 21:21:36 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.39 2010/12/06 20:57:16 miod Exp $ */
/*
* Copyright (c) 2002-2004 Michael Shalayeff
@@ -91,13 +91,15 @@ struct vm_page *pmap_unmap_direct(vaddr_t);
* according to the parisc manual aliased va's should be
* different by high 12 bits only.
*/
-#define PMAP_PREFER(o,h) do { \
- vaddr_t pmap_prefer_hint; \
- pmap_prefer_hint = (*(h) & HPPA_PGAMASK) | ((o) & HPPA_PGAOFF); \
- if (pmap_prefer_hint < *(h)) \
- pmap_prefer_hint += HPPA_PGALIAS; \
- *(h) = pmap_prefer_hint; \
-} while(0)
+#define PMAP_PREFER(o,h) pmap_prefer(o, h)
+static __inline__ vaddr_t
+pmap_prefer(vaddr_t offs, vaddr_t hint)
+{
+ vaddr_t pmap_prefer_hint = (hint & HPPA_PGAMASK) | (offs & HPPA_PGAOFF);
+ if (pmap_prefer_hint < hint)
+ pmap_prefer_hint += HPPA_PGALIAS;
+ return pmap_prefer_hint;
+}
#define pmap_sid2pid(s) (((s) + 1) << 1)
#define pmap_kernel() (&kernel_pmap_store)