This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / xen / hvm.h
diff --git a/include/xen/hvm.h b/include/xen/hvm.h
new file mode 100644 (file)
index 0000000..97bb68a
--- /dev/null
@@ -0,0 +1,24 @@
+/* Simple wrappers around HVM functions */
+#ifndef XEN_HVM_H__
+#define XEN_HVM_H__
+
+#include <xen/interface/hvm/params.h>
+#include <asm/hypercall.h>
+
+static inline unsigned long hvm_get_parameter(int idx)
+{
+       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 0;
+       }
+       return xhv.value;
+}
+
+#endif /* XEN_HVM_H__ */