[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH XEN v4 20/23] tools/libs/call: Avoid xc_memalign in netbsd and solaris backends



On Wed, Oct 21, 2015 at 04:23:27PM +0100, Ian Campbell wrote:
> These are already arch specific, so just use the appropriate
> interfaces (as determined by looking at the xc_memalign backend).
> 
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

> ---
>  tools/libs/call/netbsd.c  | 4 ++--
>  tools/libs/call/solaris.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/libs/call/netbsd.c b/tools/libs/call/netbsd.c
> index 12008fb..c01d3de 100644
> --- a/tools/libs/call/netbsd.c
> +++ b/tools/libs/call/netbsd.c
> @@ -74,8 +74,8 @@ void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, 
> unsigned int npages)
>      size_t size = npages * XC_PAGE_SIZE;
>      void *p;
>  
> -    p = xc_memalign(xcall, XC_PAGE_SIZE, size);
> -    if (!p)
> +    ret = posix_memalign(&p, XC_PAGE_SIZE, size);
> +    if ( ret != 0 || !p )
>          return NULL;
>  
>      if ( mlock(p, size) < 0 )
> diff --git a/tools/libs/call/solaris.c b/tools/libs/call/solaris.c
> index 972989d..8d9c9da 100644
> --- a/tools/libs/call/solaris.c
> +++ b/tools/libs/call/solaris.c
> @@ -71,7 +71,7 @@ int osdep_xencall_close(xencall_handle *xcall)
>  
>  void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, unsigned int 
> npages)
>  {
> -    return xc_memalign(xcall, XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
> +    return memalign(XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
>  }
>  
>  void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr,
> -- 
> 2.1.4

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.