]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
minios: add CONFIG_XC conditional
authorMatthew Fioravante <matthew.fioravante@jhuapl.edu>
Mon, 8 Oct 2012 13:36:31 +0000 (14:36 +0100)
committerMatthew Fioravante <matthew.fioravante@jhuapl.edu>
Mon, 8 Oct 2012 13:36:31 +0000 (14:36 +0100)
This patch adds a CONFIG_XC option to mini-os, to allow conditional
support for libxc for mini-os domains.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Makefile
lib/sys.c

index c425f763f937340d51262304ab288c61c0714001..2422db384c11df776120e052650f19bdd73ea31c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@ CONFIG_FBFRONT ?= y
 CONFIG_KBDFRONT ?= y
 CONFIG_CONSFRONT ?= y
 CONFIG_XENBUS ?= y
+CONFIG_XC ?=y
 CONFIG_LWIP ?= $(lwip)
 
 # Export config items as compiler directives
@@ -144,7 +145,9 @@ endif
 OBJS := $(filter-out $(OBJ_DIR)/lwip%.o $(LWO), $(OBJS))
 
 ifeq ($(libc),y)
+ifeq ($(CONFIG_XC),y)
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(XEN_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
+endif
 APP_LDLIBS += -lpci
 APP_LDLIBS += -lz
 APP_LDLIBS += -lm
index a7d35d689ef142d0a01502b5439fb628b5a38b19..3172d2a60f659a50184b0caf88519b40ff35704b 100644 (file)
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -359,6 +359,7 @@ int close(int fd)
            return res;
        }
 #endif
+#ifdef CONFIG_XC
        case FTYPE_XC:
            minios_interface_close_fd(fd);
            return 0;
@@ -368,6 +369,7 @@ int close(int fd)
        case FTYPE_GNTMAP:
            minios_gnttab_close_fd(fd);
            return 0;
+#endif
 #ifdef CONFIG_NETFRONT
        case FTYPE_TAP:
            shutdown_netfront(files[fd].tap.dev);
@@ -1153,10 +1155,13 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset
 
     if (fd == -1)
         return map_zero(n, 1);
+#ifdef CONFIG_XC
     else if (files[fd].type == FTYPE_XC) {
         unsigned long zero = 0;
         return map_frames_ex(&zero, n, 0, 0, 1, DOMID_SELF, NULL, 0);
-    } else if (files[fd].type == FTYPE_MEM) {
+    }
+#endif
+    else if (files[fd].type == FTYPE_MEM) {
         unsigned long first_mfn = offset >> PAGE_SHIFT;
         return map_frames_ex(&first_mfn, n, 0, 1, 1, DOMID_IO, NULL, _PAGE_PRESENT|_PAGE_RW);
     } else ASSERT(0);