diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-12-06 20:57:20 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-12-06 20:57:20 +0000 |
commit | 06811f8b859a05f9e03926e7738072c6f7fbbc50 (patch) | |
tree | 398a2d7680dfa249a5a2dbbf60f625e96988442e /sys/arch/hppa64 | |
parent | 03433864b95120162a7f43c2099393d501ba6abc (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/hppa64')
-rw-r--r-- | sys/arch/hppa64/include/pmap.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/arch/hppa64/include/pmap.h b/sys/arch/hppa64/include/pmap.h index c6f2167d8d9..9d7694cf1e6 100644 --- a/sys/arch/hppa64/include/pmap.h +++ b/sys/arch/hppa64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.2 2007/09/10 18:49:45 miod Exp $ */ +/* $OpenBSD: pmap.h,v 1.3 2010/12/06 20:57:16 miod Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -58,13 +58,15 @@ extern struct pmap kernel_pmap_store; * 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_GROWKERNEL #define PMAP_STEAL_MEMORY |