aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_linux_osdep.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_linux_osdep.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_linux_osdep.c')
-rw-r--r--tools/libxc/xc_linux_osdep.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 04059b8126..0da20091db 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -91,10 +91,9 @@ static void *linux_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_ha
{
size_t size = npages * XC_PAGE_SIZE;
void *p;
- int ret;
- ret = posix_memalign(&p, XC_PAGE_SIZE, size);
- if (ret != 0 || !p)
+ p = xc_memalign(xch, XC_PAGE_SIZE, size);
+ if (!p)
return NULL;
if ( mlock(p, size) < 0 )