diff options
-rw-r--r-- | arch/mips/mm/tlbex.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 22ba108d708d..70a70085ffd1 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -933,6 +933,13 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) | |||
933 | #endif | 933 | #endif |
934 | uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */ | 934 | uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */ |
935 | uasm_i_lw(p, ptr, uasm_rel_lo(pgdc), ptr); | 935 | uasm_i_lw(p, ptr, uasm_rel_lo(pgdc), ptr); |
936 | |||
937 | if (cpu_has_mips_r2) { | ||
938 | uasm_i_ext(p, tmp, tmp, PGDIR_SHIFT, (32 - PGDIR_SHIFT)); | ||
939 | uasm_i_ins(p, ptr, tmp, PGD_T_LOG2, (32 - PGDIR_SHIFT)); | ||
940 | return; | ||
941 | } | ||
942 | |||
936 | uasm_i_srl(p, tmp, tmp, PGDIR_SHIFT); /* get pgd only bits */ | 943 | uasm_i_srl(p, tmp, tmp, PGDIR_SHIFT); /* get pgd only bits */ |
937 | uasm_i_sll(p, tmp, tmp, PGD_T_LOG2); | 944 | uasm_i_sll(p, tmp, tmp, PGD_T_LOG2); |
938 | uasm_i_addu(p, ptr, ptr, tmp); /* add in pgd offset */ | 945 | uasm_i_addu(p, ptr, ptr, tmp); /* add in pgd offset */ |
@@ -968,6 +975,15 @@ static void __cpuinit build_adjust_context(u32 **p, unsigned int ctx) | |||
968 | 975 | ||
969 | static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) | 976 | static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) |
970 | { | 977 | { |
978 | if (cpu_has_mips_r2) { | ||
979 | /* PTE ptr offset is obtained from BadVAddr */ | ||
980 | UASM_i_MFC0(p, tmp, C0_BADVADDR); | ||
981 | UASM_i_LW(p, ptr, 0, ptr); | ||
982 | uasm_i_ext(p, tmp, tmp, PAGE_SHIFT+1, PGDIR_SHIFT-PAGE_SHIFT-1); | ||
983 | uasm_i_ins(p, ptr, tmp, PTE_T_LOG2+1, PGDIR_SHIFT-PAGE_SHIFT-1); | ||
984 | return; | ||
985 | } | ||
986 | |||
971 | /* | 987 | /* |
972 | * Bug workaround for the Nevada. It seems as if under certain | 988 | * Bug workaround for the Nevada. It seems as if under certain |
973 | * circumstances the move from cp0_context might produce a | 989 | * circumstances the move from cp0_context might produce a |