1 --- qemu-0.5.0/Makefile.target.amd64 2003-11-07 09:33:23.000000000 +0100
2 +++ qemu-0.5.0/Makefile.target 2003-11-07 09:33:23.000000000 +0100
3 @@ -56,6 +56,11 @@ LDFLAGS+=-Wl,-shared
8 +OP_CFLAGS=$(CFLAGS) -falign-functions=0
9 +LDFLAGS+=-Wl,-T,$(SRC_PATH)/amd64.ld
14 LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld
15 @@ -140,6 +145,9 @@ LIBOBJS+=disas.o
16 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
19 +ifeq ($(findstring amd64, $(TARGET_ARCH) $(ARCH)),amd64)
22 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
25 --- qemu-0.5.0/exec-all.h.amd64 2003-10-28 01:53:12.000000000 +0100
26 +++ qemu-0.5.0/exec-all.h 2003-11-07 09:33:23.000000000 +0100
27 @@ -132,7 +132,7 @@ void tb_link(TranslationBlock *tb);
29 extern TranslationBlock *tb_hash[CODE_GEN_HASH_SIZE];
31 -extern uint8_t code_gen_buffer[CODE_GEN_BUFFER_SIZE];
32 +//extern uint8_t code_gen_buffer[CODE_GEN_BUFFER_SIZE];
33 extern uint8_t *code_gen_ptr;
35 /* find a translation block in the translation cache. If not found,
36 @@ -309,6 +309,20 @@ static inline int testandset (int *p)
41 +static inline int testandset (int *p)
46 + __asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0"
47 + : "=q" (ret), "=m" (*p), "=a" (readval)
48 + : "r" (1), "m" (*p), "a" (0)
55 static inline int testandset (int *p)
57 --- qemu-0.5.0/dyngen.h.amd64 2003-10-28 01:53:12.000000000 +0100
58 +++ qemu-0.5.0/dyngen.h 2003-11-07 09:33:23.000000000 +0100
59 @@ -27,6 +27,12 @@ static inline void flush_icache_range(un
64 +static inline void flush_icache_range(unsigned long start, unsigned long stop)
70 static inline void flush_icache_range(unsigned long start, unsigned long stop)
72 --- qemu-0.5.0/exec.c.amd64 2003-10-28 01:53:12.000000000 +0100
73 +++ qemu-0.5.0/exec.c 2003-11-07 09:33:23.000000000 +0100
74 @@ -47,8 +47,12 @@ int nb_tbs;
75 /* any access to the tbs or the page table must use this lock */
76 spinlock_t tb_lock = SPIN_LOCK_UNLOCKED;
78 -uint8_t code_gen_buffer[CODE_GEN_BUFFER_SIZE];
79 -uint8_t *code_gen_ptr;
80 +#if defined(__x86_64__)
81 +static uint8_t *code_gen_buffer;
83 +static uint8_t code_gen_buffer[CODE_GEN_BUFFER_SIZE];
85 +uint8_t *code_gen_ptr = NULL;
87 /* XXX: pack the flags in the low bits of the pointer ? */
88 typedef struct PageDesc {
89 @@ -206,6 +210,12 @@ void page_set_flags(unsigned long start,
90 void cpu_exec_init(void)
93 +#if defined(__x86_64__)
94 + code_gen_buffer = mmap(0, CODE_GEN_BUFFER_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC,
95 + MAP_SHARED|MAP_32BIT|MAP_ANONYMOUS, -1, 0);
96 + if (code_gen_buffer == MAP_FAILED)
99 code_gen_ptr = code_gen_buffer;