Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git] / include / xen / hvm.h
1 /* Simple wrappers around HVM functions */
2 #ifndef XEN_HVM_H__
3 #define XEN_HVM_H__
4
5 #include <xen/interface/hvm/params.h>
6 #ifndef HAVE_XEN_PLATFORM_COMPAT_H
7 #include <asm/xen/hypercall.h>
8 #endif
9
10 static inline int hvm_get_parameter(int idx, uint64_t *value)
11 {
12         struct xen_hvm_param xhv;
13         int r;
14
15         xhv.domid = DOMID_SELF;
16         xhv.index = idx;
17         r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
18         if (r < 0) {
19                 pr_err("Cannot get hvm parameter %d: %d!\n", idx, r);
20                 return r;
21         }
22         *value = xhv.value;
23         return r;
24 }
25
26 #define HVM_CALLBACK_VIA_TYPE_VECTOR 0x2
27 #define HVM_CALLBACK_VIA_TYPE_SHIFT 56
28 #define HVM_CALLBACK_VECTOR(x) (((uint64_t)HVM_CALLBACK_VIA_TYPE_VECTOR)<<\
29                 HVM_CALLBACK_VIA_TYPE_SHIFT | (x))
30
31 #endif /* XEN_HVM_H__ */