ia64/xen-unstable

view tools/ioemu/target-i386-dm/Makefile @ 7720:b2ea26d2099a

Support recent change moving virtual IOAPIC model into Xen for
ia64/VTI. Now ia64/vti will create links to arch/x86/dm/vmx_vioapic.c
and include/x86/vmx_vlapic.h.

Firstly, a small change to common virtual IOAPIC model to be used by
both sides. Also some compilation fix to tools is included in first
one. Secondly, there are ia64-specific changes to hook to common
IOAPIC model.

Based on this patch upon latest xen-ia64-unstable tip, we can see
multiple domains working again on XEN/IA64, including both domU and
VTI domain simultaneously in run-time.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
Signed-off-by Anthony Xu <Anthony.xu@intel.com>
Signed-off-by Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by Eddie Dong <eddie.dong@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Nov 09 14:53:12 2005 +0100 (2005-11-09)
parents 65c3b9382caa
children 74737286e9f5
line source
1 XEN_ROOT=../../..
2 include $(XEN_ROOT)/tools/Rules.mk
3 include config.mak
4 override TARGET_ARCH=i386
6 INSTALL_DIR := $(DESTDIR)/usr/$(LIBDIR)/xen/bin
7 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH)
8 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
9 DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH)
10 DEFINES+= -I$(XEN_ROOT)/tools/libxc
11 ifdef CONFIG_USER_ONLY
12 VPATH+=:$(SRC_PATH)/linux-user
13 DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
14 endif
15 CFLAGS=-Wall -O2 -g -fno-strict-aliasing
16 LDFLAGS=-g
17 LIBS=
18 HELPER_CFLAGS=$(CFLAGS)
19 DYNGEN=../dyngen$(EXESUF)
20 # user emulator name
21 QEMU_USER=qemu-$(TARGET_ARCH)
22 # system emulator name
23 ifdef CONFIG_SOFTMMU
24 ifeq ($(TARGET_ARCH), i386)
25 QEMU_SYSTEM=qemu$(EXESUF)
26 else
27 QEMU_SYSTEM=qemu-system-$(TARGET_ARCH)$(EXESUF)
28 endif
29 else
30 QEMU_SYSTEM=qemu-fast
31 endif
33 QEMU_SYSTEM=qemu-dm
34 PROGS=$(QEMU_SYSTEM)
36 ifdef CONFIG_USER_ONLY
37 PROGS=$(QEMU_USER)
38 else
39 ifeq ($(TARGET_ARCH), i386)
41 ifeq ($(ARCH), i386)
42 PROGS+=$(QEMU_SYSTEM)
43 ifndef CONFIG_SOFTMMU
44 CONFIG_STATIC=y
45 endif
46 else
47 # the system emulator using soft mmu is portable
48 ifdef CONFIG_SOFTMMU
49 PROGS+=$(QEMU_SYSTEM)
50 endif
51 endif # ARCH != i386
53 endif # TARGET_ARCH = i386
55 ifeq ($(TARGET_ARCH), ppc)
57 ifeq ($(ARCH), ppc)
58 PROGS+=$(QEMU_SYSTEM)
59 endif
61 ifeq ($(ARCH), i386)
62 ifdef CONFIG_SOFTMMU
63 PROGS+=$(QEMU_SYSTEM)
64 endif
65 endif # ARCH = i386
67 ifeq ($(ARCH), amd64)
68 ifdef CONFIG_SOFTMMU
69 PROGS+=$(QEMU_SYSTEM)
70 endif
71 endif # ARCH = amd64
73 endif # TARGET_ARCH = ppc
75 ifeq ($(TARGET_ARCH), sparc)
77 ifeq ($(ARCH), ppc)
78 PROGS+=$(QEMU_SYSTEM)
79 endif
81 ifeq ($(ARCH), i386)
82 ifdef CONFIG_SOFTMMU
83 PROGS+=$(QEMU_SYSTEM)
84 endif
85 endif # ARCH = i386
87 ifeq ($(ARCH), amd64)
88 ifdef CONFIG_SOFTMMU
89 PROGS+=$(QEMU_SYSTEM)
90 endif
91 endif # ARCH = amd64
93 endif # TARGET_ARCH = sparc
94 endif # !CONFIG_USER_ONLY
96 ifdef CONFIG_STATIC
97 LDFLAGS+=-static
98 endif
100 ifeq ($(ARCH),i386)
101 CFLAGS+=-fomit-frame-pointer
102 OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
103 ifeq ($(HAVE_GCC3_OPTIONS),yes)
104 OP_CFLAGS+= -falign-functions=0 -fno-gcse
105 else
106 OP_CFLAGS+= -malign-functions=0
107 endif
109 ifdef TARGET_GPROF
110 USE_I386_LD=y
111 endif
112 ifdef CONFIG_STATIC
113 USE_I386_LD=y
114 endif
115 ifdef USE_I386_LD
116 LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld
117 else
118 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
119 # that the kernel ELF loader considers as an executable. I think this
120 # is the simplest way to make it self virtualizable!
121 LDFLAGS+=-Wl,-shared
122 endif
123 endif
125 ifeq ($(ARCH),amd64)
126 OP_CFLAGS=$(CFLAGS) -falign-functions=0
127 LDFLAGS+=-Wl,-T,$(SRC_PATH)/amd64.ld
128 endif
130 ifeq ($(ARCH),ppc)
131 CFLAGS+= -D__powerpc__
132 OP_CFLAGS=$(CFLAGS)
133 LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld
134 endif
136 ifeq ($(ARCH),s390)
137 OP_CFLAGS=$(CFLAGS)
138 LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld
139 endif
141 ifeq ($(ARCH),sparc)
142 CFLAGS+=-m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
143 LDFLAGS+=-m32
144 OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
145 HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
146 # -static is used to avoid g1/g3 usage by the dynamic linker
147 LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc.ld -static
148 endif
150 ifeq ($(ARCH),sparc64)
151 CFLAGS+=-m64 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
152 LDFLAGS+=-m64
153 OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
154 endif
156 ifeq ($(ARCH),alpha)
157 # -msmall-data is not used because we want two-instruction relocations
158 # for the constant constructions
159 OP_CFLAGS=-Wall -O2 -g
160 # Ensure there's only a single GP
161 CFLAGS += -msmall-data
162 LDFLAGS+=-Wl,-T,$(SRC_PATH)/alpha.ld
163 endif
165 ifeq ($(ARCH),ia64)
166 OP_CFLAGS=$(CFLAGS)
167 endif
169 ifeq ($(ARCH),arm)
170 OP_CFLAGS=$(CFLAGS) -mno-sched-prolog
171 LDFLAGS+=-Wl,-T,$(SRC_PATH)/arm.ld
172 endif
174 ifeq ($(ARCH),m68k)
175 OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer
176 LDFLAGS+=-Wl,-T,m68k.ld
177 endif
179 ifeq ($(HAVE_GCC3_OPTIONS),yes)
180 # very important to generate a return at the end of every operation
181 OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
182 endif
184 ifeq ($(CONFIG_DARWIN),yes)
185 OP_CFLAGS+= -mdynamic-no-pic
186 endif
188 #########################################################
190 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
191 LIBS+=-lm -L../../libxc -lxenctrl -lxenguest
192 ifndef CONFIG_USER_ONLY
193 LIBS+=-lz
194 endif
195 ifdef CONFIG_WIN32
196 LIBS+=-lwinmm -lws2_32 -liphlpapi
197 endif
199 # profiling code
200 ifdef TARGET_GPROF
201 LDFLAGS+=-p
202 main.o: CFLAGS+=-p
203 endif
205 OBJS= elfload.o main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o
206 ifeq ($(TARGET_ARCH), i386)
207 OBJS+= vm86.o
208 endif
209 ifeq ($(TARGET_ARCH), arm)
210 OBJS+=nwfpe/softfloat.o nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
211 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
212 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o
213 endif
214 SRCS:= $(OBJS:.o=.c)
215 OBJS+= libqemu.a
217 # cpu emulator library
218 LIBOBJS=
220 ifeq ($(TARGET_ARCH), i386)
221 LIBOBJS+= helper2.o
222 ifeq ($(ARCH), i386)
223 LIBOBJS+=translate-copy.o
224 endif
225 endif
227 ifeq ($(TARGET_ARCH), ppc)
228 LIBOBJS+= op_helper.o helper.o
229 endif
231 ifeq ($(TARGET_ARCH), sparc)
232 LIBOBJS+= op_helper.o helper.o
233 endif
235 all: $(PROGS)
237 $(QEMU_USER): $(OBJS)
238 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
239 ifeq ($(ARCH),alpha)
240 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
241 # the address space (31 bit so sign extending doesn't matter)
242 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
243 endif
245 # must use static linking to avoid leaving stuff in virtual address space
246 VL_OBJS=vl.o exec.o monitor.o osdep.o block.o readline.o pci.o console.o
247 VL_OBJS+=block-cow.o block-qcow.o block-vmdk.o block-cloop.o aes.o
248 #VL_OBJS+= block-cloop.o
250 SOUND_HW = sb16.o
251 AUDIODRV = audio.o noaudio.o wavaudio.o
252 ifdef CONFIG_SDL
253 AUDIODRV += sdlaudio.o
254 endif
255 ifdef CONFIG_OSS
256 AUDIODRV += ossaudio.o
257 endif
259 pc.o: DEFINES := -DUSE_SB16 $(DEFINES)
261 ifdef CONFIG_ADLIB
262 SOUND_HW += fmopl.o adlib.o
263 endif
265 ifdef CONFIG_FMOD
266 AUDIODRV += fmodaudio.o
267 audio.o fmodaudio.o: DEFINES := -I$(CONFIG_FMOD_INC) $(DEFINES)
268 LIBS += $(CONFIG_FMOD_LIB)
269 endif
271 # Hardware support
272 VL_OBJS+= ide.o ne2000.o pckbd.o vga.o dma.o
273 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259_stub.o i8254.o pc.o port-e9.o
274 VL_OBJS+= cirrus_vga.o pcnet.o
276 ifeq ($(TARGET_ARCH), ppc)
277 VL_OBJS+= ppc.o ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
278 VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
279 VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o mixeng.o
280 endif
281 ifeq ($(TARGET_ARCH), sparc)
282 VL_OBJS+= sun4m.o tcx.o lance.o iommu.o sched.o m48t08.o magic-load.o timer.o
283 endif
284 ifdef CONFIG_GDBSTUB
285 VL_OBJS+=gdbstub.o
286 endif
287 ifdef CONFIG_VNC
288 VL_OBJS+=vnc.o
289 endif
290 ifdef CONFIG_SDL
291 VL_OBJS+=sdl.o
292 endif
293 ifdef CONFIG_SLIRP
294 DEFINES+=-I$(SRC_PATH)/slirp
295 SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
296 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
297 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
298 VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
299 endif
301 VL_LDFLAGS=
302 # specific flags are needed for non soft mmu emulator
303 ifdef CONFIG_STATIC
304 VL_LDFLAGS+=-static
305 endif
306 ifndef CONFIG_DARWIN
307 ifndef CONFIG_WIN32
308 VL_LIBS=-lutil
309 endif
310 endif
312 $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
313 $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS) -lpthread
315 vnc.o: vnc.c keyboard_rdesktop.c
316 $(CC) $(CFLAGS) $(DEFINES) $(VNC_CFLAGS) -c -o $@ $<
318 sdl.o: sdl.c keyboard_rdesktop.c
319 $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
321 sdlaudio.o: sdlaudio.c
322 $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
324 depend: $(SRCS)
325 $(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend
327 # libqemu
329 libqemu.a: $(LIBOBJS)
330 rm -f $@
331 $(AR) rcs $@ $(LIBOBJS)
333 translate.o: translate.c gen-op.h opc.h cpu.h
335 translate-all.o: translate-all.c op.h opc.h cpu.h
337 op.h: op.o $(DYNGEN)
338 $(DYNGEN) -o $@ $<
340 opc.h: op.o $(DYNGEN)
341 $(DYNGEN) -c -o $@ $<
343 gen-op.h: op.o $(DYNGEN)
344 $(DYNGEN) -g -o $@ $<
346 op.o: op.c
347 $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $<
349 helper.o: helper.c
350 $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
352 ifeq ($(TARGET_ARCH), i386)
353 op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h
354 endif
356 ifeq ($(TARGET_ARCH), arm)
357 op.o: op.c op_template.h
358 endif
360 ifeq ($(TARGET_ARCH), sparc)
361 op.o: op.c op_template.h op_mem.h
362 endif
364 ifeq ($(TARGET_ARCH), ppc)
365 op.o: op.c op_template.h op_mem.h
366 op_helper.o: op_helper_mem.h
367 endif
369 mixeng.o: mixeng.c mixeng.h mixeng_template.h
371 %.o: %.c
372 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
374 %.o: %.S
375 $(CC) $(DEFINES) -c -o $@ $<
377 clean:
378 rm -rf *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe slirp
380 distclean:
381 rm -rf *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe slirp
383 install: all
384 if [ ! -d $(INSTALL_DIR) ];then mkdir -p $(INSTALL_DIR);fi
385 if [ ! -d $(DESTDIR)$(configdir) ];then mkdir -p $(DESTDIR)$(configdir);fi
386 install -m 755 -s $(PROGS) "$(INSTALL_DIR)"
387 install -m 755 qemu-dm.debug "$(INSTALL_DIR)"
388 install -m 755 qemu-ifup "$(DESTDIR)$(configdir)"
389 ifneq ($(wildcard .depend),)
390 include .depend
391 endif