1 /******************************************************************************
4 * Random collection of macros and definition
6 * Copyright (c) 2003, 2004 Keir Fraser (on behalf of the Xen team)
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to
11 * deal in the Software without restriction, including without limitation the
12 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
13 * sell copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
30 #ifndef _XEN_XEN_OS_H_
31 #define _XEN_XEN_OS_H_
33 #if !defined(__XEN_INTERFACE_VERSION__)
34 #define __XEN_INTERFACE_VERSION__ 0x00030208
37 #define GRANT_REF_INVALID 0xffffffff
43 #include <machine/xen/xen-os.h>
45 #include <xen/interface/xen.h>
47 /* Everything below this point is not included by assembler (.S) files. */
50 /* Force a proper event-channel callback from Xen. */
51 void force_evtchn_callback(void);
53 extern shared_info_t *HYPERVISOR_shared_info;
56 extern int xen_disable_pv_disks;
57 extern int xen_disable_pv_nics;
60 extern bool xen_suspend_cancelled;
62 enum xen_domain_type {
63 XEN_NATIVE, /* running on bare hardware */
64 XEN_PV_DOMAIN, /* running in a PV domain */
65 XEN_HVM_DOMAIN, /* running in a Xen hvm domain */
68 extern enum xen_domain_type xen_domain_type;
73 return (xen_domain_type != XEN_NATIVE);
79 return (xen_domain_type == XEN_PV_DOMAIN);
85 return (xen_domain_type == XEN_HVM_DOMAIN);
92 #define xen_rmb() rmb()
95 #define xen_wmb() wmb()
98 #endif /* !__ASSEMBLY__ */
100 #endif /* _XEN_XEN_OS_H_ */