From patchwork Wed Apr 9 16:40:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 28111 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7A0712145A for ; Wed, 9 Apr 2014 16:42:36 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf7742851pdj.11 for ; Wed, 09 Apr 2014 09:42:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:references:in-reply-to:cc:subject:precedence :list-id:list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=OpxxUpkffKL9HsE5ulvPEnuQhW4N3FFyBubPufTheVI=; b=chibxMlyLzP6mAKanZFCZOHMZsY6Yv1MbKp3BV1MqhB6StAkbMNlk0kiWmW6IArbM9 LVwnTxyebFLV/hlBMR/GJozh0BjeI424VYDLUrJK+qjrfJdPahhcJ6lUQQVm4NDxklKU twH7J/6ZLpET1NRd0NXA6S5vrzPpPD/8LBOOFqpFWnxTnFplDpAGCSkFmQTccoG4s4lT Q3UI83V/uNpY0pNzglh2NroROQVq0fhIPRDsCGmi4oGX7JCCCL30Rz/Tc+CdEj0/VJdf Xmy9E54noPdnG/Od6W5+Od/xRW3cP6OWha9aG7jl/2CMEA7hXoSMZYRhbGI07loTmu2C Ubhg== X-Gm-Message-State: ALoCoQklSrJe+tIbDAsIAsZFvkmPo6YKw2msDNy2YTfslQsBQVW6VPn88H7vDUQHAHuR0bPh+mts X-Received: by 10.66.150.106 with SMTP id uh10mr5019602pab.13.1397061755402; Wed, 09 Apr 2014 09:42:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.33 with SMTP id j30ls738304qga.67.gmail; Wed, 09 Apr 2014 09:42:35 -0700 (PDT) X-Received: by 10.58.207.74 with SMTP id lu10mr9538494vec.15.1397061755263; Wed, 09 Apr 2014 09:42:35 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id sw4si221843vdc.192.2014.04.09.09.42.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Apr 2014 09:42:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so2268311veb.41 for ; Wed, 09 Apr 2014 09:42:35 -0700 (PDT) X-Received: by 10.221.22.71 with SMTP id qv7mr1338573vcb.34.1397061755173; Wed, 09 Apr 2014 09:42:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp344849vcv; Wed, 9 Apr 2014 09:42:34 -0700 (PDT) X-Received: by 10.52.141.105 with SMTP id rn9mr18180vdb.44.1397061754515; Wed, 09 Apr 2014 09:42:34 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id rx10si226834vdc.60.2014.04.09.09.42.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 09 Apr 2014 09:42:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WXvY3-0005sc-Gu; Wed, 09 Apr 2014 16:40:27 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WXvY1-0005sT-Nm for xen-devel@lists.xenproject.org; Wed, 09 Apr 2014 16:40:25 +0000 Received: from [85.158.143.35:26559] by server-2.bemta-4.messagelabs.com id 60/8F-06539-9F775435; Wed, 09 Apr 2014 16:40:25 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-16.tower-21.messagelabs.com!1397061624!8006503!1 X-Originating-IP: [74.125.83.50] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13255 invoked from network); 9 Apr 2014 16:40:24 -0000 Received: from mail-ee0-f50.google.com (HELO mail-ee0-f50.google.com) (74.125.83.50) by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 9 Apr 2014 16:40:24 -0000 Received: by mail-ee0-f50.google.com with SMTP id c13so2088363eek.23 for ; Wed, 09 Apr 2014 09:40:24 -0700 (PDT) X-Received: by 10.15.83.68 with SMTP id b44mr11786959eez.11.1397061623702; Wed, 09 Apr 2014 09:40:23 -0700 (PDT) Received: from [10.80.2.139] ([185.25.64.249]) by mx.google.com with ESMTPSA id t44sm3415930eeo.6.2014.04.09.09.40.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Apr 2014 09:40:23 -0700 (PDT) Message-ID: <534577F6.9030604@linaro.org> Date: Wed, 09 Apr 2014 17:40:22 +0100 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131104 Icedove/17.0.10 MIME-Version: 1.0 To: Jan Beulich References: <1395766541-23979-1-git-send-email-julien.grall@linaro.org> <1395766541-23979-31-git-send-email-julien.grall@linaro.org> <5332DCD70200007800002512@nat28.tlf.novell.com> <53331160.7060809@linaro.org> <5333E7F20200007800002B0C@nat28.tlf.novell.com> <53456FF3.6030303@linaro.org> <53458EA802000078000075C2@nat28.tlf.novell.com> In-Reply-To: <53458EA802000078000075C2@nat28.tlf.novell.com> Cc: xen-devel@lists.xenproject.org, Daniel De Graaf , stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org Subject: Re: [Xen-devel] [PATCH 30/34] xen: Add missing includes on different files X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: On 04/09/2014 05:17 PM, Jan Beulich wrote: >>>> On 09.04.14 at 18:06, wrote: >> On 03/27/2014 07:57 AM, Jan Beulich wrote: >>>>>> On 26.03.14 at 18:41, wrote: >>>> In file included from multicall.c:41:0: >>>> ../multicall.c:38:1: error: conflicting types for ‘compat_multicall’ >>>> In file included from ../multicall.c:9:0, >>>> from multicall.c:41: >>> >>> Meaning this needs to be dealt with differently: Include the header in >>> both files _and_ add a declaration of compat_multicall() to it (alongside >>> the other compat_ ones already there). >> >> I gave a look to this solution. It won't works because do_multicall is >> replaced by the define in compat/multicall.c:26. It will end up to >> multiple definition of compat_multcall. >> >> I'm not sure how to handle it because, AFAIU, compat/multicall.c is >> defining some macro to redefine the behavior of multicall.c > > Right, but that doesn't prevent the suggested model afaict: > > - compat/multicall.c includes xen/hypercall.h, obtaining proper > prototypes for both do_multicall() and compat_multicall() > - compat/multicall.c re-defines do_multicall (which doesn't affect > the prototypes already seen) > - compat/multicall.c includes multicall.c > - multicall.c's inclusion of xen/hypercall.h does nothing (thanks > to the header guard) > > Did you indeed try this and it didn't work? I've tried another things. Anyway the version below works for me. Thanks for your help. diff --git a/xen/common/compat/multicall.c b/xen/common/compat/multicall.c index 95c047a..0399863 100644 --- a/xen/common/compat/multicall.c +++ b/xen/common/compat/multicall.c @@ -6,6 +6,7 @@ #include #include #include +#include #define COMPAT typedef int ret_t; @@ -18,7 +19,6 @@ static inline void xlat_multicall_entry(struct mc_state *mcs) mcs->compat_call.args[i] = mcs->call.args[i]; } -DEFINE_XEN_GUEST_HANDLE(multicall_entry_compat_t); #define multicall_entry compat_multicall_entry #define multicall_entry_t multicall_entry_compat_t #define do_multicall_call compat_multicall_call diff --git a/xen/common/multicall.c b/xen/common/multicall.c index bb7550b..e39e724 100644 --- a/xen/common/multicall.c +++ b/xen/common/multicall.c @@ -6,9 +6,7 @@ #include #include #include -#ifndef COMPAT #include -#endif #include #include #include diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h index a9e5229..baa9cc6 100644 --- a/xen/include/xen/hypercall.h +++ b/xen/include/xen/hypercall.h @@ -176,6 +176,11 @@ compat_set_timer_op( u32 lo, s32 hi); +DEFINE_XEN_GUEST_HANDLE(multicall_entry_compat_t); +extern int +compat_multicall(XEN_GUEST_HANDLE(multicall_entry_compat_t) call_list, + unsigned int nr_calls); + #endif void arch_get_xen_caps(xen_capabilities_info_t *info);