aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_minios.c
diff options
context:
space:
mode:
authorShriram Rajagopalan <rshriram@cs.ubc.ca>2011-12-01 15:35:02 +0000
committerShriram Rajagopalan <rshriram@cs.ubc.ca>2011-12-01 15:35:02 +0000
commitde869779a0b7c411a69b787ec01b485492b40f32 (patch)
treef1fb58a194fbb928a560b40f9c8b58b09daa470a /tools/libxc/xc_minios.c
parent3a313ac80e9e0316393c8034a32aae34e8f3373c (diff)
downloadxen-de869779a0b7c411a69b787ec01b485492b40f32.tar.gz
xen-de869779a0b7c411a69b787ec01b485492b40f32.tar.bz2
xen-de869779a0b7c411a69b787ec01b485492b40f32.zip
tools/libxc: introduce xc_memalign in xc_{minios,linux,solaris,netbsd}.c
Move (page aligned) buffer allocations in {os}_privcmd_alloc_hypercall_buffer into a global function xc_memalign. This API is also used by Remus compression code to allocate compression caches that need to be page aligned. Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Brendan Cully <brendan@cs.ubc.ca> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_minios.c')
-rw-r--r--tools/libxc/xc_minios.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index ff9c0d8d19..8bbfd186d5 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -73,7 +73,7 @@ void minios_interface_close_fd(int fd)
static void *minios_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, int npages)
{
- return memalign(PAGE_SIZE, npages * PAGE_SIZE);
+ return xc_memalign(xch, PAGE_SIZE, npages * PAGE_SIZE);
}
static void minios_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
@@ -437,6 +437,11 @@ void discard_file_cache(xc_interface *xch, int fd, int flush)
fsync(fd);
}
+void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
+{
+ return memalign(alignment, size);
+}
+
static xc_osdep_handle minios_gnttab_open(xc_gnttab *xcg)
{
int fd = alloc_fd(FTYPE_GNTMAP);