X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=target-ppc%2Fop.c;h=f439a81dfbde14772ce69d53dca6e37bbc4ddbd8;hb=6d463de2b3e261e95f224767605eef02acbd2701;hp=de7e24735549025991ef22bbb376c6a72a96a2af;hpb=1ef59d0acf7c71e9b863bff904ceac74ce9bd107;p=qemu diff --git a/target-ppc/op.c b/target-ppc/op.c index de7e247..f439a81 100644 --- a/target-ppc/op.c +++ b/target-ppc/op.c @@ -208,32 +208,28 @@ PPC_OP(set_T2) } /* Generate exceptions */ -PPC_OP(queue_exception_err) +PPC_OP(raise_exception_err) { - do_queue_exception_err(PARAM(1), PARAM(2)); + do_raise_exception_err(PARAM(1), PARAM(2)); } -PPC_OP(queue_exception) +PPC_OP(raise_exception) { - do_queue_exception(PARAM(1)); + do_raise_exception(PARAM(1)); } -PPC_OP(process_exceptions) +PPC_OP(update_nip) { env->nip = PARAM(1); - if (env->exceptions != 0) { - do_check_exception_state(); - } } PPC_OP(debug) { env->nip = PARAM(1); - env->brkstate = 1; #if defined (DEBUG_OP) dump_state(); #endif - do_queue_exception(EXCP_DEBUG); + do_raise_exception(EXCP_DEBUG); RETURN(); } @@ -246,10 +242,7 @@ PPC_OP(load_srin) PPC_OP(store_srin) { -#if defined (DEBUG_OP) - dump_store_sr(T1 >> 28); -#endif - regs->sr[T1 >> 28] = T0; + do_store_sr(T1 >> 28); RETURN(); } @@ -364,58 +357,38 @@ PPC_OP(store_ctr) RETURN(); } -/* Update time base */ -PPC_OP(update_tb) +PPC_OP(load_tbl) { - T0 = regs->tb[0]; - T1 = T0; - T0 += PARAM(1); -#if defined (DEBUG_OP) - dump_update_tb(PARAM(1)); -#endif - if (T0 < T1) { - T1 = regs->tb[1] + 1; - regs->tb[1] = T1; - } - regs->tb[0] = T0; + T0 = cpu_ppc_load_tbl(regs); RETURN(); } -PPC_OP(load_tb) +PPC_OP(load_tbu) { - T0 = regs->tb[PARAM(1)]; + T0 = cpu_ppc_load_tbu(regs); RETURN(); } -PPC_OP(store_tb) +PPC_OP(store_tbl) { - regs->tb[PARAM(1)] = T0; -#if defined (DEBUG_OP) - dump_store_tb(PARAM(1)); -#endif + cpu_ppc_store_tbl(regs, T0); RETURN(); } -/* Update decrementer */ -PPC_OP(update_decr) +PPC_OP(store_tbu) { - T0 = regs->decr; - T1 = T0; - T0 -= PARAM(1); - regs->decr = T0; - if (PARAM(1) > T1) { - do_queue_exception(EXCP_DECR); - } + cpu_ppc_store_tbu(regs, T0); RETURN(); } -PPC_OP(store_decr) +PPC_OP(load_decr) { - T1 = regs->decr; - regs->decr = T0; - if (Ts0 < 0 && Ts1 > 0) { - do_queue_exception(EXCP_DECR); + T0 = cpu_ppc_load_decr(regs); } + +PPC_OP(store_decr) +{ + cpu_ppc_store_decr(regs, T0); RETURN(); } @@ -426,10 +399,7 @@ PPC_OP(load_ibat) PPC_OP(store_ibat) { -#if defined (DEBUG_OP) - dump_store_ibat(PARAM(1), PARAM(2)); -#endif - regs->IBAT[PARAM(1)][PARAM(2)] = T0; + do_store_ibat(PARAM(1), PARAM(2)); } PPC_OP(load_dbat) @@ -439,10 +409,7 @@ PPC_OP(load_dbat) PPC_OP(store_dbat) { -#if defined (DEBUG_OP) - dump_store_dbat(PARAM(1), PARAM(2)); -#endif - regs->DBAT[PARAM(1)][PARAM(2)] = T0; + do_store_dbat(PARAM(1), PARAM(2)); } /* FPSCR */ @@ -1368,9 +1335,7 @@ PPC_OP(fmsubs) /* fnmadd - fnmadd. - fnmadds - fnmadds. */ PPC_OP(fnmadd) { - FT0 *= FT1; - FT0 += FT2; - FT0 = -FT0; + do_fnmadd(); RETURN(); } @@ -1384,9 +1349,7 @@ PPC_OP(fnmadds) /* fnmsub - fnmsub. */ PPC_OP(fnmsub) { - FT0 *= FT1; - FT0 -= FT2; - FT0 = -FT0; + do_fnmsub(); RETURN(); } @@ -1468,20 +1431,28 @@ PPC_OP(fneg) #include "op_mem.h" #endif +/* Special op to check and maybe clear reservation */ +PPC_OP(check_reservation) +{ + do_check_reservation(); + RETURN(); +} + /* Return from interrupt */ PPC_OP(rfi) { + regs->nip = regs->spr[SRR0] & ~0x00000003; +#if 1 // TRY + T0 = regs->spr[SRR1] & ~0xFFF00000; +#else T0 = regs->spr[SRR1] & ~0xFFFF0000; +#endif do_store_msr(); - do_tlbia(); #if defined (DEBUG_OP) dump_rfi(); #endif - regs->nip = regs->spr[SRR0] & ~0x00000003; - do_queue_exception(EXCP_RFI); - if (env->exceptions != 0) { - do_check_exception_state(); - } + // do_tlbia(); + do_raise_exception(EXCP_RFI); RETURN(); } @@ -1493,7 +1464,7 @@ PPC_OP(tw) (Ts0 == Ts1 && (PARAM(1) & 0x04)) || (T0 < T1 && (PARAM(1) & 0x02)) || (T0 > T1 && (PARAM(1) & 0x01))) - do_queue_exception_err(EXCP_PROGRAM, EXCP_TRAP); + do_raise_exception_err(EXCP_PROGRAM, EXCP_TRAP); RETURN(); } @@ -1504,7 +1475,7 @@ PPC_OP(twi) (Ts0 == SPARAM(1) && (PARAM(2) & 0x04)) || (T0 < (uint32_t)SPARAM(1) && (PARAM(2) & 0x02)) || (T0 > (uint32_t)SPARAM(1) && (PARAM(2) & 0x01))) - do_queue_exception_err(EXCP_PROGRAM, EXCP_TRAP); + do_raise_exception_err(EXCP_PROGRAM, EXCP_TRAP); RETURN(); }