From patchwork Fri Jan 15 13:23:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 8040221 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 42D019F716 for ; Fri, 15 Jan 2016 13:25:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51FEB20390 for ; Fri, 15 Jan 2016 13:25:11 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 756DC2035D for ; Fri, 15 Jan 2016 13:25:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aK4Lv-0004QX-An; Fri, 15 Jan 2016 13:23:43 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aK4Lt-0004Fw-8T for xen-devel@lists.xen.org; Fri, 15 Jan 2016 13:23:41 +0000 Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id CB/95-09708-9D2F8965; Fri, 15 Jan 2016 13:23:37 +0000 X-Env-Sender: prvs=815b692d9=Ian.Campbell@citrix.com X-Msg-Ref: server-4.tower-21.messagelabs.com!1452864209!10277863!5 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50898 invoked from network); 15 Jan 2016 13:23:36 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 15 Jan 2016 13:23:36 -0000 X-IronPort-AV: E=Sophos;i="5.22,299,1449532800"; d="scan'208";a="325395818" From: Ian Campbell To: , , Date: Fri, 15 Jan 2016 13:23:02 +0000 Message-ID: <1452864188-2417-24-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452864188-2417-1-git-send-email-ian.campbell@citrix.com> References: <1452864168.32341.97.camel@citrix.com> <1452864188-2417-1-git-send-email-ian.campbell@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell Subject: [Xen-devel] [PATCH XEN v8 23/29] tools/libs/call: Avoid xc_memalign in netbsd and solaris backends X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Wei Liu --- 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 2aa02f1..e96fbf1 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, size_t 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 945d867..5aa330e 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, size_t 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,