aboutsummaryrefslogtreecommitdiff
path: root/include/hw/xen/xen-bus.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/xen/xen-bus.h')
-rw-r--r--include/hw/xen/xen-bus.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h
index df73674fcd..63a09b67ee 100644
--- a/include/hw/xen/xen-bus.h
+++ b/include/hw/xen/xen-bus.h
@@ -24,6 +24,8 @@ typedef struct XenDevice {
enum xenbus_state backend_state, frontend_state;
Notifier exit;
XenWatch *frontend_state_watch;
+ xengnttab_handle *xgth;
+ bool feature_grant_copy;
} XenDevice;
typedef char *(*XenDeviceGetName)(XenDevice *xendev, Error **errp);
@@ -79,4 +81,27 @@ void xen_device_backend_set_state(XenDevice *xendev,
enum xenbus_state state);
enum xenbus_state xen_device_backend_get_state(XenDevice *xendev);
+void xen_device_set_max_grant_refs(XenDevice *xendev, unsigned int nr_refs,
+ Error **errp);
+void *xen_device_map_grant_refs(XenDevice *xendev, uint32_t *refs,
+ unsigned int nr_refs, int prot,
+ Error **errp);
+void xen_device_unmap_grant_refs(XenDevice *xendev, void *map,
+ unsigned int nr_refs, Error **errp);
+
+typedef struct XenDeviceGrantCopySegment {
+ union {
+ void *virt;
+ struct {
+ uint32_t ref;
+ off_t offset;
+ } foreign;
+ } source, dest;
+ size_t len;
+} XenDeviceGrantCopySegment;
+
+void xen_device_copy_grant_refs(XenDevice *xendev, bool to_domain,
+ XenDeviceGrantCopySegment segs[],
+ unsigned int nr_segs, Error **errp);
+
#endif /* HW_XEN_BUS_H */