linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / powerpc / mm / ppc_mmu_32.c
index 7cceb2c..ed7fcfe 100644 (file)
@@ -23,6 +23,7 @@
  *
  */
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
@@ -41,14 +42,18 @@ unsigned long _SDR1;
 
 union ubat {                   /* BAT register values to be loaded */
        BAT     bat;
+#ifdef CONFIG_PPC64BRIDGE
+       u64     word[2];
+#else
        u32     word[2];
-} BATS[8][2];                  /* 8 pairs of IBAT, DBAT */
+#endif
+} BATS[4][2];                  /* 4 pairs of IBAT, DBAT */
 
 struct batrange {              /* stores address ranges mapped by BATs */
        unsigned long start;
        unsigned long limit;
        unsigned long phys;
-} bat_addrs[8];
+} bat_addrs[4];
 
 /*
  * Return PA for this VA if it is mapped by a BAT, or 0
@@ -185,7 +190,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
                return;
        pmd = pmd_offset(pgd_offset(mm, ea), ea);
        if (!pmd_none(*pmd))
-               add_hash_page(mm->context.id, ea, pmd_val(*pmd));
+               add_hash_page(mm->context, ea, pmd_val(*pmd));
 }
 
 /*
@@ -215,9 +220,15 @@ void __init MMU_init_hw(void)
 
        if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
 
+#ifdef CONFIG_PPC64BRIDGE
+#define LG_HPTEG_SIZE  7               /* 128 bytes per HPTEG */
+#define SDR1_LOW_BITS  (lg_n_hpteg - 11)
+#define MIN_N_HPTEG    2048            /* min 256kB hash table */
+#else
 #define LG_HPTEG_SIZE  6               /* 64 bytes per HPTEG */
 #define SDR1_LOW_BITS  ((n_hpteg - 1) >> 10)
 #define MIN_N_HPTEG    1024            /* min 64kB hash table */
+#endif
 
        /*
         * Allow 1 HPTE (1/8 HPTEG) for each page of memory.