WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] Arch dependent tools/libxc?

To: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Arch dependent tools/libxc?
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Wed, 18 May 2005 20:18:55 +0800
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 18 May 2005 12:18:32 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcVbW2ukBKdAR9XHQya5T9SsCMzvQQAHN71AAAmNt3A=
Thread-topic: [Xen-devel] Arch dependent tools/libxc?
Thanks Ian, and attached is the patch to do that change. I'm not expert
in Makefile, so feel free to pin me for better solution. :-)
=============================
        Libxc is the part coupling with platform context most tightly,
with some files which should be made arch dependent. Obvious example is
xc_***_build.c, which should behave upon vcpu_guest_context_t defined by
different platform.

        Following patch is trying to move those files into arch
dependent directory. I only addressed 7 files by far, because
compilation succeeds on IPF simply after solving them. Since there's no
distinct boundary between them and other files, I'm lazy to add another
Makefile under arch-dep directory. Also no change to compile option
since they works fine on x86 and IPF currentlys.

        To reduce the size of patch, a trick is used to move files when
first compilation. After that, you can simply remove 8 lines leading by
"TEMP" comment. IPF related changes will be sent to Dan later.

Signed-off-by Kevin Tian (Kevin.tian@xxxxxxxxx)

--- trunk.org/tools/libxc/Makefile      2005-05-09 16:01:18.000000000
+0800
+++ trunk/tools/libxc/Makefile  2005-05-18 20:35:01.000000000 +0800
@@ -21,16 +21,13 @@ SRCS     += xc_domain.c
 SRCS     += xc_evtchn.c
 SRCS     += xc_gnttab.c
 SRCS     += xc_io.c
-SRCS     += xc_linux_build.c
-SRCS     += xc_plan9_build.c
-SRCS     += xc_linux_restore.c
-SRCS     += xc_linux_save.c
 SRCS     += xc_misc.c
 SRCS     += xc_physdev.c
 SRCS     += xc_private.c
-SRCS     += xc_ptrace.c
-SRCS     += xc_vmx_build.c
 
+SRCS     += $(wildcard $(COMPILE_ARCH)/*.c)
+
+vpath %.c      $(COMPILE_ARCH)
 CFLAGS   += -Wall
 CFLAGS   += -Werror
 CFLAGS   += -O3
@@ -67,6 +64,15 @@ mk-symlinks:
           ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
        ( cd xen/linux >/dev/null ; \
          ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h .
)
+#TEMP: Please delete following lines after applying the patch
+       [ -e $(COMPILE_ARCH) ] || mkdir -p $(COMPILE_ARCH)/
+       [ ! -e xc_linux_build.c ] || mv xc_linux_build.c
$(COMPILE_ARCH)/
+       [ ! -e xc_plan9_build.c ] || mv xc_plan9_build.c
$(COMPILE_ARCH)/
+       [ ! -e xc_vmx_build.c ] || mv xc_vmx_build.c $(COMPILE_ARCH)/
+       [ ! -e xc_linux_save.c ] || mv xc_linux_save.c $(COMPILE_ARCH)/
+       [ ! -e xc_linux_restore.c ] || mv xc_linux_restore.c
$(COMPILE_ARCH)/
+       [ ! -e xc_ptrace.c ] || mv xc_ptrace.c $(COMPILE_ARCH)/
+       [ ! -e linux_boot_params.h ] || mv linux_boot_params.h
$(COMPILE_ARCH)/
 
 install: build
        [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR)
$(DESTDIR)/usr/$(LIBDIR)
@@ -83,7 +89,7 @@ TAGS:
        etags -t $(SRCS) *.h
 
 clean:
-       rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
+       rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
$(COMPILE_ARCH)/*.o $(COMPILE_ARCH)/*.opic
 
 rpm: build
        rm -rf staging

Thanks,
Kevin
>-----Original Message-----
>From: Ian Pratt [mailto:m+Ian.Pratt@xxxxxxxxxxxx]
>Sent: Wednesday, May 18, 2005 3:08 PM
>To: Tian, Kevin; xen-devel@xxxxxxxxxxxxxxxxxxx
>Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx; ian.pratt@xxxxxxxxxxxx
>Subject: RE: [Xen-devel] Arch dependent tools/libxc?
>
>
>> Hi, list,
>>      When trying to add support for multiple domains on
>> IPF/VTI, immediately we realized current tools/libxc too x86
>> specific, like xc_linux_build.c, xc_linux_save.c, etc. which
>> are always compiled assumed upon x86 vcpu_guest_context_t.
>> Ideally they should only be compiled upon specific platform.
>>
>>      One solution is to add bunch of boring "ifdef
>> __x86_32... ifdef __ia64__" in Makefile, which however gonna
>> pollute many places. Since tools/libxc is the place coupled
>> with arch context most tightly, a better option may be to
>> move those files into arch dependent directory like
>> tools/libxc/{x86, ia64, etc}:
>> Xc_linux_build.c
>> Xc_plan9_build.c
>> Xc_vmx_build.c
>> Xc_linux_save.c
>> Xc_linux_restore.c
>> Xc_ptrace.c
>> Xc_ptrace_core.c
>> And some header files like linux_boot_params.h
>
>Yep, this needs to happen.
>
>Ian

Attachment: patch_libxc_arch_dep
Description: patch_libxc_arch_dep

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>