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

Re: [PATCH] libs/call: fix build on NetBSD


  • To: Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 18 Jan 2021 19:00:16 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M+6gPxPqVgSJvVpPJ7cYeY5RSBFk4PSWp3HUQo6PSDA=; b=Op/Fzgf1K9gsfh9B2fqtd8ohVDoDkClxojIoRz5IOwW3+N2YmfyHL1+urnKtriiRhl2vhxGVebA0ixYz4vAit17m8766Ms4zFwMGHrpkudtrGrxAYpOfiWHrUH1FLah9JRhvG8GueMbXCLdClGTakDw1pTPwS9Bi5g2Cpl6Sixjr29WkUXcPmPoaPRZ8fargF/QAiiEVbscwBfjHCSA+kN0z/iqTDJj83zHHu9AioEFcTsfqbCCtJIzBSE1tu/AatLZxOR4+kyCXni1RBcnSAzD3VTGT4TLSN29zReAaqtuB/ovIr8zc+sLTXQmMbBbx3uMq2QdqvMnlAZorei/WYw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nQuCdcG6b87hIXJI1HN4pqgdeIqF4UpOlLrhNGACzJLFW24Uh15POBrR0SjA1ycdbtI3xpJoFeJ5MYNmGQVbuxZ577hwltSVOK37ECQtT9A2Zp7Sr/ieZRTbmztVeHbaUItOdGoXd6FC1mbUmERoDInFJ0NZTwyCWQLK4Tdz/LsKE7J1VROfcb70ChJ9w4C/bG15NDMitr465QqT6I5F8DA9Ijjch0V+jCaDuTaAlhfKa2AGhTEI8/zlDwvQctu9s4Xv2fOqRZTsLY+JIUzaJpJJ/4UzwzT4tj73tavyC9WWW76wSwSmTqnhJ2URl9haTjTHyC8OHQ7qs2NFGdRTew==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Manuel Bouyer <bouyer@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 18 Jan 2021 18:00:33 +0000
  • Ironport-sdr: 2AYKlm/04T6Sj5vdcwVaAEedGEp3hoK+iV9rJzu8jylq7pFH2HqqwvD5fT9hmK0ReM2OWuWMap AWe0PxFvcx598lGpTN4G4gy2jd31ziolfuilcfd69l6x/IUbqsvGHHq5mrZwZsCtQRva77S2gM /5sxr1ntefUJJ9OdEZw6AOX6BTvHp709hYG1tVvrBgFsk3MVC4av9Ts2I21TBpjruepw5DIRt2 HG0ImKukl4QI7lkin7LKUXZoe55U9g+0S68WvxRh7oqg0EioXA8aebMu7r4jFsaiShK/oqhnuE jH8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Jan 12, 2021 at 07:12:29PM +0100, Manuel Bouyer wrote:
> From: Manuel Bouyer <bouyer@xxxxxxxxxx>
> 
> Define PAGE_* if not already defined
> Catch up with osdep interface change.
> 
> Signed-off-by: Manuel Bouyer <bouyer@xxxxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Just one comment below, please keep the tag when resending with the
fixed comment.

> ---
>  tools/libs/call/netbsd.c  | 19 +++++++++++--------
>  tools/libs/call/private.h |  6 ++++--
>  2 files changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/libs/call/netbsd.c b/tools/libs/call/netbsd.c
> index a5502da377..4dcc2919ba 100644
> --- a/tools/libs/call/netbsd.c
> +++ b/tools/libs/call/netbsd.c
> @@ -19,12 +19,15 @@
>   * Split from xc_netbsd.c
>   */
>  
> -#include "xc_private.h"
>  
>  #include <unistd.h>
>  #include <fcntl.h>
>  #include <malloc.h>
> +#include <errno.h>
>  #include <sys/mman.h>
> +#include <sys/ioctl.h>
> +
> +#include "private.h"
>  
>  int osdep_xencall_open(xencall_handle *xcall)
>  {
> @@ -69,12 +72,13 @@ int osdep_xencall_close(xencall_handle *xcall)
>      return close(fd);
>  }
>  
> -void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages)
> +void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
>  {
> -    size_t size = npages * XC_PAGE_SIZE;
> +    size_t size = npages * PAGE_SIZE;
>      void *p;
> +    int ret;
>  
> -    ret = posix_memalign(&p, XC_PAGE_SIZE, size);
> +    ret = posix_memalign(&p, PAGE_SIZE, size);
>      if ( ret != 0 || !p )
>          return NULL;
>  
> @@ -86,14 +90,13 @@ void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, 
> size_t npages)
>      return p;
>  }
>  
> -void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr,
> -                                 size_t npages)
> +void osdep_free_pages(xencall_handle *xcall, void *ptr, size_t npages)
>  {
> -    (void) munlock(ptr, npages * XC_PAGE_SIZE);
> +    munlock(ptr, npages * PAGE_SIZE);
>      free(ptr);
>  }
>  
> -int do_xen_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
> +int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
>  {
>      int fd = xcall->fd;
>      int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
> diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h
> index 57e49356a1..2ca84d723b 100644
> --- a/tools/libs/call/private.h
> +++ b/tools/libs/call/private.h
> @@ -13,11 +13,13 @@
>  #include <xen/sys/privcmd.h>
>  #endif
>  
> -#ifndef PAGE_SHIFT /* Mini-os, Yukk */
> +#ifndef PAGE_SHIFT

I would keep the comment somewhere that Mini-os already have all those
defined, and hence we can just straight define them.

Thanks, Roger.



 


Rackspace

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