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