From nobody Sun May 5 14:36:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1611702012; cv=none; d=zohomail.com; s=zohoarc; b=UsaMfRCOKu3dGG1LakGq4k++6RIw4TDLbwCaJDvM1HuItWQFR0gLf0f+yiz8XJeq2xcpXYKoByXRkHc2aQ7eyJwCqgnBQN6cDL4y92llqlfEJkHa40p+Zuaoo1+bjgfg2gH0DyAJTEnVgp5jd2JmAapWrlUak+u6Eirn8q2Y7x0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611702012; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aX0v3BuW1q4W/NdXEPGv9dX2v5VBWgWDHQFXtFXudoA=; b=QIa9KpIJ13HchoPw1wNCLnvuQvGJt0nXZSaHM2HIUhdjjLTr79XObh/xx0Shycmit81io8jWXDbD4RVc9Ls0xUprmBcDmvOcCM4/msKNQ+JGa8a5NpflELA7uruXNHLpQZ30HyOXgd8Uwg4U0+mM6eiOwC+b+NxLtOQcLq1Bm2E= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1611702012027723.1767677812513; Tue, 26 Jan 2021 15:00:12 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.75668.136305 (Exim 4.92) (envelope-from ) id 1l4XJX-00049d-7X; Tue, 26 Jan 2021 22:59:59 +0000 Received: by outflank-mailman (output) from mailman id 75668.136305; Tue, 26 Jan 2021 22:59:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l4XJX-00049S-0X; Tue, 26 Jan 2021 22:59:59 +0000 Received: by outflank-mailman (input) for mailman id 75668; Tue, 26 Jan 2021 22:59:57 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l4X9J-0001QY-On for xen-devel@lists.xenproject.org; Tue, 26 Jan 2021 22:49:25 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 32455d2f-5efb-41df-84d5-dd1c72b63732; Tue, 26 Jan 2021 22:48:37 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 10QMmXcl003710; Tue, 26 Jan 2021 23:48:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 10QMmWnJ009929; Tue, 26 Jan 2021 23:48:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id E6B26AA8C1; Tue, 26 Jan 2021 23:48:32 +0100 (MET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 32455d2f-5efb-41df-84d5-dd1c72b63732 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Ian Jackson , Wei Liu Subject: [PATCH v2] libs/call: fix build on NetBSD Date: Tue, 26 Jan 2021 23:47:51 +0100 Message-Id: <20210126224800.1246-5-bouyer@netbsd.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210126224800.1246-1-bouyer@netbsd.org> References: <20210126224800.1246-1-bouyer@netbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Tue, 26 Jan 2021 23:48:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 Define PAGE_* if not already defined Catch up with osdep interface change. Signed-off-by: Manuel Bouyer Reviewed-by: Roger Pau Monn=C3=A9 --- tools/libs/call/netbsd.c | 19 +++++++++++-------- tools/libs/call/private.h | 4 +++- 2 files changed, 14 insertions(+), 9 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 */ =20 -#include "xc_private.h" =20 #include #include #include +#include #include +#include + +#include "private.h" =20 int osdep_xencall_open(xencall_handle *xcall) { @@ -69,12 +72,13 @@ int osdep_xencall_close(xencall_handle *xcall) return close(fd); } =20 -void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages) +void *osdep_alloc_pages(xencall_handle *xcall, size_t npages) { - size_t size =3D npages * XC_PAGE_SIZE; + size_t size =3D npages * PAGE_SIZE; void *p; + int ret; =20 - ret =3D posix_memalign(&p, XC_PAGE_SIZE, size); + ret =3D posix_memalign(&p, PAGE_SIZE, size); if ( ret !=3D 0 || !p ) return NULL; =20 @@ -86,14 +90,13 @@ void *osdep_alloc_hypercall_buffer(xencall_handle *xcal= l, size_t npages) return p; } =20 -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); } =20 -int do_xen_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall) +int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall) { int fd =3D xcall->fd; int error =3D ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall); diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h index 21f992b37e..7944ac5baf 100644 --- a/tools/libs/call/private.h +++ b/tools/libs/call/private.h @@ -12,8 +12,10 @@ #ifndef PAGE_SHIFT /* Mini-os, Yukk */ #define PAGE_SHIFT 12 #endif -#ifndef __MINIOS__ /* Yukk */ +#ifndef PAGE_SIZE #define PAGE_SIZE (1UL << PAGE_SHIFT) +#endif +#ifndef PAGE_MASK #define PAGE_MASK (~(PAGE_SIZE-1)) #endif =20 --=20 2.29.2