# HG changeset patch # User Ian Campbell # Date Wed Oct 25 13:58:30 2006 +0100 # Node ID 206e20b7b54e09394ed161006439ee2b75ecee5e # parent: db23596992f9388fb776a4518ae638b22ee7c8c2 PV-on-HVM: Add infrastructure for a compatibility shim in order to support PV-on-HVM drivers for older kernel releases. The compatability code is included in the xen-platform-pci module since this module underpins all the others. Signed-off-by: Ian Campbell Signed-off-by: K. Y. Srinivasan Signed-off-by: Tsunehisa Doi --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Wed Oct 25 13:58:30 2006 +0100 @@ -48,6 +48,10 @@ #include #include +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + #define BLKIF_STATE_DISCONNECTED 0 #define BLKIF_STATE_CONNECTED 1 #define BLKIF_STATE_SUSPENDED 2 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed Oct 25 13:58:30 2006 +0100 @@ -35,6 +35,10 @@ #include "block.h" #include #include + +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif #define BLKIF_MAJOR(dev) ((dev)>>8) #define BLKIF_MINOR(dev) ((dev) & 0xff) --- a/linux-2.6-xen-sparse/drivers/xen/core/features.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/core/features.c Wed Oct 25 13:58:30 2006 +0100 @@ -10,6 +10,10 @@ #include #include #include + +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif u8 xen_features[XENFEAT_NR_SUBMAPS * 32] __read_mostly; /* Not a GPL symbol: used in ubiquitous macros, so too restrictive. */ --- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c Wed Oct 25 13:58:30 2006 +0100 @@ -44,6 +44,10 @@ #include #include +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + /* External tools reserve first few grant table entries. */ #define NR_RESERVED_ENTRIES 8 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Wed Oct 25 13:58:30 2006 +0100 @@ -64,6 +64,10 @@ #include #include +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + /* * Mutually-exclusive module options to select receive data path: * rx_copy : Packets are copied by network backend into local memory --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c Wed Oct 25 13:58:30 2006 +0100 @@ -34,6 +34,10 @@ #include #include #include + +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif /* xenbus_probe.c */ extern char *kasprintf(const char *fmt, ...); --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c Wed Oct 25 13:58:30 2006 +0100 @@ -39,6 +39,10 @@ #include #include "xenbus_comms.h" +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + static int xenbus_irq; extern void xenbus_probe(void *); --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c Wed Oct 25 13:58:30 2006 +0100 @@ -49,6 +49,10 @@ #include #include #include + +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif struct xenbus_dev_transaction { struct list_head list; --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 @@ -58,6 +58,10 @@ #include "xenbus_comms.h" #include "xenbus_probe.h" +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + int xen_store_evtchn; struct xenstore_domain_interface *xen_store_interface; static unsigned long xen_store_mfn; --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Wed Oct 25 13:58:30 2006 +0100 @@ -47,6 +47,10 @@ #include #include "xenbus_comms.h" +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + /* xenbus_probe.c */ extern char *kasprintf(const char *fmt, ...); --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/synch_bitops.h Wed Oct 25 13:58:30 2006 +0100 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/synch_bitops.h Wed Oct 25 13:58:30 2006 +0100 @@ -8,6 +8,10 @@ */ #include + +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif #define ADDR (*(volatile long *) addr) --- a/unmodified_drivers/linux-2.6/overrides.mk Wed Oct 25 13:58:30 2006 +0100 +++ b/unmodified_drivers/linux-2.6/overrides.mk Wed Oct 25 13:58:30 2006 +0100 @@ -9,4 +9,4 @@ EXTRA_CFLAGS += -DCONFIG_XEN_BLKDEV_GRAN EXTRA_CFLAGS += -DCONFIG_XEN_BLKDEV_GRANT -DXEN_EVTCHN_MASK_OPS EXTRA_CFLAGS += -DCONFIG_XEN_NETDEV_GRANT_RX -DCONFIG_XEN_NETDEV_GRANT_TX EXTRA_CFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030202 -EXTRA_CFLAGS += -I$(M)/include +EXTRA_CFLAGS += -I$(M)/include -I$(M)/compat-include -DHAVE_XEN_PLATFORM_COMPAT_H --- a/unmodified_drivers/linux-2.6/platform-pci/Kbuild Wed Oct 25 13:58:30 2006 +0100 +++ b/unmodified_drivers/linux-2.6/platform-pci/Kbuild Wed Oct 25 13:58:30 2006 +0100 @@ -4,4 +4,4 @@ obj-m := xen-platform-pci.o EXTRA_CFLAGS += -I$(M)/platform-pci -xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o +xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o platform-compat.o --- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Wed Oct 25 13:58:30 2006 +0100 +++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Wed Oct 25 13:58:30 2006 +0100 @@ -35,6 +35,10 @@ #include #include #include "platform-pci.h" + +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif void *shared_info_area; --- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Wed Oct 25 13:58:30 2006 +0100 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Wed Oct 25 13:58:30 2006 +0100 @@ -39,6 +39,10 @@ #include "platform-pci.h" +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + #define DRV_NAME "xen-platform-pci" #define DRV_VERSION "0.10" #define DRV_RELDATE "03/03/2005" --- a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c Wed Oct 25 13:58:30 2006 +0100 +++ b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c Wed Oct 25 13:58:30 2006 +0100 @@ -26,6 +26,10 @@ #include #include "platform-pci.h" +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + void xen_machphys_update(unsigned long mfn, unsigned long pfn) { BUG(); --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 @@ -0,0 +1,6 @@ +#ifndef COMPAT_INCLUDE_XEN_PLATFORM_COMPAT_H +#define COMPAT_INCLUDE_XEN_PLATFORM_COMPAT_H + +#include + +#endif --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 @@ -0,0 +1,4 @@ +#include +#include + +#include