aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-ppc/op.c')
-rw-r--r--target-ppc/op.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/target-ppc/op.c b/target-ppc/op.c
index 4889ad476f..0030c14661 100644
--- a/target-ppc/op.c
+++ b/target-ppc/op.c
@@ -22,6 +22,7 @@
#include "config.h"
#include "exec.h"
+#include "helper_regs.h"
#include "op_helper.h"
#define REG 0
@@ -284,13 +285,13 @@ void OPPROTO op_store_xer_bc (void)
void OPPROTO op_load_xer (void)
{
- do_load_xer();
+ T0 = hreg_load_xer(env);
RETURN();
}
void OPPROTO op_store_xer (void)
{
- do_store_xer();
+ hreg_store_xer(env, T0);
RETURN();
}
@@ -358,37 +359,36 @@ void OPPROTO op_store_asr (void)
void OPPROTO op_load_msr (void)
{
- T0 = do_load_msr(env);
+ T0 = env->msr;
RETURN();
}
void OPPROTO op_store_msr (void)
{
- if (do_store_msr(env, T0)) {
- env->halted = 1;
- do_raise_exception(EXCP_HLT);
- }
+ do_store_msr();
RETURN();
}
-void OPPROTO op_update_riee (void)
+#if defined (TARGET_PPC64)
+void OPPROTO op_store_msr_32 (void)
{
- msr_ri = (T0 >> MSR_RI) & 1;
- msr_ee = (T0 >> MSR_EE) & 1;
+ T0 = (env->msr & ~0xFFFFFFFFULL) | (T0 & 0xFFFFFFFF);
+ do_store_msr();
RETURN();
}
+#endif
-#if defined (TARGET_PPC64)
-void OPPROTO op_store_msr_32 (void)
+void OPPROTO op_update_riee (void)
{
- if (ppc_store_msr_32(env, T0)) {
- env->halted = 1;
- do_raise_exception(EXCP_HLT);
- }
+ /* We don't call do_store_msr here as we won't trigger
+ * any special case nor change hflags
+ */
+ T0 &= (1 << MSR_RI) | (1 << MSR_EE);
+ env->msr &= ~(1 << MSR_RI) | (1 << MSR_EE);
+ env->msr |= T0;
RETURN();
}
#endif
-#endif
/* SPR */
void OPPROTO op_load_spr (void)
@@ -2517,7 +2517,12 @@ void OPPROTO op_rfmci (void)
void OPPROTO op_wrte (void)
{
- msr_ee = T0 >> 16;
+ /* We don't call do_store_msr here as we won't trigger
+ * any special case nor change hflags
+ */
+ T0 &= 1 << MSR_EE;
+ env->msr &= ~(1 << MSR_EE);
+ env->msr |= T0;
RETURN();
}