Message ID | 4B841757.3070808@redhat.com |
---|---|
State | New |
Headers | show |
> Can you try this patch: It works! Thanks. > and if it works, possibly only each hunk of it? Just the first hunk: works! Just the second hunk: doesn't work Can you explain why the volatile is necessary? Or is it working around a problem with the compiler? Thanks, Jay.
On 02/23/2010 07:17 PM, Jay Foad wrote: >> Can you try this patch: > > It works! Thanks. > >> and if it works, possibly only each hunk of it? > > Just the first hunk: works! > Just the second hunk: doesn't work > > Can you explain why the volatile is necessary? Or is it working around > a problem with the compiler? I don't know exactly without checking, but these were the main changes introduced by my 24ebf5f31a178051cff1a4aab5ba621037191577 patch. I'll send it out shortly. Paolo
diff --git a/cpu-exec.c b/cpu-exec.c index 51aa416..bfaf908 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -215,7 +215,7 @@ static void cpu_handle_debug_exception(CPUState *env) int cpu_exec(CPUState *env1) { - host_reg_t saved_env_reg; + volatile host_reg_t saved_env_reg; int ret, interrupt_request; TranslationBlock *tb; uint8_t *tc_ptr; @@ -230,8 +230,8 @@ int cpu_exec(CPUState *env1) value, so that files not including target-xyz/exec.h are free to use it. */ QEMU_BUILD_BUG_ON (sizeof (saved_env_reg) != sizeof (env)); - saved_env_reg = (host_reg_t) env; asm(""); + saved_env_reg = (host_reg_t) env; env = env1; #if defined(TARGET_I386)