Skip to contentSkip to conversation

add a directory for para-driver support in unmodified linux.

PATCH New Xiaofeng Ling 1 participant 1 message Sep 5, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add a directory for para-driver support in unmodified linux.

This patch adds a directory for para-driver support in unmodified linux.
The event channel is made to a pci device, the event is delivered by this device.
The build script will create the symbol link to linux-sparse tree for all the front end driver. A prinstine kernel path shall be given in compile.sh.

 unmodified-sparse/Makefile                 |   33 ++++
 unmodified-sparse/README                   |   12 +
 unmodified-sparse/balloon/Makefile         |    2
 unmodified-sparse/blkfront/Makefile        |    8 +
 unmodified-sparse/compile.sh               |    2
 unmodified-sparse/evtchn-pci/Makefile      |   10 +
 unmodified-sparse/evtchn-pci/debuginfo.h   |   56 +++++++
 unmodified-sparse/evtchn-pci/evtchn-pci.c  |  330 
+++++++++++++++++++++++++++++++++++++++++++++++
 unmodified-sparse/evtchn-pci/evtchn-pci.h  |   91 ++++++++++++
 unmodified-sparse/evtchn-pci/evtchn.c      |  119 ++++++++++++++++
 unmodified-sparse/evtchn-pci/xen-support.c |   79 +++++++++++
 unmodified-sparse/include/asm/smp_alt.h    |    6
 unmodified-sparse/mkbuildtree              |   19 ++
 unmodified-sparse/netfront/Makefile        |    8 +
 unmodified-sparse/xenbus/Makefile          |   12 +
 15 files changed, 787 insertions(+)
unmodified-sparse/Makefile new file +33 -0
diff -r 287d36b46fa3 unmodified-sparse/Makefile
@@ -0,0 +1,33 @@
+CONFIG_XEN_EVTCHN_PCI = m
+CONFIG_XEN_BLKDEV_FRONTEND	= m
+CONFIG_XEN_NETDEV_FRONTEND	= m
+
+obj-$(CONFIG_XEN_EVTCHN_PCI)	+= evtchn-pci/
+obj-$(CONFIG_XEN_BLKDEV_FRONTEND)	+= blkfront/
+obj-$(CONFIG_XEN_NETDEV_FRONTEND)	+= netfront/
+obj-m	+= xenbus/
+
+CFLAGS  += -I$(M)/include -I$(M)/evtchn-pci
+
+NOSTDINC_FLAGS  = -nostdinc -iwithprefix include/asm-xen -Iinclude/asm-xen -iwithprefix include
+
+CFLAGS += -DCONFIG_VMX -DCONFIG_VMX_GUEST
+
+CFLAGS += -DCONFIG_XEN_SHADOW_MODE -DCONFIG_XEN_SHADOW_TRANSLATE
+
+CFLAGS += -DCONFIG_XEN_BLKDEV_GRANT -DXEN_EVTCHN_MASK_OPS
+
+CFLAGS += -DCONFIG_XEN_NETDEV_GRANT_RX -DCONFIG_XEN_NETDEV_GRANT_TX
+
+debug:
+	echo $(XEN_DRIVERS_ROOT)
+	echo $(CFLAGS)
+	./compile.sh
+
+clean:
+	find . -name "*.o" |xargs rm -f
+	find . -name "*.ko" |xargs rm -f
+	find . -name "*.mod.c" |xargs rm -f
+	find . -name ".*.cmd" |xargs rm -f
+	rm .tmp_versions -rf
+    
unmodified-sparse/README new file +12 -0
diff -r 287d36b46fa3 unmodified-sparse/README
@@ -0,0 +1,12 @@
+to build xen front driver as modules to unmodified linux kernel
+modify the compile.sh to point to the correct kernel source.
+eg:
+make -C /usr/src/linux-2.6.12 M=$PWD V=1 $*
+then run ./compile.sh
+
+There will three modules: xen-evtchn-pci.ko xen-vbd.ko xen-vnif.ko
+xen-evtchn-pci.ko is the base module, and xen-vbd.ko is for VBD, xen-vnif.ko 
+is for VNIF.
+
+In the configure file, the vbd configration is same as xen-linux.
+                                                                      XF
unmodified-sparse/balloon/Makefile new file +2 -0
diff -r 287d36b46fa3 unmodified-sparse/balloon/Makefile
@@ -0,0 +1,2 @@
+
+obj-m += balloon.o
unmodified-sparse/blkfront/Makefile new file +8 -0
diff -r 287d36b46fa3 unmodified-sparse/blkfront/Makefile
@@ -0,0 +1,8 @@
+
+obj-m	+= xen-vbd.o
+
+NOSTDINC_FLAGS  = -nostdinc -iwithprefix include/asm-xen -Iinclude/asm-xen -iwithprefix include
+NOSTDINC_FLAGS += -I$(M)/include/asm-xen
+
+xen-vbd-objs	:= blkfront.o vbd.o
+
unmodified-sparse/compile.sh new file +2 -0
diff -r 287d36b46fa3 unmodified-sparse/compile.sh
@@ -0,0 +1,2 @@
+./mkbuildtree
+make -C `pwd`../pristine-linux-2.6.12 M=$PWD V=1 $*
unmodified-sparse/evtchn-pci/Makefile new file +10 -0
diff -r 287d36b46fa3 unmodified-sparse/evtchn-pci/Makefile
@@ -0,0 +1,10 @@
+
+EVTCHN=xen-evtchn-pci
+
+obj-m	+= $(EVTCHN).o
+
+NOSTDINC_FLAGS  = -nostdinc -iwithprefix include/asm-xen -Iinclude/asm-xen -iwithprefix include
+NOSTDINC_FLAGS += -I$(M)/include/asm-xen
+
+$(EVTCHN)-objs := evtchn.o ctrl_if.o evtchn-pci.o gnttab.o xen_proc.o xen-support.o 
+
unmodified-sparse/evtchn-pci/debuginfo.h new file +56 -0

56 lines not on this page · raw message

unmodified-sparse/evtchn-pci/evtchn-pci.c new file +330 -0

330 lines not on this page · raw message

unmodified-sparse/evtchn-pci/evtchn-pci.h new file +91 -0

91 lines not on this page · raw message

unmodified-sparse/evtchn-pci/evtchn.c new file +119 -0

119 lines not on this page · raw message

unmodified-sparse/evtchn-pci/xen-support.c new file +79 -0

79 lines not on this page · raw message

unmodified-sparse/include/asm/smp_alt.h new file +6 -0
diff -r 287d36b46fa3 unmodified-sparse/include/asm/smp_alt.h
@@ -0,0 +1,6 @@
+#ifdef CONFIG_SMP
+#define LOCK "lock ; "
+#else
+#define LOCK ""
+#endif
+
unmodified-sparse/mkbuildtree new file +19 -0
diff -r 287d36b46fa3 unmodified-sparse/mkbuildtree
@@ -0,0 +1,19 @@
+C=$PWD
+[ -d include ] || mkdir include
+[ -d include/asm-xen ] || mkdir include/asm-xen
+[ -d include/asm-xen/xen-public ] || mkdir include/asm-xen/xen-public
+lndir -silent ../../../linux-2.6-xen-sparse/include/asm-xen/ include/asm-xen/
+(cd include/asm-xen;ln -sf asm-`uname -i` asm)
+lndir -silent ../../../../xen/include/public include/asm-xen/xen-public
+
+for d in $(find $C/../linux-2.6-xen-sparse/drivers/xen/ -type d -maxdepth 1 | sed -e 1d); do
+    if ! echo $d | egrep -q back; then
+        lndir $d $(basename $d) > /dev/null 2>&1
+    fi
+done
+
+ln -sf $C/../tools/xenstore/xenstored.h xenbus/xenstored.h
+ln -sf $C/../linux-2.6-xen-sparse/arch/xen/kernel/ctrl_if.c evtchn-pci
+ln -sf $C/../linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c evtchn-pci
+ln -sf $C/../linux-2.6-xen-sparse/arch/xen/kernel/xen_proc.c evtchn-pci
+
unmodified-sparse/netfront/Makefile new file +8 -0
diff -r 287d36b46fa3 unmodified-sparse/netfront/Makefile
@@ -0,0 +1,8 @@
+CONFIG_XEN_NETDEV_FRONTEND	= m
+
+obj-$(CONFIG_XEN_NETDEV_FRONTEND)	+= xen-vnif.o
+
+NOSTDINC_FLAGS += -I$(M)/include/asm-xen
+
+xen-vnif-objs	:= netfront.o
+
unmodified-sparse/xenbus/Makefile new file +12 -0
diff -r 287d36b46fa3 unmodified-sparse/xenbus/Makefile
@@ -0,0 +1,12 @@
+obj-m	+= xenbus.o
+
+NOSTDINC_FLAGS += -I$(M)/include/asm-xen
+
+xenbus-objs =
+xenbus-objs += xenbus_comms.o
+xenbus-objs += xenbus_xs.o
+xenbus-objs += xenbus_probe.o 
+
+XEN_TOOLS_DIR := "../tools"
+vpath %.h $(XEN_TOOLS_DIR)
+EXTRA_CFLAGS += -I $(XEN_TOOLS_DIR)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel