This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / mips / mm / tlb-r4k.c
index 59d38bc..91fee06 100644 (file)
 #include <asm/pgtable.h>
 #include <asm/system.h>
 
-extern void build_tlb_refill_handler(void);
+extern void except_vec0_generic(void);
+extern void except_vec0_nevada(void);
+extern void except_vec0_r4000(void);
+extern void except_vec0_r4600(void);
+extern void except_vec1_generic(void);
+extern void except_vec1_r4k(void);
 
 /* CP0 hazard avoidance. */
 #define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
@@ -250,14 +255,8 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
        idx = read_c0_index();
        ptep = pte_offset_map(pmdp, address);
 
- #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
-       write_c0_entrylo0(ptep->pte_high);
-       ptep++;
-       write_c0_entrylo1(ptep->pte_high);
-#else
-       write_c0_entrylo0(pte_val(*ptep++) >> 6);
-       write_c0_entrylo1(pte_val(*ptep) >> 6);
-#endif
+       write_c0_entrylo0(pte_val(*ptep++) >> 6);
+       write_c0_entrylo1(pte_val(*ptep) >> 6);
        write_c0_entryhi(address | pid);
        mtc0_tlbw_hazard();
        if (idx < 0)
@@ -415,5 +414,19 @@ void __init tlb_init(void)
        temp_tlb_entry = current_cpu_data.tlbsize - 1;
        local_flush_tlb_all();
 
-       build_tlb_refill_handler();
+#ifdef CONFIG_MIPS32
+       if (current_cpu_data.cputype == CPU_NEVADA)
+               memcpy((void *)KSEG0, &except_vec0_nevada, 0x80);
+       else if (current_cpu_data.cputype == CPU_R4600)
+               memcpy((void *)KSEG0, &except_vec0_r4600, 0x80);
+       else
+               memcpy((void *)KSEG0, &except_vec0_r4000, 0x80);
+       memcpy((void *)(KSEG0 + 0x080), &except_vec1_generic, 0x80);
+       flush_icache_range(KSEG0, KSEG0 + 0x100);
+#endif
+#ifdef CONFIG_MIPS64
+       memcpy((void *)(CKSEG0 + 0x00), &except_vec0_generic, 0x80);
+       memcpy((void *)(CKSEG0 + 0x80), except_vec1_r4k, 0x80);
+       flush_icache_range(CKSEG0 + 0x80, CKSEG0 + 0x100);
+#endif
 }