Fix reproductible crash: call cpu_loop_exit from micro-op, not from helper.c

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3311 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
j_mayer 2007-10-01 21:49:57 +00:00
parent 51996525c7
commit a97fed52e5
3 changed files with 16 additions and 16 deletions

View File

@ -611,9 +611,9 @@ void do_store_sr (CPUPPCState *env, int srnum, target_ulong value);
target_ulong ppc_load_xer (CPUPPCState *env);
void ppc_store_xer (CPUPPCState *env, target_ulong value);
target_ulong do_load_msr (CPUPPCState *env);
void do_store_msr (CPUPPCState *env, target_ulong value);
int do_store_msr (CPUPPCState *env, target_ulong value);
#if defined(TARGET_PPC64)
void ppc_store_msr_32 (CPUPPCState *env, uint32_t value);
int ppc_store_msr_32 (CPUPPCState *env, uint32_t value);
#endif
void do_compute_hflags (CPUPPCState *env);

View File

@ -1839,7 +1839,7 @@ target_ulong do_load_msr (CPUPPCState *env)
((target_ulong)msr_le << MSR_LE);
}
void do_store_msr (CPUPPCState *env, target_ulong value)
int do_store_msr (CPUPPCState *env, target_ulong value)
{
int enter_pm;
@ -1921,21 +1921,15 @@ void do_store_msr (CPUPPCState *env, target_ulong value)
default:
break;
}
if (enter_pm) {
if (likely(!env->halted)) {
/* power save: exit cpu loop */
env->halted = 1;
env->exception_index = EXCP_HLT;
cpu_loop_exit();
}
}
return enter_pm;
}
#if defined(TARGET_PPC64)
void ppc_store_msr_32 (CPUPPCState *env, uint32_t value)
int ppc_store_msr_32 (CPUPPCState *env, uint32_t value)
{
do_store_msr(env,
(do_load_msr(env) & ~0xFFFFFFFFULL) | (value & 0xFFFFFFFF));
return do_store_msr(env, (do_load_msr(env) & ~0xFFFFFFFFULL) |
(value & 0xFFFFFFFF));
}
#endif

View File

@ -351,7 +351,10 @@ void OPPROTO op_load_msr (void)
void OPPROTO op_store_msr (void)
{
do_store_msr(env, T0);
if (do_store_msr(env, T0)) {
env->halted = 1;
do_raise_exception(EXCP_HLT);
}
RETURN();
}
@ -365,7 +368,10 @@ void OPPROTO op_update_riee (void)
#if defined (TARGET_PPC64)
void OPPROTO op_store_msr_32 (void)
{
ppc_store_msr_32(env, T0);
if (ppc_store_msr_32(env, T0)) {
env->halted = 1;
do_raise_exception(EXCP_HLT);
}
RETURN();
}
#endif