Commit 0b0babc623d1e6e0fe19a3b05a1f418edb65b371

Authored by bellard
1 parent 20f32282

x86_64 target support


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1191 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 36 additions and 16 deletions
Makefile.target
1 1 include config.mak
2 2  
3   -TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH)
  3 +TARGET_BASE_ARCH:=$(TARGET_ARCH)
  4 +ifeq ($(TARGET_ARCH), x86_64)
  5 +TARGET_BASE_ARCH:=i386
  6 +endif
  7 +TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
4 8 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
5 9 DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH)
6 10 ifdef CONFIG_USER_ONLY
... ... @@ -8,6 +12,7 @@ VPATH+=:$(SRC_PATH)/linux-user
8 12 DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
9 13 endif
10 14 CFLAGS=-Wall -O2 -g -fno-strict-aliasing
  15 +#CFLAGS+=-Werror
11 16 LDFLAGS=-g
12 17 LIBS=
13 18 HELPER_CFLAGS=$(CFLAGS)
... ... @@ -52,6 +57,12 @@ endif # ARCH != i386
52 57  
53 58 endif # TARGET_ARCH = i386
54 59  
  60 +ifeq ($(TARGET_ARCH), x86_64)
  61 +ifdef CONFIG_SOFTMMU
  62 +PROGS+=$(QEMU_SYSTEM)
  63 +endif
  64 +endif # TARGET_ARCH = x86_64
  65 +
55 66 ifeq ($(TARGET_ARCH), ppc)
56 67  
57 68 ifeq ($(ARCH), ppc)
... ... @@ -64,11 +75,11 @@ PROGS+=$(QEMU_SYSTEM)
64 75 endif
65 76 endif # ARCH = i386
66 77  
67   -ifeq ($(ARCH), amd64)
  78 +ifeq ($(ARCH), x86_64)
68 79 ifdef CONFIG_SOFTMMU
69 80 PROGS+=$(QEMU_SYSTEM)
70 81 endif
71   -endif # ARCH = amd64
  82 +endif # ARCH = x86_64
72 83  
73 84 endif # TARGET_ARCH = ppc
74 85  
... ... @@ -84,11 +95,11 @@ PROGS+=$(QEMU_SYSTEM)
84 95 endif
85 96 endif # ARCH = i386
86 97  
87   -ifeq ($(ARCH), amd64)
  98 +ifeq ($(ARCH), x86_64)
88 99 ifdef CONFIG_SOFTMMU
89 100 PROGS+=$(QEMU_SYSTEM)
90 101 endif
91   -endif # ARCH = amd64
  102 +endif # ARCH = x86_64
92 103  
93 104 endif # TARGET_ARCH = sparc
94 105 endif # !CONFIG_USER_ONLY
... ... @@ -122,9 +133,9 @@ LDFLAGS+=-Wl,-shared
122 133 endif
123 134 endif
124 135  
125   -ifeq ($(ARCH),amd64)
  136 +ifeq ($(ARCH),x86_64)
126 137 OP_CFLAGS=$(CFLAGS) -falign-functions=0
127   -LDFLAGS+=-Wl,-T,$(SRC_PATH)/amd64.ld
  138 +LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld
128 139 endif
129 140  
130 141 ifeq ($(ARCH),ppc)
... ... @@ -226,6 +237,10 @@ LIBOBJS+=translate-copy.o
226 237 endif
227 238 endif
228 239  
  240 +ifeq ($(TARGET_ARCH), x86_64)
  241 +LIBOBJS+=helper.o helper2.o
  242 +endif
  243 +
229 244 ifeq ($(TARGET_ARCH), ppc)
230 245 LIBOBJS+= op_helper.o helper.o
231 246 endif
... ... @@ -239,7 +254,7 @@ LIBOBJS+=disas.o
239 254 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
240 255 USE_I386_DIS=y
241 256 endif
242   -ifeq ($(findstring amd64, $(TARGET_ARCH) $(ARCH)),amd64)
  257 +ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
243 258 USE_I386_DIS=y
244 259 endif
245 260 ifdef USE_I386_DIS
... ... @@ -297,11 +312,11 @@ audio.o fmodaudio.o: DEFINES := -I$(CONFIG_FMOD_INC) $(DEFINES)
297 312 LIBS += $(CONFIG_FMOD_LIB)
298 313 endif
299 314  
300   -ifeq ($(TARGET_ARCH), i386)
  315 +ifeq ($(TARGET_BASE_ARCH), i386)
301 316 # Hardware support
302 317 VL_OBJS+= ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
303 318 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o
304   -VL_OBJS+= cirrus_vga.o mixeng.o
  319 +VL_OBJS+= cirrus_vga.o mixeng.o apic.o
305 320 endif
306 321 ifeq ($(TARGET_ARCH), ppc)
307 322 VL_OBJS+= ppc.o ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
... ... @@ -376,7 +391,7 @@ op.o: op.c
376 391 helper.o: helper.c
377 392 $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
378 393  
379   -ifeq ($(TARGET_ARCH), i386)
  394 +ifeq ($(TARGET_BASE_ARCH), i386)
380 395 op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h
381 396 endif
382 397  
... ...
configure
... ... @@ -27,7 +27,7 @@ ar=&quot;ar&quot;
27 27 make="make"
28 28 strip="strip"
29 29 cpu=`uname -m`
30   -target_list="i386-user i386 i386-softmmu arm-user armeb-user sparc-user ppc-user ppc-softmmu sparc-softmmu"
  30 +target_list="i386-user i386 i386-softmmu arm-user armeb-user sparc-user ppc-user ppc-softmmu sparc-softmmu x86_64-softmmu"
31 31 case "$cpu" in
32 32 i386|i486|i586|i686|i86pc|BePC)
33 33 cpu="i386"
... ... @@ -63,7 +63,7 @@ case &quot;$cpu&quot; in
63 63 cpu="m68k"
64 64 ;;
65 65 x86_64|amd64)
66   - cpu="amd64"
  66 + cpu="x86_64"
67 67 ;;
68 68 *)
69 69 cpu="unknown"
... ... @@ -383,9 +383,9 @@ echo &quot;EXESUF=$EXESUF&quot; &gt;&gt; $config_mak
383 383 if test "$cpu" = "i386" ; then
384 384 echo "ARCH=i386" >> $config_mak
385 385 echo "#define HOST_I386 1" >> $config_h
386   -elif test "$cpu" = "amd64" ; then
387   - echo "ARCH=amd64" >> $config_mak
388   - echo "#define HOST_AMD64 1" >> $config_h
  386 +elif test "$cpu" = "x86_64" ; then
  387 + echo "ARCH=x86_64" >> $config_mak
  388 + echo "#define HOST_X86_64 1" >> $config_h
389 389 elif test "$cpu" = "armv4b" ; then
390 390 echo "ARCH=arm" >> $config_mak
391 391 echo "#define HOST_ARM 1" >> $config_h
... ... @@ -538,6 +538,11 @@ elif test &quot;$target_cpu&quot; = &quot;ppc&quot; ; then
538 538 echo "TARGET_ARCH=ppc" >> $config_mak
539 539 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
540 540 echo "#define TARGET_PPC 1" >> $config_h
  541 +elif test "$target_cpu" = "x86_64" ; then
  542 + echo "TARGET_ARCH=x86_64" >> $config_mak
  543 + echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
  544 + echo "#define TARGET_I386 1" >> $config_h
  545 + echo "#define TARGET_X86_64 1" >> $config_h
541 546 else
542 547 echo "Unsupported target CPU"
543 548 exit 1
... ...