mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
This patch adds the headers and helpers for the FreeBSD gntdev, used in order to map grants from remote domains and to allocate grants on behalf of the current domain. Current code has been tested with the QEMU/Qdisk backend. Signed-off-by: Akshay Jaggi <akshay1994.leo@gmail.com> [ added dummy stub for osdep_gnttab_grant_copy ] Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Move PAGE_* back to {linux,freebsd}.c due to breakage in stubdom build. Signed-off-by: Wei Liu <wei.liu2@citrix.com>
58 lines
1.9 KiB
C
58 lines
1.9 KiB
C
#ifndef XENGNTTAB_PRIVATE_H
|
|
#define XENGNTTAB_PRIVATE_H
|
|
|
|
#include <xentoollog.h>
|
|
#include <xengnttab.h>
|
|
|
|
/* Set of macros/defines used by both Linux and FreeBSD */
|
|
#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
|
|
|
|
#define GTERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gnttab", _f)
|
|
#define GSERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gntshr", _f)
|
|
|
|
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_gnttab_grant_copy(xengnttab_handle *xgt,
|
|
uint32_t count,
|
|
xengnttab_grant_copy_segment_t *segs);
|
|
|
|
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:
|
|
*/
|