/* This places the pte into ENTRYLO0 and writes it with tlbwi or tlbwr as appropriate. This is because the index register may have the probe fail bit set as a result of a trap on a kseg2 access, i.e. without refill. Then it returns.  */
static void __cpuinit build_r3000_tlb_reload_write(u32 **p, struct uasm_label **l, struct uasm_reloc **r, unsigned int pte, unsigned int tmp)
/* This places the pte into ENTRYLO0 and writes it with tlbwi or tlbwr as appropriate. This is because the index register may have the probe fail bit set as a result of a trap on a kseg2 access, i.e. without refill. Then it returns.  */
static void __cpuinit build_r3000_tlb_reload_write(u32 **p, struct uasm_label **l, struct uasm_reloc **r, unsigned int pte, unsigned int tmp)
{
	uasm_i_mfc0(p, tmp, C0_INDEX);
	uasm_i_mtc0(p, pte, C0_ENTRYLO0);
	uasm_il_bltz(p, r, tmp, label_r3000_write_probe_fail);
	uasm_i_mfc0(p, tmp, C0_EPC);
	uasm_i_tlbwi(p);
	uasm_i_jr(p, tmp);
	uasm_i_rfe(p);
	uasm_l_r3000_write_probe_fail(l, *p);
	uasm_i_tlbwr(p);
	uasm_i_jr(p, tmp);
	uasm_i_rfe(p);
}