]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/qemu-0.9.1-gcc4-opts.patch
A little bit of virtualization:
[ipfire-2.x.git] / src / patches / qemu-0.9.1-gcc4-opts.patch
1 2008-01-12 Mike Kronenberg <mike.kronenberg@kronenberg.org>
2
3 * cpu-exec.c: Fix for QEMU 0.9.1.
4
5 2005-11-11 Gwenole Beauchesne <gbeauchesne@mandriva.com>
6
7 * Globaaly save %ebx, %esi, %edi on entry to generated
8 function. This avoids some register spills in synthetic opcodes.
9 NOTE: this also easily fixes gcc4 compiled qemu-system-x86_64 on x86.
10
11 --- qemu-0.7.2/cpu-exec.c.gcc4-opts 2005-09-04 19:11:31.000000000 +0200
12 +++ qemu-0.7.2/cpu-exec.c 2005-11-11 17:40:47.000000000 +0100
13 @@ -561,6 +561,15 @@ int cpu_exec(CPUState *env1)
14 : /* no outputs */
15 : "r" (gen_func)
16 : "r1", "r2", "r3", "r8", "r9", "r10", "r12", "r14");
17 +#elif defined(TARGET_X86_64) && defined(__i386__)
18 + asm volatile ("push %%ebx\n"
19 + "push %%esi\n"
20 + "push %%edi\n"
21 + "call *%0\n"
22 + "pop %%edi\n"
23 + "pop %%esi\n"
24 + "pop %%ebx\n"
25 + : : "r" (gen_func) : "ebx", "esi", "edi");
26 #elif defined(__ia64)
27 struct fptr {
28 void *ip;
29 --- qemu-0.7.2/Makefile.target.gcc4-opts 2005-11-11 16:26:33.000000000 +0100
30 +++ qemu-0.7.2/Makefile.target 2005-11-11 17:59:56.000000000 +0100
31 @@ -65,6 +65,10 @@ OP_CFLAGS+= -falign-functions=0 -fno-gcs
32 else
33 OP_CFLAGS+= -malign-functions=0
34 endif
35 +ifeq ($(TARGET_ARCH), x86_64)
36 +# XXX globally save %ebx, %esi, %edi on entry to generated function
37 +OP_CFLAGS+= -fcall-used-ebx -fcall-used-esi -fcall-used-edi
38 +endif
39
40 ifdef TARGET_GPROF
41 USE_I386_LD=y