summaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/mmu-hash32.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/mmu-hash32.h')
-rw-r--r--include/asm-powerpc/mmu-hash32.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-powerpc/mmu-hash32.h b/include/asm-powerpc/mmu-hash32.h
index 6e21ca6..f39ff98 100644
--- a/include/asm-powerpc/mmu-hash32.h
+++ b/include/asm-powerpc/mmu-hash32.h
@@ -28,6 +28,15 @@
#define BPP_RW 0x02 /* Read/write */
#ifndef __ASSEMBLY__
+/* Contort a phys_addr_t into the right format/bits for a BAT */
+#ifdef CONFIG_PHYS_64BIT
+#define BAT_PHYS_ADDR(x) ((u32)((x & 0x00000000fffe0000ULL) | \
+ ((x & 0x0000000e00000000ULL) >> 24) | \
+ ((x & 0x0000000100000000ULL) >> 30)))
+#else
+#define BAT_PHYS_ADDR(x) (x)
+#endif
+
struct ppc_bat {
struct {
unsigned long bepi:15; /* Effective page index (virtual address) */
OpenPOWER on IntegriCloud