diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-07-21 14:02:53 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-07-21 14:02:53 +0100 |
commit | 19aa4a65a3da6073da990f2845b26b42021db09e (patch) | |
tree | ed2d8b2044ad5af2742ab1944c6339223a5db9db /tools/libxc/xc_linux.c | |
parent | 0bfcf984b727797fb48e19507cd9f00afd1cd65a (diff) | |
download | xen-19aa4a65a3da6073da990f2845b26b42021db09e.tar.gz xen-19aa4a65a3da6073da990f2845b26b42021db09e.tar.bz2 xen-19aa4a65a3da6073da990f2845b26b42021db09e.zip |
libxc: add xc_gnttab_map_domain_grant_refs.
xc_gnttab_map_domain_grant_refs permits to simply map several pages
from the same domain.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_linux.c')
-rw-r--r-- | tools/libxc/xc_linux.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c index b6f9b82a52..d407299ff8 100644 --- a/tools/libxc/xc_linux.c +++ b/tools/libxc/xc_linux.c @@ -418,9 +418,10 @@ void *xc_gnttab_map_grant_ref(int xcg_handle, return addr; } -void *xc_gnttab_map_grant_refs(int xcg_handle, +static void *do_gnttab_map_grant_refs(int xcg_handle, uint32_t count, uint32_t *domids, + int domids_stride, uint32_t *refs, int prot) { @@ -435,7 +436,7 @@ void *xc_gnttab_map_grant_refs(int xcg_handle, for ( i = 0; i < count; i++ ) { - map->refs[i].domid = domids[i]; + map->refs[i].domid = domids[i * domids_stride]; map->refs[i].ref = refs[i]; } @@ -464,6 +465,24 @@ void *xc_gnttab_map_grant_refs(int xcg_handle, return addr; } +void *xc_gnttab_map_grant_refs(int xcg_handle, + uint32_t count, + uint32_t *domids, + uint32_t *refs, + int prot) +{ + return do_gnttab_map_grant_refs(xcg_handle, count, domids, 1, refs, prot); +} + +void *xc_gnttab_map_domain_grant_refs(int xcg_handle, + uint32_t count, + uint32_t domid, + uint32_t *refs, + int prot) +{ + return do_gnttab_map_grant_refs(xcg_handle, count, &domid, 0, refs, prot); +} + int xc_gnttab_munmap(int xcg_handle, void *start_address, uint32_t count) |