Skip to contentSkip to conversation

Enable Front-end drivers for 2.4 kernels

PATCH In review Ben Guthro 1 participant 1 message Dec 19, 2007

lore
Share & tools
lore

Ben Guthro

author
#0 lore raw

PATCH 1/2 Enable Front-end drivers for 2.4 kernels

[PATCH 1/2][PV-on-HVM] Enable Front-end drivers for 2.4 kernels

This patch enables front end drivers to build under Linux 2.4 (RHEL3-U8)

diffstat xen-RHEL3U8-port.patch

b/unmodified_drivers/linux-2.6/balloon/K24build                   |   10
b/unmodified_drivers/linux-2.6/blkfront/K24build                  |    6
b/unmodified_drivers/linux-2.6/compat-include/linux/cpumask.h     |   17
b/unmodified_drivers/linux-2.6/compat-include/linux/device.h      |   13
b/unmodified_drivers/linux-2.6/compat-include/linux/err.h         |    9
b/unmodified_drivers/linux-2.6/compat-include/linux/kthread.h     |    7
b/unmodified_drivers/linux-2.6/compat-include/linux/preempt.h     |    7
b/unmodified_drivers/linux-2.6/compat-include/linux/seqlock.h     |    8
b/unmodified_drivers/linux-2.6/netfront/K24build                  |    8
b/unmodified_drivers/linux-2.6/platform-pci/K24build              |   29
unmodified_drivers/linux-2.6/Makefile                             |   17
unmodified_drivers/linux-2.6/balloon/Makefile                     |    7
unmodified_drivers/linux-2.6/blkfront/Makefile                    |    7
unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h |  384 ++++++++
unmodified_drivers/linux-2.6/mkbuildtree                          |   16
unmodified_drivers/linux-2.6/netfront/Makefile                    |    7
unmodified_drivers/linux-2.6/overrides.mk                         |    7
unmodified_drivers/linux-2.6/platform-pci/Makefile                |    7
unmodified_drivers/linux-2.6/platform-pci/evtchn.c                |    4
unmodified_drivers/linux-2.6/platform-pci/platform-compat.c       |  453 +++++++++-
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c          |    6
unmodified_drivers/linux-2.6/platform-pci/xen_support.c           |    4
22 files changed, 1007 insertions(+), 26 deletions(-)

[PATCH 1/2][PV-on-HVM] Enable Front-end drivers for 2.4 kernels

This patch enables front end drivers to build under Linux 2.4 (RHEL3-U8)

unmodified_drivers/linux-2.6/Makefile +13 -4
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/Makefile
@@ -1,6 +1,15 @@ include $(M)/overrides.mk
 include $(M)/overrides.mk
 
-obj-m += platform-pci/
-obj-m += balloon/
-obj-m += blkfront/
-obj-m += netfront/
+ifeq ($(VERSION).$(PATCHLEVEL),2.6)
+	obj-m += platform-pci/
+	obj-m += balloon/
+	obj-m += blkfront/
+	obj-m += netfront/
+endif
+
+ifeq ($(VERSION).$(PATCHLEVEL),2.4)
+	mod-subdirs := platform-pci balloon blkfront netfront
+	subdir-y := platform-pci balloon blkfront netfront
+
+	include $(TOPDIR)/Rules.make
+endif
unmodified_drivers/linux-2.6/balloon/K24build new file +10 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/balloon/K24build
@@ -0,0 +1,10 @@
+EXTRA_CFLAGS += -I$(M)/platform-pci
+
+O_TARGET := xen-balloon.o
+
+export-objs := balloon.o
+
+obj-y := balloon.o
+obj-m := $(O_TARGET)
+
+include $(TOPDIR)/Rules.make
unmodified_drivers/linux-2.6/balloon/Makefile +6 -1
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/balloon/Makefile
@@ -1,3 +1,8 @@ ifneq ($(KERNELRELEASE),)
-ifneq ($(KERNELRELEASE),)
+ifeq ($(VERSION).$(PATCHLEVEL),2.6)
 include $(src)/Kbuild
 endif
+
+ifeq ($(VERSION).$(PATCHLEVEL),2.4)
+include $(M)/overrides.mk
+include K24build
+endif
unmodified_drivers/linux-2.6/blkfront/K24build new file +6 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/blkfront/K24build
@@ -0,0 +1,6 @@
+O_TARGET := xen-vbd.o
+
+obj-y := blkfront.o vbd.o
+obj-m := $(O_TARGET)
+
+include $(TOPDIR)/Rules.make
unmodified_drivers/linux-2.6/blkfront/Makefile +6 -1
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/blkfront/Makefile
@@ -1,3 +1,8 @@ ifneq ($(KERNELRELEASE),)
-ifneq ($(KERNELRELEASE),)
+ifeq ($(VERSION).$(PATCHLEVEL),2.6)
 include $(src)/Kbuild
 endif
+
+ifeq ($(VERSION).$(PATCHLEVEL),2.4)
+include $(M)/overrides.mk
+include K24build
+endif
unmodified_drivers/linux-2.6/compat-include/linux/cpumask.h new file +17 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/compat-include/linux/cpumask.h
@@ -0,0 +1,17 @@
+/*
+ * Dummy cpumask.h header for pre 2.6.x kernels.
+ */
+#ifndef __LINUX_CPUMASK_H
+#define __LINUX_CPUMASK_H
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#error "This version of Linux should not need this version of linux/cpumask.h."
+#endif
+
+#include <linux/kernel.h>
+
+#include <xen/kerncompat.h>
+
+#endif /* __LINUX_CPUMASK__H */
unmodified_drivers/linux-2.6/compat-include/linux/device.h new file +13 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/compat-include/linux/device.h
@@ -0,0 +1,13 @@
+/*
+ * Dummy device.h header for pre 2.6.x kernels.
+ */
+#ifndef _DEVICE_H_
+#define _DEVICE_H_
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#error "This version of Linux should not need this version of linux/device.h."
+#endif
+
+#include <xen/kerncompat.h>
+
+#endif /* _DEVICE_H_ */
unmodified_drivers/linux-2.6/compat-include/linux/err.h new file +9 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/compat-include/linux/err.h
@@ -0,0 +1,9 @@
+/*
+ * Dummy err.h header for pre 2.6.x kernels.
+ */
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#error "This version of Linux should not need this version of linux/err.h."
+#endif
unmodified_drivers/linux-2.6/compat-include/linux/kthread.h new file +7 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/compat-include/linux/kthread.h
@@ -0,0 +1,7 @@
+/*
+ * Dummy kthread.h header for pre 2.6.x kernels.
+ */
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#error "This version of Linux should not need this version of linux/kthread.h."
+#endif
unmodified_drivers/linux-2.6/compat-include/linux/preempt.h new file +7 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/compat-include/linux/preempt.h
@@ -0,0 +1,7 @@
+/*
+ * Dummy preempt.h header for pre 2.6.x kernels.
+ */
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#error "This version of Linux should not need this version of linux/preempt.h."
+#endif
unmodified_drivers/linux-2.6/compat-include/linux/seqlock.h new file +8 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/compat-include/linux/seqlock.h
@@ -0,0 +1,8 @@
+#ifndef _LINUX_SEQLOCK_H
+#define _LINUX_SEQLOCK_H
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#error "This version of Linux should not need compat linux/seqlock.h"
+#endif
+
+#endif
unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h +377 -7

415 lines not on this page · raw message

unmodified_drivers/linux-2.6/mkbuildtree +16 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/mkbuildtree
@@ -35,6 +35,22 @@ ln -sf ${XL}/drivers/xen/core/features.c
 ln -sf ${XL}/drivers/xen/core/features.c platform-pci
 ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus
 ln -sf ${XL}/drivers/xen/core/reboot.c platform-pci
+
+# The export-objs target for the 2.4 build of platform-pci requires that sources
+# listed in that target appear in the same tree in which the module is being
+# built.  That is, references which use relative paths to get to xenbus_*.c
+# (i.e. xenbus/xenbus_xs.c, etc.) do not work under kernel 2.4.  To keep things
+# clean, we are setting up symbolic links from platform-pci to all files needed
+# from under xenbus.  This includes xenbus_xs.c, xenbus_probe.c, xenbus_client.c,
+# xen_proc.c, xenbus_comms.c and xenbus_dev.c
+if [ "$2" = "RHEL3-U8-32" ] ; then
+    ln -sf ${XL}/drivers/xen/xenbus/xenbus_xs.c platform-pci
+    ln -sf ${XL}/drivers/xen/xenbus/xenbus_probe.c platform-pci
+    ln -sf ${XL}/drivers/xen/xenbus/xenbus_client.c platform-pci
+    ln -sf ${XL}/drivers/xen/core/xen_proc.c platform-pci
+    ln -sf ${XL}/drivers/xen/xenbus/xenbus_comms.c platform-pci
+    ln -sf ${XL}/drivers/xen/xenbus/xenbus_dev.c platform-pci
+fi
 
 mkdir -p include/asm include/xen
 
unmodified_drivers/linux-2.6/netfront/K24build new file +8 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/netfront/K24build
@@ -0,0 +1,8 @@
+O_TARGET := xen-vnif.o
+
+export-objs := netfront.o accel.o
+
+obj-y := netfront.o accel.o
+obj-m := $(O_TARGET)
+
+include $(TOPDIR)/Rules.make
unmodified_drivers/linux-2.6/netfront/Makefile +6 -1
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/netfront/Makefile
@@ -1,3 +1,8 @@ ifneq ($(KERNELRELEASE),)
-ifneq ($(KERNELRELEASE),)
+ifeq ($(VERSION).$(PATCHLEVEL),2.6)
 include $(src)/Kbuild
 endif
+
+ifeq ($(VERSION).$(PATCHLEVEL),2.4)
+include $(M)/overrides.mk
+include K24build
+endif
unmodified_drivers/linux-2.6/overrides.mk +6 -1
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/overrides.mk
@@ -11,4 +11,9 @@ ifeq ($(ARCH),ia64)
   EXTRA_CFLAGS += -DCONFIG_VMX_GUEST
 endif
 
-EXTRA_CFLAGS += -include $(objtree)/include/linux/autoconf.h
+ifeq ($(VERSION).$(PATCHLEVEL),2.4)
+srctree := $(TOPDIR)
+export srctree
+endif
+
+EXTRA_CFLAGS += -include $(srctree)/include/linux/autoconf.h
unmodified_drivers/linux-2.6/platform-pci/K24build new file +29 -0
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/platform-pci/K24build
@@ -0,0 +1,29 @@
+include $(M)/overrides.mk
+
+O_TARGET := xen-platform-pci.o
+
+EXTRA_CFLAGS += -I$(M)/platform-pci -I$(M)/xenbus
+
+export-objs := evtchn.o platform-pci.o gnttab.o xen_support.o
+export-objs += features.o platform-compat.o xenbus_xs.o xenbus_probe.o
+export-objs += xenbus_client.o xen_proc.o
+
+obj-y := evtchn.o platform-pci.o gnttab.o xen_support.o
+obj-y += features.o platform-compat.o
+obj-y += reboot.o machine_reboot.o
+
+obj-y += xenbus_comms.o
+obj-y += xenbus_xs.o
+obj-y += xenbus_probe.o
+obj-y += xenbus_dev.o
+obj-y += xenbus_client.o
+obj-y += xen_proc.o
+
+# Can we do better ?
+ifeq ($(ARCH),ia64)
+  obj-y += xcom_mini.o xencomm.o
+endif
+
+obj-m := $(O_TARGET)
+
+include $(TOPDIR)/Rules.make
unmodified_drivers/linux-2.6/platform-pci/Makefile +6 -1
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/platform-pci/Makefile
@@ -1,3 +1,8 @@ ifneq ($(KERNELRELEASE),)
-ifneq ($(KERNELRELEASE),)
+ifeq ($(VERSION).$(PATCHLEVEL),2.6)
 include $(src)/Kbuild
 endif
+
+ifeq ($(VERSION).$(PATCHLEVEL),2.4)
+include $(M)/overrides.mk
+include K24build
+endif
unmodified_drivers/linux-2.6/platform-pci/evtchn.c +1 -3
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/platform-pci/evtchn.c
@@ -36,9 +36,7 @@
 #include <xen/features.h>
 #include "platform-pci.h"
 
-#ifdef HAVE_XEN_PLATFORM_COMPAT_H
-#include <xen/platform-compat.h>
-#endif
+#include <xen/kerncompat.h>
 
 void *shared_info_area;
 
unmodified_drivers/linux-2.6/platform-pci/platform-compat.c +452 -1

462 lines not on this page · raw message

unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +3 -3
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -30,6 +30,7 @@
 #include <linux/interrupt.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
+#include <linux/kthread.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -40,15 +41,14 @@
 #include <xen/interface/hvm/params.h>
 #include <xen/features.h>
 #include <xen/evtchn.h>
+#include <xen/xen_proc.h>
 #ifdef __ia64__
 #include <asm/xen/xencomm.h>
 #endif
 
 #include "platform-pci.h"
 
-#ifdef HAVE_XEN_PLATFORM_COMPAT_H
-#include <xen/platform-compat.h>
-#endif
+#include <xen/kerncompat.h>
 
 #define DRV_NAME    "xen-platform-pci"
 #define DRV_VERSION "0.10"
unmodified_drivers/linux-2.6/platform-pci/xen_support.c +1 -3
diff -r 6349a4bceff8 unmodified_drivers/linux-2.6/platform-pci/xen_support.c
@@ -26,9 +26,7 @@
 #include <asm/hypervisor.h>
 #include "platform-pci.h"
 
-#ifdef HAVE_XEN_PLATFORM_COMPAT_H
-#include <xen/platform-compat.h>
-#endif
+#include <xen/kerncompat.h>
 
 #if defined (__ia64__)
 unsigned long __hypercall(unsigned long a1, unsigned long a2,

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