hvm.h 695 B

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