Lines Matching refs:regs

76 static inline int mipsr6_emul(struct pt_regs *regs, u32 ir)  in mipsr6_emul()  argument
81 regs->regs[MIPSInst_RT(ir)] = in mipsr6_emul()
82 (s32)regs->regs[MIPSInst_RS(ir)] + in mipsr6_emul()
90 regs->regs[MIPSInst_RT(ir)] = in mipsr6_emul()
91 (s64)regs->regs[MIPSInst_RS(ir)] + in mipsr6_emul()
104 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
105 regs->regs[MIPSInst_RS(ir)] | in mipsr6_emul()
106 regs->regs[MIPSInst_RT(ir)]; in mipsr6_emul()
113 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
114 (s32)(((u32)regs->regs[MIPSInst_RT(ir)]) << in mipsr6_emul()
122 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
123 (s32)(((u32)regs->regs[MIPSInst_RT(ir)]) >> in mipsr6_emul()
131 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
132 (s32)((u32)regs->regs[MIPSInst_RS(ir)] + in mipsr6_emul()
133 (u32)regs->regs[MIPSInst_RT(ir)]); in mipsr6_emul()
140 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
141 (s32)((u32)regs->regs[MIPSInst_RS(ir)] - in mipsr6_emul()
142 (u32)regs->regs[MIPSInst_RT(ir)]); in mipsr6_emul()
149 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
150 (s64)(((u64)regs->regs[MIPSInst_RT(ir)]) << in mipsr6_emul()
158 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
159 (s64)(((u64)regs->regs[MIPSInst_RT(ir)]) >> in mipsr6_emul()
167 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
168 (u64)regs->regs[MIPSInst_RS(ir)] + in mipsr6_emul()
169 (u64)regs->regs[MIPSInst_RT(ir)]; in mipsr6_emul()
176 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
177 (s64)((u64)regs->regs[MIPSInst_RS(ir)] - in mipsr6_emul()
178 (u64)regs->regs[MIPSInst_RT(ir)]); in mipsr6_emul()
197 static int movf_func(struct pt_regs *regs, u32 ir) in movf_func() argument
206 regs->regs[MIPSInst_RD(ir)] = regs->regs[MIPSInst_RS(ir)]; in movf_func()
220 static int movt_func(struct pt_regs *regs, u32 ir) in movt_func() argument
229 regs->regs[MIPSInst_RD(ir)] = regs->regs[MIPSInst_RS(ir)]; in movt_func()
245 static int jr_func(struct pt_regs *regs, u32 ir) in jr_func() argument
251 if (delay_slot(regs)) in jr_func()
255 nepc = regs->cp0_epc; in jr_func()
257 regs->cp0_epc -= 4; in jr_func()
258 epc = regs->cp0_epc; in jr_func()
259 err = __compute_return_epc(regs); in jr_func()
266 cepc = regs->cp0_epc; in jr_func()
282 err = mipsr6_emul(regs, nir); in jr_func()
284 regs->cp0_epc = nepc; in jr_func()
285 err = mips_dsemul(regs, nir, cepc); in jr_func()
302 static int movz_func(struct pt_regs *regs, u32 ir) in movz_func() argument
304 if (((regs->regs[MIPSInst_RT(ir)]) == 0) && MIPSInst_RD(ir)) in movz_func()
305 regs->regs[MIPSInst_RD(ir)] = regs->regs[MIPSInst_RS(ir)]; in movz_func()
318 static int movn_func(struct pt_regs *regs, u32 ir) in movn_func() argument
320 if (((regs->regs[MIPSInst_RT(ir)]) != 0) && MIPSInst_RD(ir)) in movn_func()
321 regs->regs[MIPSInst_RD(ir)] = regs->regs[MIPSInst_RS(ir)]; in movn_func()
334 static int mfhi_func(struct pt_regs *regs, u32 ir) in mfhi_func() argument
337 regs->regs[MIPSInst_RD(ir)] = regs->hi; in mfhi_func()
351 static int mthi_func(struct pt_regs *regs, u32 ir) in mthi_func() argument
353 regs->hi = regs->regs[MIPSInst_RS(ir)]; in mthi_func()
367 static int mflo_func(struct pt_regs *regs, u32 ir) in mflo_func() argument
370 regs->regs[MIPSInst_RD(ir)] = regs->lo; in mflo_func()
384 static int mtlo_func(struct pt_regs *regs, u32 ir) in mtlo_func() argument
386 regs->lo = regs->regs[MIPSInst_RS(ir)]; in mtlo_func()
400 static int mult_func(struct pt_regs *regs, u32 ir) in mult_func() argument
405 rt = regs->regs[MIPSInst_RT(ir)]; in mult_func()
406 rs = regs->regs[MIPSInst_RS(ir)]; in mult_func()
410 regs->lo = (s64)rs; in mult_func()
413 regs->hi = res; in mult_func()
427 static int multu_func(struct pt_regs *regs, u32 ir) in multu_func() argument
432 rt = regs->regs[MIPSInst_RT(ir)]; in multu_func()
433 rs = regs->regs[MIPSInst_RS(ir)]; in multu_func()
436 regs->lo = (s64)rt; in multu_func()
437 regs->hi = (s64)(res >> 32); in multu_func()
451 static int div_func(struct pt_regs *regs, u32 ir) in div_func() argument
455 rt = regs->regs[MIPSInst_RT(ir)]; in div_func()
456 rs = regs->regs[MIPSInst_RS(ir)]; in div_func()
458 regs->lo = (s64)(rs / rt); in div_func()
459 regs->hi = (s64)(rs % rt); in div_func()
473 static int divu_func(struct pt_regs *regs, u32 ir) in divu_func() argument
477 rt = regs->regs[MIPSInst_RT(ir)]; in divu_func()
478 rs = regs->regs[MIPSInst_RS(ir)]; in divu_func()
480 regs->lo = (s64)(rs / rt); in divu_func()
481 regs->hi = (s64)(rs % rt); in divu_func()
495 static int dmult_func(struct pt_regs *regs, u32 ir) in dmult_func() argument
503 rt = regs->regs[MIPSInst_RT(ir)]; in dmult_func()
504 rs = regs->regs[MIPSInst_RS(ir)]; in dmult_func()
507 regs->lo = res; in dmult_func()
513 regs->hi = res; in dmult_func()
527 static int dmultu_func(struct pt_regs *regs, u32 ir) in dmultu_func() argument
535 rt = regs->regs[MIPSInst_RT(ir)]; in dmultu_func()
536 rs = regs->regs[MIPSInst_RS(ir)]; in dmultu_func()
539 regs->lo = res; in dmultu_func()
545 regs->hi = res; in dmultu_func()
559 static int ddiv_func(struct pt_regs *regs, u32 ir) in ddiv_func() argument
566 rt = regs->regs[MIPSInst_RT(ir)]; in ddiv_func()
567 rs = regs->regs[MIPSInst_RS(ir)]; in ddiv_func()
569 regs->lo = rs / rt; in ddiv_func()
570 regs->hi = rs % rt; in ddiv_func()
584 static int ddivu_func(struct pt_regs *regs, u32 ir) in ddivu_func() argument
591 rt = regs->regs[MIPSInst_RT(ir)]; in ddivu_func()
592 rs = regs->regs[MIPSInst_RS(ir)]; in ddivu_func()
594 regs->lo = rs / rt; in ddivu_func()
595 regs->hi = rs % rt; in ddivu_func()
631 static int madd_func(struct pt_regs *regs, u32 ir) in madd_func() argument
636 rt = regs->regs[MIPSInst_RT(ir)]; in madd_func()
637 rs = regs->regs[MIPSInst_RS(ir)]; in madd_func()
639 rt = regs->hi; in madd_func()
640 rs = regs->lo; in madd_func()
644 regs->lo = (s64)rt; in madd_func()
646 regs->hi = (s64)rs; in madd_func()
660 static int maddu_func(struct pt_regs *regs, u32 ir) in maddu_func() argument
665 rt = regs->regs[MIPSInst_RT(ir)]; in maddu_func()
666 rs = regs->regs[MIPSInst_RS(ir)]; in maddu_func()
668 rt = regs->hi; in maddu_func()
669 rs = regs->lo; in maddu_func()
673 regs->lo = (s64)rt; in maddu_func()
675 regs->hi = (s64)rs; in maddu_func()
689 static int msub_func(struct pt_regs *regs, u32 ir) in msub_func() argument
694 rt = regs->regs[MIPSInst_RT(ir)]; in msub_func()
695 rs = regs->regs[MIPSInst_RS(ir)]; in msub_func()
697 rt = regs->hi; in msub_func()
698 rs = regs->lo; in msub_func()
702 regs->lo = (s64)rt; in msub_func()
704 regs->hi = (s64)rs; in msub_func()
718 static int msubu_func(struct pt_regs *regs, u32 ir) in msubu_func() argument
723 rt = regs->regs[MIPSInst_RT(ir)]; in msubu_func()
724 rs = regs->regs[MIPSInst_RS(ir)]; in msubu_func()
726 rt = regs->hi; in msubu_func()
727 rs = regs->lo; in msubu_func()
731 regs->lo = (s64)rt; in msubu_func()
733 regs->hi = (s64)rs; in msubu_func()
747 static int mul_func(struct pt_regs *regs, u32 ir) in mul_func() argument
754 rt = regs->regs[MIPSInst_RT(ir)]; in mul_func()
755 rs = regs->regs[MIPSInst_RS(ir)]; in mul_func()
759 regs->regs[MIPSInst_RD(ir)] = (s64)rs; in mul_func()
773 static int clz_func(struct pt_regs *regs, u32 ir) in clz_func() argument
781 rs = regs->regs[MIPSInst_RS(ir)]; in clz_func()
783 regs->regs[MIPSInst_RD(ir)] = res; in clz_func()
798 static int clo_func(struct pt_regs *regs, u32 ir) in clo_func() argument
806 rs = regs->regs[MIPSInst_RS(ir)]; in clo_func()
808 regs->regs[MIPSInst_RD(ir)] = res; in clo_func()
822 static int dclz_func(struct pt_regs *regs, u32 ir) in dclz_func() argument
833 rs = regs->regs[MIPSInst_RS(ir)]; in dclz_func()
835 regs->regs[MIPSInst_RD(ir)] = res; in dclz_func()
849 static int dclo_func(struct pt_regs *regs, u32 ir) in dclo_func() argument
860 rs = regs->regs[MIPSInst_RS(ir)]; in dclo_func()
862 regs->regs[MIPSInst_RD(ir)] = res; in dclo_func()
883 static inline int mipsr2_find_op_func(struct pt_regs *regs, u32 inst, in mipsr2_find_op_func() argument
891 err = (p->func)(regs, inst); in mipsr2_find_op_func()
904 int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) in mipsr2_decoder() argument
915 r31 = regs->regs[31]; in mipsr2_decoder()
916 epc = regs->cp0_epc; in mipsr2_decoder()
917 err = compute_return_epc(regs); in mipsr2_decoder()
927 err = mipsr2_find_op_func(regs, inst, spec_op_table); in mipsr2_decoder()
930 regs->cp0_cause |= CAUSEF_BD; in mipsr2_decoder()
935 err = mipsr2_find_op_func(regs, inst, spec2_op_table); in mipsr2_decoder()
942 if ((long)regs->regs[rs] >= MIPSInst_SIMM(inst)) in mipsr2_decoder()
943 do_trap_or_bp(regs, 0, "TGEI"); in mipsr2_decoder()
949 if (regs->regs[rs] >= MIPSInst_UIMM(inst)) in mipsr2_decoder()
950 do_trap_or_bp(regs, 0, "TGEIU"); in mipsr2_decoder()
956 if ((long)regs->regs[rs] < MIPSInst_SIMM(inst)) in mipsr2_decoder()
957 do_trap_or_bp(regs, 0, "TLTI"); in mipsr2_decoder()
963 if (regs->regs[rs] < MIPSInst_UIMM(inst)) in mipsr2_decoder()
964 do_trap_or_bp(regs, 0, "TLTIU"); in mipsr2_decoder()
970 if (regs->regs[rs] == MIPSInst_SIMM(inst)) in mipsr2_decoder()
971 do_trap_or_bp(regs, 0, "TEQI"); in mipsr2_decoder()
977 if (regs->regs[rs] != MIPSInst_SIMM(inst)) in mipsr2_decoder()
978 do_trap_or_bp(regs, 0, "TNEI"); in mipsr2_decoder()
987 if (delay_slot(regs)) { in mipsr2_decoder()
991 regs->regs[31] = r31; in mipsr2_decoder()
992 regs->cp0_epc = epc; in mipsr2_decoder()
993 err = __compute_return_epc(regs); in mipsr2_decoder()
998 cpc = regs->cp0_epc; in mipsr2_decoder()
1029 regs->cp0_cause |= CAUSEF_BD; in mipsr2_decoder()
1033 err = mipsr6_emul(regs, nir); in mipsr2_decoder()
1035 err = mips_dsemul(regs, nir, cpc); in mipsr2_decoder()
1044 if (delay_slot(regs)) { in mipsr2_decoder()
1048 regs->regs[31] = r31; in mipsr2_decoder()
1049 regs->cp0_epc = epc; in mipsr2_decoder()
1050 err = __compute_return_epc(regs); in mipsr2_decoder()
1053 cpc = regs->cp0_epc; in mipsr2_decoder()
1078 regs->cp0_cause |= CAUSEF_BD; in mipsr2_decoder()
1082 err = mipsr6_emul(regs, nir); in mipsr2_decoder()
1084 err = mips_dsemul(regs, nir, cpc); in mipsr2_decoder()
1092 regs->regs[31] = r31; in mipsr2_decoder()
1093 regs->cp0_epc = epc; in mipsr2_decoder()
1103 if (delay_slot(regs)) { in mipsr2_decoder()
1107 regs->regs[31] = r31; in mipsr2_decoder()
1108 regs->cp0_epc = epc; in mipsr2_decoder()
1109 err = __compute_return_epc(regs); in mipsr2_decoder()
1114 cpc = regs->cp0_epc; in mipsr2_decoder()
1145 regs->cp0_cause |= CAUSEF_BD; in mipsr2_decoder()
1149 err = mipsr6_emul(regs, nir); in mipsr2_decoder()
1151 err = mips_dsemul(regs, nir, cpc); in mipsr2_decoder()
1163 regs->regs[31] = r31; in mipsr2_decoder()
1164 regs->cp0_epc = epc; in mipsr2_decoder()
1171 err = fpu_emulator_cop1Handler(regs, &current->thread.fpu, 0, in mipsr2_decoder()
1199 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1200 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1265 regs->regs[MIPSInst_RT(inst)] = rt; in mipsr2_decoder()
1272 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1273 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1339 regs->regs[MIPSInst_RT(inst)] = rt; in mipsr2_decoder()
1346 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1347 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1416 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1417 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1491 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1492 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1599 regs->regs[MIPSInst_RT(inst)] = rt; in mipsr2_decoder()
1610 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1611 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1718 regs->regs[MIPSInst_RT(inst)] = rt; in mipsr2_decoder()
1729 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1730 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1847 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1848 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1960 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
2010 regs->regs[MIPSInst_RT(inst)] = res; in mipsr2_decoder()
2016 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
2048 res = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
2067 regs->regs[MIPSInst_RT(inst)] = res; in mipsr2_decoder()
2079 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
2128 regs->regs[MIPSInst_RT(inst)] = res; in mipsr2_decoder()
2140 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
2172 res = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
2191 regs->regs[MIPSInst_RT(inst)] = res; in mipsr2_decoder()
2208 regs->cp0_cause &= ~CAUSEF_BD; in mipsr2_decoder()
2209 err = get_user(inst, (u32 __user *)regs->cp0_epc); in mipsr2_decoder()
2218 regs->regs[31] = r31; in mipsr2_decoder()
2219 regs->cp0_epc = epc; in mipsr2_decoder()