Jeremy Fitzhardinge | 18f19aa | 2010-05-14 12:38:24 +0100 | [diff] [blame] | 1 | /* Simple wrappers around HVM functions */ |
| 2 | #ifndef XEN_HVM_H__ |
| 3 | #define XEN_HVM_H__ |
| 4 | |
| 5 | #include <xen/interface/hvm/params.h> |
Sheng Yang | 38e20b0 | 2010-05-14 12:40:51 +0100 | [diff] [blame] | 6 | #include <asm/xen/hypercall.h> |
Jeremy Fitzhardinge | 18f19aa | 2010-05-14 12:38:24 +0100 | [diff] [blame] | 7 | |
| 8 | static inline int hvm_get_parameter(int idx, uint64_t *value) |
| 9 | { |
| 10 | struct xen_hvm_param xhv; |
| 11 | int r; |
| 12 | |
| 13 | xhv.domid = DOMID_SELF; |
| 14 | xhv.index = idx; |
| 15 | r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv); |
| 16 | if (r < 0) { |
| 17 | printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n", |
| 18 | idx, r); |
| 19 | return r; |
| 20 | } |
| 21 | *value = xhv.value; |
| 22 | return r; |
| 23 | } |
| 24 | |
Sheng Yang | 38e20b0 | 2010-05-14 12:40:51 +0100 | [diff] [blame] | 25 | #define HVM_CALLBACK_VIA_TYPE_VECTOR 0x2 |
| 26 | #define HVM_CALLBACK_VIA_TYPE_SHIFT 56 |
| 27 | #define HVM_CALLBACK_VECTOR(x) (((uint64_t)HVM_CALLBACK_VIA_TYPE_VECTOR)<<\ |
| 28 | HVM_CALLBACK_VIA_TYPE_SHIFT | (x)) |
| 29 | |
Jeremy Fitzhardinge | 18f19aa | 2010-05-14 12:38:24 +0100 | [diff] [blame] | 30 | #endif /* XEN_HVM_H__ */ |