sh: Better description of SH-4 PTEA register update.
authorMichael Trimarchi <trimarchimichael@yahoo.it>
Thu, 20 Aug 2009 04:27:44 +0000 (13:27 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 20 Aug 2009 04:27:44 +0000 (13:27 +0900)
Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/include/asm/pgtable_32.h
arch/sh/mm/tlb-sh4.c

index 0db19db913c76ecd1de170fc5c6c28813f12ab10..4c4429cda56d7d9e8006f2c3905de800597166e7 100644 (file)
 #define _PAGE_PCC_ATR8 0x60000000      /* Attribute Memory space, 8 bit bus */
 #define _PAGE_PCC_ATR16        0x60000001      /* Attribute Memory space, 6 bit bus */
 
+#ifndef CONFIG_X2TLB
+/* copy the ptea attributes */
+static inline unsigned long copy_ptea_attributes(unsigned long x)
+{
+       return  ((x >> 28) & 0xe) | (x & 0x1);
+}
+#endif
+
 /* Mask which drops unused bits from the PTEL value */
 #if defined(CONFIG_CPU_SH3)
 #define _PAGE_CLEAR_FLAGS      (_PAGE_PROTNONE | _PAGE_ACCESSED| \
index f0c7b7397fa655804e59f161ffbf48ad37a801fd..fd0d11f1a81c9257450a65c334d57733db0e7d71 100644 (file)
@@ -61,9 +61,12 @@ void update_mmu_cache(struct vm_area_struct * vma,
         */
        ctrl_outl(pte.pte_high, MMU_PTEA);
 #else
-       if (cpu_data->flags & CPU_HAS_PTEA)
-               /* TODO: make this look less hacky */
-               ctrl_outl(((pteval >> 28) & 0xe) | (pteval & 0x1), MMU_PTEA);
+       if (cpu_data->flags & CPU_HAS_PTEA) {
+               /* The last 3 bits and the first one of pteval contains
+                * the PTEA timing control and space attribute bits
+                */
+               ctrl_outl(copy_ptea_attributes(pteval), MMU_PTEA);
+       }
 #endif
 
        /* Set PTEL register */