diff options
Diffstat (limited to 'include/xen/hvm.h')
-rw-r--r-- | include/xen/hvm.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/xen/hvm.h b/include/xen/hvm.h new file mode 100644 index 000000000000..5dfe8fb86e67 --- /dev/null +++ b/include/xen/hvm.h | |||
@@ -0,0 +1,24 @@ | |||
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 | |||
7 | static inline int hvm_get_parameter(int idx, uint64_t *value) | ||
8 | { | ||
9 | struct xen_hvm_param xhv; | ||
10 | int r; | ||
11 | |||
12 | xhv.domid = DOMID_SELF; | ||
13 | xhv.index = idx; | ||
14 | r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv); | ||
15 | if (r < 0) { | ||
16 | printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n", | ||
17 | idx, r); | ||
18 | return r; | ||
19 | } | ||
20 | *value = xhv.value; | ||
21 | return r; | ||
22 | } | ||
23 | |||
24 | #endif /* XEN_HVM_H__ */ | ||