Files
xen/tools/libs/gnttab/private.h
T
Ian Campbell a71ad0fead tools: Refactor /dev/xen/gnt{dev,shr} wrappers into libxengnttab.
libxengnttab will provide a stable API and ABI for accessing the
grant table devices.

The functions are moved into the xengnt{tab,shr} namespace to make a
clean break from libxc and avoid ambiguity regarding which interfaces
are stable.

All in-tree users are updated to use the new names.

Upon request (via #define XC_WANT_COMPAT_GNTTAB_API) libxenctrl will
provide a compat API for the old names. This is used by qemu-xen for
the time being. qemu-xen-traditional is updated in lockstep.

This leaves a few grant table related functions which go via privcmd
(GNTTABOP) rather than ioctls on the /dev/xen/gnt* devices in
libxenctrl. Specifically:

  - xc_gnttab_get_version
  - xc_gnttab_map_table_v1
  - xc_gnttab_map_table_v2
  - xc_gnttab_op

These functions do not appear to be needed by qemu-dm, qemu-pv
(provision of device model to HVM guests and PV backends respectively)
or by libvchan suggesting they are not needed by non-toolstack uses of
event channels.

The new library uses a version script to ensure that only expected
symbols are exported and to version them such that ABI guarantees can
be kept in the future.

After this change libxenvchan no longer needs to link against
libxenctrl. It still needs xenctrl.h in one file for xen_mb and
friends.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
[ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
2016-01-22 12:22:27 +00:00

48 lines
1.4 KiB
C

#ifndef XENGNTTAB_PRIVATE_H
#define XENGNTTAB_PRIVATE_H
#include <xentoollog.h>
#include <xengnttab.h>
struct xengntdev_handle {
xentoollog_logger *logger, *logger_tofree;
int fd;
};
int osdep_gnttab_open(xengnttab_handle *xgt);
int osdep_gnttab_close(xengnttab_handle *xgt);
int osdep_gnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count);
#define XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN 0x1
void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
uint32_t count, int flags, int prot,
uint32_t *domids, uint32_t *refs,
uint32_t notify_offset,
evtchn_port_t notify_port);
int osdep_gnttab_unmap(xengnttab_handle *xgt,
void *start_address,
uint32_t count);
int osdep_gntshr_open(xengntshr_handle *xgs);
int osdep_gntshr_close(xengntshr_handle *xgs);
void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
uint32_t domid, int count,
uint32_t *refs, int writable,
uint32_t notify_offset,
evtchn_port_t notify_port);
int osdep_gntshr_unshare(xengntshr_handle *xgs,
void *start_address, uint32_t count);
#endif
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/