Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334484
b: refs/heads/master
c: 02a5417
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed Oct 16, 2012
1 parent 1cde902 commit ab07e41
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5210edcd527773c227465ad18e416a894966324f
refs/heads/master: 02a5417751c31cd64197652c000a5ab0d3261465
41 changes: 34 additions & 7 deletions trunk/arch/mips/mm/tlbex.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ enum label_id {
label_leave,
label_vmalloc,
label_vmalloc_done,
label_tlbw_hazard,
label_split,
label_tlbw_hazard_0,
label_split = label_tlbw_hazard_0 + 8,
label_tlbl_goaround1,
label_tlbl_goaround2,
label_nopage_tlbl,
Expand All @@ -167,7 +167,7 @@ UASM_L_LA(_second_part)
UASM_L_LA(_leave)
UASM_L_LA(_vmalloc)
UASM_L_LA(_vmalloc_done)
UASM_L_LA(_tlbw_hazard)
/* _tlbw_hazard_x is handled differently. */
UASM_L_LA(_split)
UASM_L_LA(_tlbl_goaround1)
UASM_L_LA(_tlbl_goaround2)
Expand All @@ -181,6 +181,30 @@ UASM_L_LA(_large_segbits_fault)
UASM_L_LA(_tlb_huge_update)
#endif

static int __cpuinitdata hazard_instance;

static void uasm_bgezl_hazard(u32 **p, struct uasm_reloc **r, int instance)
{
switch (instance) {
case 0 ... 7:
uasm_il_bgezl(p, r, 0, label_tlbw_hazard_0 + instance);
return;
default:
BUG();
}
}

static void uasm_bgezl_label(struct uasm_label **l, u32 **p, int instance)
{
switch (instance) {
case 0 ... 7:
uasm_build_label(l, *p, label_tlbw_hazard_0 + instance);
break;
default:
BUG();
}
}

/*
* For debug purposes.
*/
Expand Down Expand Up @@ -478,9 +502,10 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
* This branch uses up a mtc0 hazard nop slot and saves
* two nops after the tlbw instruction.
*/
uasm_il_bgezl(p, r, 0, label_tlbw_hazard);
uasm_bgezl_hazard(p, r, hazard_instance);
tlbw(p);
uasm_l_tlbw_hazard(l, *p);
uasm_bgezl_label(l, p, hazard_instance);
hazard_instance++;
uasm_i_nop(p);
break;

Expand Down Expand Up @@ -527,14 +552,16 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
break;

case CPU_NEVADA:
uasm_i_nop(p); /* QED specifies 2 nops hazard */
uasm_i_nop(p); /* QED specifies 2 nops hazard */
/*
* This branch uses up a mtc0 hazard nop slot and saves
* a nop after the tlbw instruction.
*/
uasm_il_bgezl(p, r, 0, label_tlbw_hazard);
uasm_bgezl_hazard(p, r, hazard_instance);
tlbw(p);
uasm_l_tlbw_hazard(l, *p);
uasm_bgezl_label(l, p, hazard_instance);
hazard_instance++;
break;

case CPU_RM7000:
Expand Down

0 comments on commit ab07e41

Please sign in to comment.