diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-22 15:19:15 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-22 15:19:15 +0000 |
commit | d94f94862015f5f2416a99f2a56583951eee1453 (patch) | |
tree | 34cacfd88a305067abeb16c64b3620e95305d8e8 /hw/xen_common.h | |
parent | e37630ca4f5142a6830654d9801b473600417d5c (diff) |
xen: backend driver core (Gerd Hoffmann)
This patch adds infrastructure for xen backend drivers living in qemu,
so drivers don't need to implement common stuff on their own. It's
mostly xenbus management stuff: some functions to access xentore,
setting up xenstore watches, callbacks on device discovery and state
changes, handle event channel, ...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7220 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/xen_common.h')
-rw-r--r-- | hw/xen_common.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/hw/xen_common.h b/hw/xen_common.h new file mode 100644 index 0000000000..7562567b5a --- /dev/null +++ b/hw/xen_common.h @@ -0,0 +1,34 @@ +#ifndef QEMU_HW_XEN_COMMON_H +#define QEMU_HW_XEN_COMMON_H 1 + +#include <stddef.h> +#include <inttypes.h> + +#include <xenctrl.h> +#include <xs.h> +#include <xen/io/xenbus.h> + +#include "hw.h" +#include "xen.h" +#include "sys-queue.h" /* BSD list implementation */ + +/* + * tweaks needed to build with different xen versions + * 0x00030205 -> 3.1.0 + * 0x00030207 -> 3.2.0 + * 0x00030208 -> unstable + */ +#include <xen/xen-compat.h> +#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030205 +# define evtchn_port_or_error_t int +#endif +#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030207 +# define xc_map_foreign_pages xc_map_foreign_batch +#endif +#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030208 +# define xen_mb() mb() +# define xen_rmb() rmb() +# define xen_wmb() wmb() +#endif + +#endif /* QEMU_HW_XEN_COMMON_H */ |