fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / sh / mm / tlb-sh4.c
index 115b1b6..812b2d5 100644 (file)
@@ -36,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)
@@ -59,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 */