ia64/xen-unstable

changeset 11983:206e20b7b54e

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 <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
author Ian Campbell <ian.campbell@xensource.com>
date Wed Oct 25 13:58:30 2006 +0100 (2006-10-25)
parents db23596992f9
children d008b6b44f3c
files linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c linux-2.6-xen-sparse/drivers/xen/core/features.c linux-2.6-xen-sparse/drivers/xen/core/gnttab.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/synch_bitops.h unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h unmodified_drivers/linux-2.6/overrides.mk unmodified_drivers/linux-2.6/platform-pci/Kbuild unmodified_drivers/linux-2.6/platform-pci/evtchn.c unmodified_drivers/linux-2.6/platform-pci/platform-compat.c unmodified_drivers/linux-2.6/platform-pci/platform-pci.c unmodified_drivers/linux-2.6/platform-pci/xen_support.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Wed Oct 25 13:58:30 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Wed Oct 25 13:58:30 2006 +0100
     1.3 @@ -48,6 +48,10 @@
     1.4  #include <asm/hypervisor.h>
     1.5  #include <asm/maddr.h>
     1.6  
     1.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     1.8 +#include <xen/platform-compat.h>
     1.9 +#endif
    1.10 +
    1.11  #define BLKIF_STATE_DISCONNECTED 0
    1.12  #define BLKIF_STATE_CONNECTED    1
    1.13  #define BLKIF_STATE_SUSPENDED    2
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Wed Oct 25 13:58:30 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Wed Oct 25 13:58:30 2006 +0100
     2.3 @@ -36,6 +36,10 @@
     2.4  #include <linux/blkdev.h>
     2.5  #include <linux/list.h>
     2.6  
     2.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     2.8 +#include <xen/platform-compat.h>
     2.9 +#endif
    2.10 +
    2.11  #define BLKIF_MAJOR(dev) ((dev)>>8)
    2.12  #define BLKIF_MINOR(dev) ((dev) & 0xff)
    2.13  
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/features.c	Wed Oct 25 13:58:30 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/features.c	Wed Oct 25 13:58:30 2006 +0100
     3.3 @@ -11,6 +11,10 @@
     3.4  #include <asm/hypervisor.h>
     3.5  #include <xen/features.h>
     3.6  
     3.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     3.8 +#include <xen/platform-compat.h>
     3.9 +#endif
    3.10 +
    3.11  u8 xen_features[XENFEAT_NR_SUBMAPS * 32] __read_mostly;
    3.12  /* Not a GPL symbol: used in ubiquitous macros, so too restrictive. */
    3.13  EXPORT_SYMBOL(xen_features);
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c	Wed Oct 25 13:58:30 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c	Wed Oct 25 13:58:30 2006 +0100
     4.3 @@ -44,6 +44,10 @@
     4.4  #include <asm/io.h>
     4.5  #include <xen/interface/memory.h>
     4.6  
     4.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     4.8 +#include <xen/platform-compat.h>
     4.9 +#endif
    4.10 +
    4.11  /* External tools reserve first few grant table entries. */
    4.12  #define NR_RESERVED_ENTRIES 8
    4.13  
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed Oct 25 13:58:30 2006 +0100
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed Oct 25 13:58:30 2006 +0100
     5.3 @@ -64,6 +64,10 @@
     5.4  #include <xen/interface/grant_table.h>
     5.5  #include <xen/gnttab.h>
     5.6  
     5.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     5.8 +#include <xen/platform-compat.h>
     5.9 +#endif
    5.10 +
    5.11  /*
    5.12   * Mutually-exclusive module options to select receive data path:
    5.13   *  rx_copy : Packets are copied by network backend into local memory
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Wed Oct 25 13:58:30 2006 +0100
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Wed Oct 25 13:58:30 2006 +0100
     6.3 @@ -35,6 +35,10 @@
     6.4  #include <xen/xenbus.h>
     6.5  #include <xen/driver_util.h>
     6.6  
     6.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     6.8 +#include <xen/platform-compat.h>
     6.9 +#endif
    6.10 +
    6.11  /* xenbus_probe.c */
    6.12  extern char *kasprintf(const char *fmt, ...);
    6.13  
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Wed Oct 25 13:58:30 2006 +0100
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Wed Oct 25 13:58:30 2006 +0100
     7.3 @@ -39,6 +39,10 @@
     7.4  #include <xen/xenbus.h>
     7.5  #include "xenbus_comms.h"
     7.6  
     7.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     7.8 +#include <xen/platform-compat.h>
     7.9 +#endif
    7.10 +
    7.11  static int xenbus_irq;
    7.12  
    7.13  extern void xenbus_probe(void *);
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Wed Oct 25 13:58:30 2006 +0100
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Wed Oct 25 13:58:30 2006 +0100
     8.3 @@ -50,6 +50,10 @@
     8.4  #include <xen/xen_proc.h>
     8.5  #include <asm/hypervisor.h>
     8.6  
     8.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     8.8 +#include <xen/platform-compat.h>
     8.9 +#endif
    8.10 +
    8.11  struct xenbus_dev_transaction {
    8.12  	struct list_head list;
    8.13  	struct xenbus_transaction handle;
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Wed Oct 25 13:58:30 2006 +0100
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Wed Oct 25 13:58:30 2006 +0100
     9.3 @@ -58,6 +58,10 @@
     9.4  #include "xenbus_comms.h"
     9.5  #include "xenbus_probe.h"
     9.6  
     9.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     9.8 +#include <xen/platform-compat.h>
     9.9 +#endif
    9.10 +
    9.11  int xen_store_evtchn;
    9.12  struct xenstore_domain_interface *xen_store_interface;
    9.13  static unsigned long xen_store_mfn;
    10.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Wed Oct 25 13:58:30 2006 +0100
    10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Wed Oct 25 13:58:30 2006 +0100
    10.3 @@ -47,6 +47,10 @@
    10.4  #include <xen/xenbus.h>
    10.5  #include "xenbus_comms.h"
    10.6  
    10.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
    10.8 +#include <xen/platform-compat.h>
    10.9 +#endif
   10.10 +
   10.11  /* xenbus_probe.c */
   10.12  extern char *kasprintf(const char *fmt, ...);
   10.13  
    11.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/synch_bitops.h	Wed Oct 25 13:58:30 2006 +0100
    11.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/synch_bitops.h	Wed Oct 25 13:58:30 2006 +0100
    11.3 @@ -9,6 +9,10 @@
    11.4  
    11.5  #include <linux/config.h>
    11.6  
    11.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
    11.8 +#include <xen/platform-compat.h>
    11.9 +#endif
   11.10 +
   11.11  #define ADDR (*(volatile long *) addr)
   11.12  
   11.13  static __inline__ void synch_set_bit(int nr, volatile void * addr)
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h	Wed Oct 25 13:58:30 2006 +0100
    12.3 @@ -0,0 +1,6 @@
    12.4 +#ifndef COMPAT_INCLUDE_XEN_PLATFORM_COMPAT_H
    12.5 +#define COMPAT_INCLUDE_XEN_PLATFORM_COMPAT_H
    12.6 +
    12.7 +#include <linux/version.h>
    12.8 +
    12.9 +#endif
    13.1 --- a/unmodified_drivers/linux-2.6/overrides.mk	Wed Oct 25 13:58:30 2006 +0100
    13.2 +++ b/unmodified_drivers/linux-2.6/overrides.mk	Wed Oct 25 13:58:30 2006 +0100
    13.3 @@ -9,4 +9,4 @@ EXTRA_CFLAGS += -DCONFIG_XEN_SHADOW_MODE
    13.4  EXTRA_CFLAGS += -DCONFIG_XEN_BLKDEV_GRANT -DXEN_EVTCHN_MASK_OPS
    13.5  EXTRA_CFLAGS += -DCONFIG_XEN_NETDEV_GRANT_RX -DCONFIG_XEN_NETDEV_GRANT_TX
    13.6  EXTRA_CFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030202
    13.7 -EXTRA_CFLAGS += -I$(M)/include
    13.8 +EXTRA_CFLAGS += -I$(M)/include -I$(M)/compat-include -DHAVE_XEN_PLATFORM_COMPAT_H
    14.1 --- a/unmodified_drivers/linux-2.6/platform-pci/Kbuild	Wed Oct 25 13:58:30 2006 +0100
    14.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/Kbuild	Wed Oct 25 13:58:30 2006 +0100
    14.3 @@ -4,4 +4,4 @@ obj-m := xen-platform-pci.o
    14.4  
    14.5  EXTRA_CFLAGS += -I$(M)/platform-pci
    14.6  
    14.7 -xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o
    14.8 +xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o platform-compat.o
    15.1 --- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Wed Oct 25 13:58:30 2006 +0100
    15.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c	Wed Oct 25 13:58:30 2006 +0100
    15.3 @@ -36,6 +36,10 @@
    15.4  #include <xen/features.h>
    15.5  #include "platform-pci.h"
    15.6  
    15.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
    15.8 +#include <xen/platform-compat.h>
    15.9 +#endif
   15.10 +
   15.11  void *shared_info_area;
   15.12  
   15.13  #define MAX_EVTCHN 256
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c	Wed Oct 25 13:58:30 2006 +0100
    16.3 @@ -0,0 +1,4 @@
    16.4 +#include <linux/config.h>
    16.5 +#include <linux/version.h>
    16.6 +
    16.7 +#include <xen/platform-compat.h>
    17.1 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Wed Oct 25 13:58:30 2006 +0100
    17.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Wed Oct 25 13:58:30 2006 +0100
    17.3 @@ -39,6 +39,10 @@
    17.4  
    17.5  #include "platform-pci.h"
    17.6  
    17.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
    17.8 +#include <xen/platform-compat.h>
    17.9 +#endif
   17.10 +
   17.11  #define DRV_NAME    "xen-platform-pci"
   17.12  #define DRV_VERSION "0.10"
   17.13  #define DRV_RELDATE "03/03/2005"
    18.1 --- a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c	Wed Oct 25 13:58:30 2006 +0100
    18.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c	Wed Oct 25 13:58:30 2006 +0100
    18.3 @@ -26,6 +26,10 @@
    18.4  #include <asm/hypervisor.h>
    18.5  #include "platform-pci.h"
    18.6  
    18.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
    18.8 +#include <xen/platform-compat.h>
    18.9 +#endif
   18.10 +
   18.11  void xen_machphys_update(unsigned long mfn, unsigned long pfn)
   18.12  {
   18.13  	BUG();