summaryrefslogtreecommitdiffstats
path: root/include/xen/hvm.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-05-14 12:38:24 +0100
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-07-22 16:45:31 -0700
commit18f19aa62a267f2f759e278018f1032adf4c3774 (patch)
treee6de00c645453ee48361e4cc0026e72d283c28a6 /include/xen/hvm.h
parent1c5474a65bf15a4cb162dfff86d6d0b5a08a740c (diff)
downloadlinux-18f19aa62a267f2f759e278018f1032adf4c3774.tar.bz2
xen: Add support for HVM hypercalls.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'include/xen/hvm.h')
-rw-r--r--include/xen/hvm.h24
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 @@
+/* Simple wrappers around HVM functions */
+#ifndef XEN_HVM_H__
+#define XEN_HVM_H__
+
+#include <xen/interface/hvm/params.h>
+
+static inline int hvm_get_parameter(int idx, uint64_t *value)
+{
+ struct xen_hvm_param xhv;
+ int r;
+
+ xhv.domid = DOMID_SELF;
+ xhv.index = idx;
+ r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
+ if (r < 0) {
+ printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n",
+ idx, r);
+ return r;
+ }
+ *value = xhv.value;
+ return r;
+}
+
+#endif /* XEN_HVM_H__ */