aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_minios.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:47 +0000
committerIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:47 +0000
commitfcc007081b6e549911b83605cbffbfe8d651f5f8 (patch)
treed719c823ce4927ffe9cb49fe99fa7454b3406202 /tools/libxc/xc_minios.c
parent3361a9deea33fb852dc6f2c10c43c4cfeb897abf (diff)
downloadxen-fcc007081b6e549911b83605cbffbfe8d651f5f8.tar.gz
xen-fcc007081b6e549911b83605cbffbfe8d651f5f8.tar.bz2
xen-fcc007081b6e549911b83605cbffbfe8d651f5f8.zip
libxc: osdep: convert xc_gnttab_map_{grant_ref,grant_refs,domain_grant_refs}()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_minios.c')
-rw-r--r--tools/libxc/xc_minios.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index af3791f4fa..ab2620cd38 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -447,38 +447,41 @@ void minios_gnttab_close_fd(int fd)
files[fd].type = FTYPE_NONE;
}
-void *xc_gnttab_map_grant_ref(xc_gnttab *xcg,
- uint32_t domid,
- uint32_t ref,
- int prot)
+static void *minios_gnttab_map_grant_ref(xc_gnttab *xcg, xc_osdep_handle h,
+ uint32_t domid,
+ uint32_t ref,
+ int prot)
{
- return gntmap_map_grant_refs(&files[xcg->fd].gntmap,
+ int fd = (int)h;
+ return gntmap_map_grant_refs(&files[fd].gntmap,
1,
&domid, 0,
&ref,
prot & PROT_WRITE);
}
-void *xc_gnttab_map_grant_refs(xc_gnttab *xcg,
- uint32_t count,
- uint32_t *domids,
- uint32_t *refs,
- int prot)
+static void *minios_gnttab_map_grant_refs(xc_gnttab *xcg, xc_osdep_handle h,
+ uint32_t count,
+ uint32_t *domids,
+ uint32_t *refs,
+ int prot)
{
- return gntmap_map_grant_refs(&files[xcg->fd].gntmap,
+ int fd = (int)h;
+ return gntmap_map_grant_refs(&files[fd].gntmap,
count,
domids, 1,
refs,
prot & PROT_WRITE);
}
-void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg,
- uint32_t count,
- uint32_t domid,
- uint32_t *refs,
- int prot)
+static void *minios_gnttab_map_domain_grant_refs(xc_gnttab *xcg, xc_osdep_handle h,
+ uint32_t count,
+ uint32_t domid,
+ uint32_t *refs,
+ int prot)
{
- return gntmap_map_grant_refs(&files[xcg->fd].gntmap,
+ int fd = (int)h;
+ return gntmap_map_grant_refs(&files[fd].gntmap,
count,
&domid, 0,
refs,
@@ -516,6 +519,12 @@ int xc_gnttab_set_max_grants(xc_gnttab *xcg,
static struct xc_osdep_ops minios_gnttab_ops = {
.open = &minios_gnttab_open,
.close = &minios_gnttab_close,
+
+ .u.gnttab = {
+ .map_grant_ref = &minios_gnttab_map_grant_ref,
+ .map_grant_refs = &minios_gnttab_map_grant_refs,
+ .map_domain_grant_refs = &minios_gnttab_map_domain_grant_refs,
+ },
};
static struct xc_osdep_ops *minios_osdep_init(xc_interface *xch, enum xc_osdep_type type)