aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_linux.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
commite4371c99d8dcff34d8f2699e3cccbd80a0a24876 (patch)
tree8cfe32dbcf12e672fd25b40831c3d120de36f837 /tools/libxc/xc_linux.c
parentfcc007081b6e549911b83605cbffbfe8d651f5f8 (diff)
downloadxen-e4371c99d8dcff34d8f2699e3cccbd80a0a24876.tar.gz
xen-e4371c99d8dcff34d8f2699e3cccbd80a0a24876.tar.bz2
xen-e4371c99d8dcff34d8f2699e3cccbd80a0a24876.zip
libxc: osdep: convert xc_gnttab_munmap()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_linux.c')
-rw-r--r--tools/libxc/xc_linux.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
index 0b503e9828..945b26f93d 100644
--- a/tools/libxc/xc_linux.c
+++ b/tools/libxc/xc_linux.c
@@ -612,8 +612,10 @@ static void *linux_gnttab_map_domain_grant_refs(xc_gnttab *xcg, xc_osdep_handle
return do_gnttab_map_grant_refs(xcg, h, count, &domid, 0, refs, prot);
}
-int xc_gnttab_munmap(xc_gnttab *xcg, void *start_address, uint32_t count)
+static int linux_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
+ void *start_address, uint32_t count)
{
+ int fd = (int)h;
struct ioctl_gntdev_get_offset_for_vaddr get_offset;
struct ioctl_gntdev_unmap_grant_ref unmap_grant;
int rc;
@@ -628,7 +630,7 @@ int xc_gnttab_munmap(xc_gnttab *xcg, void *start_address, uint32_t count)
* mmap() the pages.
*/
get_offset.vaddr = (unsigned long)start_address;
- if ( (rc = ioctl(xcg->fd, IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR,
+ if ( (rc = ioctl(fd, IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR,
&get_offset)) )
return rc;
@@ -645,7 +647,7 @@ int xc_gnttab_munmap(xc_gnttab *xcg, void *start_address, uint32_t count)
/* Finally, unmap the driver slots used to store the grant information. */
unmap_grant.index = get_offset.offset;
unmap_grant.count = count;
- if ( (rc = ioctl(xcg->fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant)) )
+ if ( (rc = ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant)) )
return rc;
return 0;
@@ -671,6 +673,7 @@ static struct xc_osdep_ops linux_gnttab_ops = {
.map_grant_ref = &linux_gnttab_map_grant_ref,
.map_grant_refs = &linux_gnttab_map_grant_refs,
.map_domain_grant_refs = &linux_gnttab_map_domain_grant_refs,
+ .munmap = &linux_gnttab_munmap,
},
};