Lines Matching refs:regs

78 static inline int mipsr6_emul(struct pt_regs *regs, u32 ir)  in mipsr6_emul()  argument
83 regs->regs[MIPSInst_RT(ir)] = in mipsr6_emul()
84 (s32)regs->regs[MIPSInst_RS(ir)] + in mipsr6_emul()
92 regs->regs[MIPSInst_RT(ir)] = in mipsr6_emul()
93 (s64)regs->regs[MIPSInst_RS(ir)] + in mipsr6_emul()
106 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
107 regs->regs[MIPSInst_RS(ir)] | in mipsr6_emul()
108 regs->regs[MIPSInst_RT(ir)]; in mipsr6_emul()
115 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
116 (s32)(((u32)regs->regs[MIPSInst_RT(ir)]) << in mipsr6_emul()
124 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
125 (s32)(((u32)regs->regs[MIPSInst_RT(ir)]) >> in mipsr6_emul()
133 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
134 (s32)((u32)regs->regs[MIPSInst_RS(ir)] + in mipsr6_emul()
135 (u32)regs->regs[MIPSInst_RT(ir)]); in mipsr6_emul()
142 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
143 (s32)((u32)regs->regs[MIPSInst_RS(ir)] - in mipsr6_emul()
144 (u32)regs->regs[MIPSInst_RT(ir)]); in mipsr6_emul()
151 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
152 (s64)(((u64)regs->regs[MIPSInst_RT(ir)]) << in mipsr6_emul()
160 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
161 (s64)(((u64)regs->regs[MIPSInst_RT(ir)]) >> in mipsr6_emul()
169 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
170 (u64)regs->regs[MIPSInst_RS(ir)] + in mipsr6_emul()
171 (u64)regs->regs[MIPSInst_RT(ir)]; in mipsr6_emul()
178 regs->regs[MIPSInst_RD(ir)] = in mipsr6_emul()
179 (s64)((u64)regs->regs[MIPSInst_RS(ir)] - in mipsr6_emul()
180 (u64)regs->regs[MIPSInst_RT(ir)]); in mipsr6_emul()
199 static int movf_func(struct pt_regs *regs, u32 ir) in movf_func() argument
208 regs->regs[MIPSInst_RD(ir)] = regs->regs[MIPSInst_RS(ir)]; in movf_func()
222 static int movt_func(struct pt_regs *regs, u32 ir) in movt_func() argument
231 regs->regs[MIPSInst_RD(ir)] = regs->regs[MIPSInst_RS(ir)]; in movt_func()
247 static int jr_func(struct pt_regs *regs, u32 ir) in jr_func() argument
253 if (delay_slot(regs)) in jr_func()
257 nepc = regs->cp0_epc; in jr_func()
259 regs->cp0_epc -= 4; in jr_func()
260 epc = regs->cp0_epc; in jr_func()
261 err = __compute_return_epc(regs); in jr_func()
268 cepc = regs->cp0_epc; in jr_func()
284 err = mipsr6_emul(regs, nir); in jr_func()
286 regs->cp0_epc = nepc; in jr_func()
287 err = mips_dsemul(regs, nir, epc, cepc); in jr_func()
304 static int movz_func(struct pt_regs *regs, u32 ir) in movz_func() argument
306 if (((regs->regs[MIPSInst_RT(ir)]) == 0) && MIPSInst_RD(ir)) in movz_func()
307 regs->regs[MIPSInst_RD(ir)] = regs->regs[MIPSInst_RS(ir)]; in movz_func()
320 static int movn_func(struct pt_regs *regs, u32 ir) in movn_func() argument
322 if (((regs->regs[MIPSInst_RT(ir)]) != 0) && MIPSInst_RD(ir)) in movn_func()
323 regs->regs[MIPSInst_RD(ir)] = regs->regs[MIPSInst_RS(ir)]; in movn_func()
336 static int mfhi_func(struct pt_regs *regs, u32 ir) in mfhi_func() argument
339 regs->regs[MIPSInst_RD(ir)] = regs->hi; in mfhi_func()
353 static int mthi_func(struct pt_regs *regs, u32 ir) in mthi_func() argument
355 regs->hi = regs->regs[MIPSInst_RS(ir)]; in mthi_func()
369 static int mflo_func(struct pt_regs *regs, u32 ir) in mflo_func() argument
372 regs->regs[MIPSInst_RD(ir)] = regs->lo; in mflo_func()
386 static int mtlo_func(struct pt_regs *regs, u32 ir) in mtlo_func() argument
388 regs->lo = regs->regs[MIPSInst_RS(ir)]; in mtlo_func()
402 static int mult_func(struct pt_regs *regs, u32 ir) in mult_func() argument
407 rt = regs->regs[MIPSInst_RT(ir)]; in mult_func()
408 rs = regs->regs[MIPSInst_RS(ir)]; in mult_func()
412 regs->lo = (s64)rs; in mult_func()
415 regs->hi = res; in mult_func()
429 static int multu_func(struct pt_regs *regs, u32 ir) in multu_func() argument
434 rt = regs->regs[MIPSInst_RT(ir)]; in multu_func()
435 rs = regs->regs[MIPSInst_RS(ir)]; in multu_func()
438 regs->lo = (s64)(s32)rt; in multu_func()
439 regs->hi = (s64)(s32)(res >> 32); in multu_func()
453 static int div_func(struct pt_regs *regs, u32 ir) in div_func() argument
457 rt = regs->regs[MIPSInst_RT(ir)]; in div_func()
458 rs = regs->regs[MIPSInst_RS(ir)]; in div_func()
460 regs->lo = (s64)(rs / rt); in div_func()
461 regs->hi = (s64)(rs % rt); in div_func()
475 static int divu_func(struct pt_regs *regs, u32 ir) in divu_func() argument
479 rt = regs->regs[MIPSInst_RT(ir)]; in divu_func()
480 rs = regs->regs[MIPSInst_RS(ir)]; in divu_func()
482 regs->lo = (s64)(rs / rt); in divu_func()
483 regs->hi = (s64)(rs % rt); in divu_func()
497 static int dmult_func(struct pt_regs *regs, u32 ir) in dmult_func() argument
505 rt = regs->regs[MIPSInst_RT(ir)]; in dmult_func()
506 rs = regs->regs[MIPSInst_RS(ir)]; in dmult_func()
509 regs->lo = res; in dmult_func()
515 regs->hi = res; in dmult_func()
529 static int dmultu_func(struct pt_regs *regs, u32 ir) in dmultu_func() argument
537 rt = regs->regs[MIPSInst_RT(ir)]; in dmultu_func()
538 rs = regs->regs[MIPSInst_RS(ir)]; in dmultu_func()
541 regs->lo = res; in dmultu_func()
547 regs->hi = res; in dmultu_func()
561 static int ddiv_func(struct pt_regs *regs, u32 ir) in ddiv_func() argument
568 rt = regs->regs[MIPSInst_RT(ir)]; in ddiv_func()
569 rs = regs->regs[MIPSInst_RS(ir)]; in ddiv_func()
571 regs->lo = rs / rt; in ddiv_func()
572 regs->hi = rs % rt; in ddiv_func()
586 static int ddivu_func(struct pt_regs *regs, u32 ir) in ddivu_func() argument
593 rt = regs->regs[MIPSInst_RT(ir)]; in ddivu_func()
594 rs = regs->regs[MIPSInst_RS(ir)]; in ddivu_func()
596 regs->lo = rs / rt; in ddivu_func()
597 regs->hi = rs % rt; in ddivu_func()
633 static int madd_func(struct pt_regs *regs, u32 ir) in madd_func() argument
638 rt = regs->regs[MIPSInst_RT(ir)]; in madd_func()
639 rs = regs->regs[MIPSInst_RS(ir)]; in madd_func()
641 rt = regs->hi; in madd_func()
642 rs = regs->lo; in madd_func()
646 regs->lo = (s64)rt; in madd_func()
648 regs->hi = (s64)rs; in madd_func()
662 static int maddu_func(struct pt_regs *regs, u32 ir) in maddu_func() argument
667 rt = regs->regs[MIPSInst_RT(ir)]; in maddu_func()
668 rs = regs->regs[MIPSInst_RS(ir)]; in maddu_func()
670 rt = regs->hi; in maddu_func()
671 rs = regs->lo; in maddu_func()
675 regs->lo = (s64)(s32)rt; in maddu_func()
677 regs->hi = (s64)(s32)rs; in maddu_func()
691 static int msub_func(struct pt_regs *regs, u32 ir) in msub_func() argument
696 rt = regs->regs[MIPSInst_RT(ir)]; in msub_func()
697 rs = regs->regs[MIPSInst_RS(ir)]; in msub_func()
699 rt = regs->hi; in msub_func()
700 rs = regs->lo; in msub_func()
704 regs->lo = (s64)rt; in msub_func()
706 regs->hi = (s64)rs; in msub_func()
720 static int msubu_func(struct pt_regs *regs, u32 ir) in msubu_func() argument
725 rt = regs->regs[MIPSInst_RT(ir)]; in msubu_func()
726 rs = regs->regs[MIPSInst_RS(ir)]; in msubu_func()
728 rt = regs->hi; in msubu_func()
729 rs = regs->lo; in msubu_func()
733 regs->lo = (s64)(s32)rt; in msubu_func()
735 regs->hi = (s64)(s32)rs; in msubu_func()
749 static int mul_func(struct pt_regs *regs, u32 ir) in mul_func() argument
756 rt = regs->regs[MIPSInst_RT(ir)]; in mul_func()
757 rs = regs->regs[MIPSInst_RS(ir)]; in mul_func()
761 regs->regs[MIPSInst_RD(ir)] = (s64)rs; in mul_func()
775 static int clz_func(struct pt_regs *regs, u32 ir) in clz_func() argument
783 rs = regs->regs[MIPSInst_RS(ir)]; in clz_func()
785 regs->regs[MIPSInst_RD(ir)] = res; in clz_func()
800 static int clo_func(struct pt_regs *regs, u32 ir) in clo_func() argument
808 rs = regs->regs[MIPSInst_RS(ir)]; in clo_func()
810 regs->regs[MIPSInst_RD(ir)] = res; in clo_func()
824 static int dclz_func(struct pt_regs *regs, u32 ir) in dclz_func() argument
835 rs = regs->regs[MIPSInst_RS(ir)]; in dclz_func()
837 regs->regs[MIPSInst_RD(ir)] = res; in dclz_func()
851 static int dclo_func(struct pt_regs *regs, u32 ir) in dclo_func() argument
862 rs = regs->regs[MIPSInst_RS(ir)]; in dclo_func()
864 regs->regs[MIPSInst_RD(ir)] = res; in dclo_func()
885 static inline int mipsr2_find_op_func(struct pt_regs *regs, u32 inst, in mipsr2_find_op_func() argument
893 err = (p->func)(regs, inst); in mipsr2_find_op_func()
906 int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31) in mipsr2_decoder() argument
917 r31 = regs->regs[31]; in mipsr2_decoder()
918 epc = regs->cp0_epc; in mipsr2_decoder()
919 err = compute_return_epc(regs); in mipsr2_decoder()
929 err = mipsr2_find_op_func(regs, inst, spec_op_table); in mipsr2_decoder()
932 regs->cp0_cause |= CAUSEF_BD; in mipsr2_decoder()
937 err = mipsr2_find_op_func(regs, inst, spec2_op_table); in mipsr2_decoder()
944 if ((long)regs->regs[rs] >= MIPSInst_SIMM(inst)) in mipsr2_decoder()
945 do_trap_or_bp(regs, 0, 0, "TGEI"); in mipsr2_decoder()
951 if (regs->regs[rs] >= MIPSInst_UIMM(inst)) in mipsr2_decoder()
952 do_trap_or_bp(regs, 0, 0, "TGEIU"); in mipsr2_decoder()
958 if ((long)regs->regs[rs] < MIPSInst_SIMM(inst)) in mipsr2_decoder()
959 do_trap_or_bp(regs, 0, 0, "TLTI"); in mipsr2_decoder()
965 if (regs->regs[rs] < MIPSInst_UIMM(inst)) in mipsr2_decoder()
966 do_trap_or_bp(regs, 0, 0, "TLTIU"); in mipsr2_decoder()
972 if (regs->regs[rs] == MIPSInst_SIMM(inst)) in mipsr2_decoder()
973 do_trap_or_bp(regs, 0, 0, "TEQI"); in mipsr2_decoder()
979 if (regs->regs[rs] != MIPSInst_SIMM(inst)) in mipsr2_decoder()
980 do_trap_or_bp(regs, 0, 0, "TNEI"); in mipsr2_decoder()
989 if (delay_slot(regs)) { in mipsr2_decoder()
993 regs->regs[31] = r31; in mipsr2_decoder()
994 regs->cp0_epc = epc; in mipsr2_decoder()
995 err = __compute_return_epc(regs); in mipsr2_decoder()
1000 cpc = regs->cp0_epc; in mipsr2_decoder()
1031 regs->cp0_cause |= CAUSEF_BD; in mipsr2_decoder()
1035 err = mipsr6_emul(regs, nir); in mipsr2_decoder()
1037 err = mips_dsemul(regs, nir, epc, cpc); in mipsr2_decoder()
1046 if (delay_slot(regs)) { in mipsr2_decoder()
1050 regs->regs[31] = r31; in mipsr2_decoder()
1051 regs->cp0_epc = epc; in mipsr2_decoder()
1052 err = __compute_return_epc(regs); in mipsr2_decoder()
1055 cpc = regs->cp0_epc; in mipsr2_decoder()
1080 regs->cp0_cause |= CAUSEF_BD; in mipsr2_decoder()
1084 err = mipsr6_emul(regs, nir); in mipsr2_decoder()
1086 err = mips_dsemul(regs, nir, epc, cpc); in mipsr2_decoder()
1094 regs->regs[31] = r31; in mipsr2_decoder()
1095 regs->cp0_epc = epc; in mipsr2_decoder()
1115 if (delay_slot(regs)) { in mipsr2_decoder()
1119 regs->regs[31] = r31; in mipsr2_decoder()
1120 regs->cp0_epc = epc; in mipsr2_decoder()
1121 err = __compute_return_epc(regs); in mipsr2_decoder()
1126 cpc = regs->cp0_epc; in mipsr2_decoder()
1157 regs->cp0_cause |= CAUSEF_BD; in mipsr2_decoder()
1161 err = mipsr6_emul(regs, nir); in mipsr2_decoder()
1163 err = mips_dsemul(regs, nir, epc, cpc); in mipsr2_decoder()
1175 regs->regs[31] = r31; in mipsr2_decoder()
1176 regs->cp0_epc = epc; in mipsr2_decoder()
1178 err = fpu_emulator_cop1Handler(regs, &current->thread.fpu, 0, in mipsr2_decoder()
1206 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1207 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1272 regs->regs[MIPSInst_RT(inst)] = rt; in mipsr2_decoder()
1279 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1280 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1346 regs->regs[MIPSInst_RT(inst)] = rt; in mipsr2_decoder()
1353 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1354 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1423 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1424 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1498 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1499 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1606 regs->regs[MIPSInst_RT(inst)] = rt; in mipsr2_decoder()
1617 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1618 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1725 regs->regs[MIPSInst_RT(inst)] = rt; in mipsr2_decoder()
1736 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1737 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1854 rt = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
1855 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
1967 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
2017 regs->regs[MIPSInst_RT(inst)] = res; in mipsr2_decoder()
2023 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
2055 res = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
2074 regs->regs[MIPSInst_RT(inst)] = res; in mipsr2_decoder()
2086 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
2135 regs->regs[MIPSInst_RT(inst)] = res; in mipsr2_decoder()
2147 vaddr = regs->regs[MIPSInst_RS(inst)] + MIPSInst_SIMM(inst); in mipsr2_decoder()
2179 res = regs->regs[MIPSInst_RT(inst)]; in mipsr2_decoder()
2198 regs->regs[MIPSInst_RT(inst)] = res; in mipsr2_decoder()
2215 regs->cp0_cause &= ~CAUSEF_BD; in mipsr2_decoder()
2216 err = get_user(inst, (u32 __user *)regs->cp0_epc); in mipsr2_decoder()
2225 regs->regs[31] = r31; in mipsr2_decoder()
2226 regs->cp0_epc = epc; in mipsr2_decoder()