xref: /netbsd-src/sys/external/mit/xen-include-public/dist/xen/include/public/xen-compat.h (revision a215bf017205c151c294992dd060042ee327e78c)
1*a215bf01Scherry /******************************************************************************
2*a215bf01Scherry  * xen-compat.h
3*a215bf01Scherry  *
4*a215bf01Scherry  * Guest OS interface to Xen.  Compatibility layer.
5*a215bf01Scherry  *
6*a215bf01Scherry  * Permission is hereby granted, free of charge, to any person obtaining a copy
7*a215bf01Scherry  * of this software and associated documentation files (the "Software"), to
8*a215bf01Scherry  * deal in the Software without restriction, including without limitation the
9*a215bf01Scherry  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10*a215bf01Scherry  * sell copies of the Software, and to permit persons to whom the Software is
11*a215bf01Scherry  * furnished to do so, subject to the following conditions:
12*a215bf01Scherry  *
13*a215bf01Scherry  * The above copyright notice and this permission notice shall be included in
14*a215bf01Scherry  * all copies or substantial portions of the Software.
15*a215bf01Scherry  *
16*a215bf01Scherry  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17*a215bf01Scherry  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18*a215bf01Scherry  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19*a215bf01Scherry  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20*a215bf01Scherry  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21*a215bf01Scherry  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22*a215bf01Scherry  * DEALINGS IN THE SOFTWARE.
23*a215bf01Scherry  *
24*a215bf01Scherry  * Copyright (c) 2006, Christian Limpach
25*a215bf01Scherry  */
26*a215bf01Scherry 
27*a215bf01Scherry #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
28*a215bf01Scherry #define __XEN_PUBLIC_XEN_COMPAT_H__
29*a215bf01Scherry 
30*a215bf01Scherry #define __XEN_LATEST_INTERFACE_VERSION__ 0x00040900
31*a215bf01Scherry 
32*a215bf01Scherry #if defined(__XEN__) || defined(__XEN_TOOLS__)
33*a215bf01Scherry /* Xen is built with matching headers and implements the latest interface. */
34*a215bf01Scherry #define __XEN_INTERFACE_VERSION__ __XEN_LATEST_INTERFACE_VERSION__
35*a215bf01Scherry #elif !defined(__XEN_INTERFACE_VERSION__)
36*a215bf01Scherry /* Guests which do not specify a version get the legacy interface. */
37*a215bf01Scherry #define __XEN_INTERFACE_VERSION__ 0x00000000
38*a215bf01Scherry #endif
39*a215bf01Scherry 
40*a215bf01Scherry #if __XEN_INTERFACE_VERSION__ > __XEN_LATEST_INTERFACE_VERSION__
41*a215bf01Scherry #error "These header files do not support the requested interface version."
42*a215bf01Scherry #endif
43*a215bf01Scherry 
44*a215bf01Scherry #endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */
45