This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / xen / interface / xen-compat.h
1 /******************************************************************************
2  * xen-compat.h
3  * 
4  * Guest OS interface to Xen.  Compatibility layer.
5  * 
6  * Copyright (c) 2006, Christian Limpach
7  */
8
9 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
10 #define __XEN_PUBLIC_XEN_COMPAT_H__
11
12 #define __XEN_LATEST_INTERFACE_VERSION__ 0x00030202
13
14 #if defined(__XEN__) || defined(__XEN_TOOLS__)
15 /* Xen is built with matching headers and implements the latest interface. */
16 #define __XEN_INTERFACE_VERSION__ __XEN_LATEST_INTERFACE_VERSION__
17 #elif !defined(__XEN_INTERFACE_VERSION__)
18 /* Guests which do not specify a version get the legacy interface. */
19 #define __XEN_INTERFACE_VERSION__ 0x00000000
20 #endif
21
22 #if __XEN_INTERFACE_VERSION__ > __XEN_LATEST_INTERFACE_VERSION__
23 #error "These header files do not support the requested interface version."
24 #endif
25
26 /* New sched_op hypercall introduced in 0x00030101. */
27 #if __XEN_INTERFACE_VERSION__ < 0x00030101
28 #undef __HYPERVISOR_sched_op
29 #define __HYPERVISOR_sched_op __HYPERVISOR_sched_op_compat
30 #endif
31
32 /* Structural guest handles introduced in 0x00030201. */
33 #if __XEN_INTERFACE_VERSION__ < 0x00030201
34 #undef __DEFINE_XEN_GUEST_HANDLE
35 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
36     typedef type * __guest_handle_ ## name
37 #endif
38
39 /* New event-channel and physdev hypercalls introduced in 0x00030202. */
40 #if __XEN_INTERFACE_VERSION__ < 0x00030202
41 #undef __HYPERVISOR_event_channel_op
42 #define __HYPERVISOR_event_channel_op __HYPERVISOR_event_channel_op_compat
43 #undef __HYPERVISOR_physdev_op
44 #define __HYPERVISOR_physdev_op __HYPERVISOR_physdev_op_compat
45 #endif
46
47 #endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */