]> err.no Git - linux-2.6/blobdiff - include/asm-ppc64/mmu.h
[PATCH] Serial: Split 8250 port table
[linux-2.6] / include / asm-ppc64 / mmu.h
index c78282a67d8ede88df9cafb7b3f7090fb2ffa3a7..f373de5e3dd900964fbf2ac5f3b52e751eeab3a3 100644 (file)
 #define SLB_VSID_KS            ASM_CONST(0x0000000000000800)
 #define SLB_VSID_KP            ASM_CONST(0x0000000000000400)
 #define SLB_VSID_N             ASM_CONST(0x0000000000000200) /* no-execute */
-#define SLB_VSID_L             ASM_CONST(0x0000000000000100) /* largepage 16M */
+#define SLB_VSID_L             ASM_CONST(0x0000000000000100) /* largepage */
 #define SLB_VSID_C             ASM_CONST(0x0000000000000080) /* class */
-
+#define SLB_VSID_LS            ASM_CONST(0x0000000000000070) /* size of largepage */
 #define SLB_VSID_KERNEL                (SLB_VSID_KP|SLB_VSID_C)
 #define SLB_VSID_USER          (SLB_VSID_KP|SLB_VSID_KS)
 
@@ -180,6 +181,28 @@ static inline void tlbiel(unsigned long va)
        asm volatile("ptesync": : :"memory");
 }
 
+static inline unsigned long slot2va(unsigned long avpn, unsigned long large,
+               unsigned long secondary, unsigned long slot)
+{
+       unsigned long va;
+
+       va = avpn << 23;
+
+       if (!large) {
+               unsigned long vpi, pteg;
+
+               pteg = slot / HPTES_PER_GROUP;
+               if (secondary)
+                       pteg = ~pteg;
+
+               vpi = ((va >> 28) ^ pteg) & htab_hash_mask;
+
+               va |= vpi << PAGE_SHIFT;
+       }
+
+       return va;
+}
+
 /*
  * Handle a fault by adding an HPTE. If the address can't be determined
  * to be valid via Linux page tables, return 1. If handled return 0