diff options
Diffstat (limited to 'arch/mips/mm/tlbex.c')
-rw-r--r-- | arch/mips/mm/tlbex.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 6f8b25cfa6f0..fec318a1c8c5 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -102,7 +102,7 @@ enum opcode { | |||
102 | insn_addu, insn_addiu, insn_and, insn_andi, insn_beq, | 102 | insn_addu, insn_addiu, insn_and, insn_andi, insn_beq, |
103 | insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, | 103 | insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, |
104 | insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0, | 104 | insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0, |
105 | insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, | 105 | insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, |
106 | insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld, | 106 | insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld, |
107 | insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0, | 107 | insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0, |
108 | insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, | 108 | insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, |
@@ -145,6 +145,7 @@ static __initdata struct insn insn_table[] = { | |||
145 | { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE }, | 145 | { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE }, |
146 | { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE }, | 146 | { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE }, |
147 | { insn_dsrl, M(spec_op,0,0,0,0,dsrl_op), RT | RD | RE }, | 147 | { insn_dsrl, M(spec_op,0,0,0,0,dsrl_op), RT | RD | RE }, |
148 | { insn_dsrl32, M(spec_op,0,0,0,0,dsrl32_op), RT | RD | RE }, | ||
148 | { insn_dsubu, M(spec_op,0,0,0,0,dsubu_op), RS | RT | RD }, | 149 | { insn_dsubu, M(spec_op,0,0,0,0,dsubu_op), RS | RT | RD }, |
149 | { insn_eret, M(cop0_op,cop_op,0,0,0,eret_op), 0 }, | 150 | { insn_eret, M(cop0_op,cop_op,0,0,0,eret_op), 0 }, |
150 | { insn_j, M(j_op,0,0,0,0,0), JIMM }, | 151 | { insn_j, M(j_op,0,0,0,0,0), JIMM }, |
@@ -385,6 +386,7 @@ I_u2u1u3(_dsll); | |||
385 | I_u2u1u3(_dsll32); | 386 | I_u2u1u3(_dsll32); |
386 | I_u2u1u3(_dsra); | 387 | I_u2u1u3(_dsra); |
387 | I_u2u1u3(_dsrl); | 388 | I_u2u1u3(_dsrl); |
389 | I_u2u1u3(_dsrl32); | ||
388 | I_u3u1u2(_dsubu); | 390 | I_u3u1u2(_dsubu); |
389 | I_0(_eret); | 391 | I_0(_eret); |
390 | I_u1(_j); | 392 | I_u1(_j); |
@@ -996,7 +998,12 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r, | |||
996 | #endif | 998 | #endif |
997 | 999 | ||
998 | l_vmalloc_done(l, *p); | 1000 | l_vmalloc_done(l, *p); |
999 | i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3); /* get pgd offset in bytes */ | 1001 | |
1002 | if (PGDIR_SHIFT - 3 < 32) /* get pgd offset in bytes */ | ||
1003 | i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3); | ||
1004 | else | ||
1005 | i_dsrl32(p, tmp, tmp, PGDIR_SHIFT - 3 - 32); | ||
1006 | |||
1000 | i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3); | 1007 | i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3); |
1001 | i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */ | 1008 | i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */ |
1002 | i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */ | 1009 | i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */ |
@@ -1073,7 +1080,7 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) | |||
1073 | 1080 | ||
1074 | static __init void build_adjust_context(u32 **p, unsigned int ctx) | 1081 | static __init void build_adjust_context(u32 **p, unsigned int ctx) |
1075 | { | 1082 | { |
1076 | unsigned int shift = 4 - (PTE_T_LOG2 + 1); | 1083 | unsigned int shift = 4 - (PTE_T_LOG2 + 1) + PAGE_SHIFT - 12; |
1077 | unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1); | 1084 | unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1); |
1078 | 1085 | ||
1079 | switch (current_cpu_data.cputype) { | 1086 | switch (current_cpu_data.cputype) { |