fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / sh / mm / tlb-sh4.c
index 4b7a0bc..812b2d5 100644 (file)
@@ -25,7 +25,6 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
 
@@ -37,7 +36,6 @@ void update_mmu_cache(struct vm_area_struct * vma,
        unsigned long vpn;
        struct page *page;
        unsigned long pfn;
-       unsigned long ptea;
 
        /* Ptrace may call this routine. */
        if (vma && current->active_mm != vma->vm_mm)
@@ -60,10 +58,11 @@ void update_mmu_cache(struct vm_area_struct * vma,
        ctrl_outl(vpn, MMU_PTEH);
 
        pteval = pte_val(pte);
+
        /* Set PTEA register */
-       /* TODO: make this look less hacky */
-       ptea = ((pteval >> 28) & 0xe) | (pteval & 0x1);
-       ctrl_outl(ptea, MMU_PTEA);
+       if (cpu_data->flags & CPU_HAS_PTEA)
+               /* TODO: make this look less hacky */
+               ctrl_outl(((pteval >> 28) & 0xe) | (pteval & 0x1), MMU_PTEA);
 
        /* Set PTEL register */
        pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */