|
From: | Alexander Graf |
Subject: | Re: [Qemu-devel] Crash due to invalid env->current_tb |
Date: | Wed, 30 Apr 2008 19:30:08 +0200 |
On Apr 30, 2008, at 5:21 PM, Adam Lackorzynski wrote:
On Wed Apr 30, 2008 at 17:11:32 +0200, Adam Lackorzynski wrote:On Wed Apr 30, 2008 at 11:08:46 +0200, Alexander Graf wrote:There was a comment from Fabrice on how to do prologues in TCG to save /restore the clobbered values. Btw, ebx gets clobbered as well.tcg/README says that some registers are clobbered. So something like this should be safe: Index: cpu-exec.c =================================================================== --- cpu-exec.c (revision 4276) +++ cpu-exec.c (working copy) @@ -690,6 +691,15 @@ fp.ip = tc_ptr; fp.gp = code_gen_buffer + 2 * (1 << 20); (*(void (*)(void)) &fp)(); +#elif defined(__i386) + asm volatile ("push %%ebp\n" + "push %%ebx\n" + "call *%1\n" + "pop %%ebx\n" + "pop %%ebp\n" + : "=a" (T0) + : "r" (gen_func) + : "esi", "edi", "ecx", "edx"); #else T0 = gen_func(); #endifI just realised that the push and pop of ebx is not needed as T0 is ebxwhich gets overwritten in the output anyway.
Why is T0 =a then? Shouldn't =a mean "input and output on eax for T0"?
Index: cpu-exec.c =================================================================== --- cpu-exec.c (revision 4276) +++ cpu-exec.c (working copy) @@ -690,6 +691,13 @@ fp.ip = tc_ptr; fp.gp = code_gen_buffer + 2 * (1 << 20); (*(void (*)(void)) &fp)(); +#elif defined(__i386) + asm volatile ("push %%ebp\n" + "call *%1\n" + "pop %%ebp\n" + : "=a" (T0) + : "r" (gen_func) + : "esi", "edi", "ecx", "edx"); #else T0 = gen_func(); #endif Adam -- Adam address@hidden Lackorzynski http://os.inf.tu-dresden.de/~adam/
[Prev in Thread] | Current Thread | [Next in Thread] |