summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/include
diff options
context:
space:
mode:
authorAriane van der Steldt <ariane@cvs.openbsd.org>2011-05-18 21:43:23 +0000
committerAriane van der Steldt <ariane@cvs.openbsd.org>2011-05-18 21:43:23 +0000
commitef69d1bdb25a366d195bbdbdb2396861faccb150 (patch)
treec39863b850e7f251ce4e31bbdf93713f8fd8d94e /sys/arch/sparc64/include
parentdd10958fac547b37c5743e771722322c88d14ed6 (diff)
Turns out VA_ALIAS_MASK is indeed a mask, but with the PAGE_MASK deceptively
zeroed out. Documented this in code and updated PMAP_PREFER_* macros to use the corrected values. Discussed with and ok miod@
Diffstat (limited to 'sys/arch/sparc64/include')
-rw-r--r--sys/arch/sparc64/include/pmap.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/sparc64/include/pmap.h b/sys/arch/sparc64/include/pmap.h
index e379bf15248..31d986e8e44 100644
--- a/sys/arch/sparc64/include/pmap.h
+++ b/sys/arch/sparc64/include/pmap.h
@@ -145,7 +145,8 @@ struct prom_map {
#define PMAP_4M 0x018
#define PMAP_SZ_TO_TTE(x) (((x)&0x018)<<58)
/* If these bits are different in va's to the same PA then there is an aliasing in the d$ */
-#define VA_ALIAS_MASK (1<<13)
+#define VA_ALIAS_MASK (1<<13) /* = (VA_ALIAS_ALIGN - 1) & ~PAGE_MASK */
+#define VA_ALIAS_ALIGN (1<<14)
typedef struct pmap *pmap_t;
@@ -170,9 +171,9 @@ void pmap_bootstrap(u_long, u_long, u_int, u_int);
#define PMAP_PREFER(pa, va) ((va) + (((va) ^ (pa)) & VA_ALIAS_MASK))
/* pmap prefer alignment */
-#define PMAP_PREFER_ALIGN() (VA_ALIAS_MASK)
+#define PMAP_PREFER_ALIGN() (VA_ALIAS_ALIGN)
/* pmap prefer offset in alignment */
-#define PMAP_PREFER_OFFSET(of) ((of) & (VA_ALIAS_MASK - 1))
+#define PMAP_PREFER_OFFSET(of) ((of) & VA_ALIAS_MASK)
#define PMAP_GROWKERNEL /* turn on pmap_growkernel interface */