From nobody Fri Apr 19 17:32:05 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; dmarc=fail(p=none dis=none) header.from=antioche.eu.org ARC-Seal: i=1; a=rsa-sha256; t=1610475574; cv=none; d=zohomail.com; s=zohoarc; b=RkoA7c9psMatpid8fhk72DLTfgiphTf73CPGOppmNRTSDuPtODz+xGjl8tjaA7vufGF5lmP6sZA6AbjB8uSHZZN0gbjOKHu7Srr57W7VOFBiG5qlLd112Nhr0yFHx+jafrZ8r5c4TfjSOoralF8xAGaWPld4NLZt9dLf6kYF7m0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610475574; h=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=dyszCTezEQodK+hfDITK85Psn9VvAsTn91OL3PbveHI=; b=BB99X+6qbbOaUGwSS8TDfUrzVWJvkXgiCmCmPiBIdj9s6tSCHjDUg381i930NlZ4a8CKZlPB7REWMztowqVtMncjTYeUsJYzu3lomSG4cX3nYaG5MWb9+vG86o8e5dr+iWLgzU4f0VErOhW7jtpNCbmOqRt/4tS3zjSjnUZf4ho= 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1610475574294383.67334117997575; Tue, 12 Jan 2021 10:19:34 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.65871.116786 (Exim 4.92) (envelope-from ) id 1kzOGE-00050j-On; Tue, 12 Jan 2021 18:19:18 +0000 Received: by outflank-mailman (output) from mailman id 65871.116786; Tue, 12 Jan 2021 18:19:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kzOGE-00050W-Kk; Tue, 12 Jan 2021 18:19:18 +0000 Received: by outflank-mailman (input) for mailman id 65871; Tue, 12 Jan 2021 18:19:16 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kzOBL-0003Yo-Up for xen-devel@lists.xenproject.org; Tue, 12 Jan 2021 18:14:15 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b2548167-0b56-4ac7-bc3d-3545afb8af1d; Tue, 12 Jan 2021 18:13:32 +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 10CIDV5M029918; Tue, 12 Jan 2021 19:13:31 +0100 (CET) Received: from armandeche.soc.lip6.fr (armandeche [132.227.63.133]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 10CIDU3t005928; Tue, 12 Jan 2021 19:13:30 +0100 (MET) Received: by armandeche.soc.lip6.fr (Postfix, from userid 20331) id 66A297218; Tue, 12 Jan 2021 19:13:30 +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: b2548167-0b56-4ac7-bc3d-3545afb8af1d From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer , Ian Jackson , Wei Liu Subject: [PATCH] libs/call: fix build on NetBSD Date: Tue, 12 Jan 2021 19:12:29 +0100 Message-Id: <20210112181242.1570-9-bouyer@antioche.eu.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210112181242.1570-1-bouyer@antioche.eu.org> References: <20210112181242.1570-1-bouyer@antioche.eu.org> MIME-Version: 1.0 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, 12 Jan 2021 19:13:31 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 Content-Type: text/plain; charset="utf-8" From: Manuel Bouyer 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 | 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 */ =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 57e49356a1..2ca84d723b 100644 --- a/tools/libs/call/private.h +++ b/tools/libs/call/private.h @@ -13,11 +13,13 @@ #include #endif =20 -#ifndef PAGE_SHIFT /* Mini-os, Yukk */ +#ifndef PAGE_SHIFT #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