From patchwork Wed Sep 27 06:13:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 114338 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4665448qgf; Tue, 26 Sep 2017 23:17:06 -0700 (PDT) X-Received: by 10.36.50.150 with SMTP id j144mr903574ita.52.1506493026045; Tue, 26 Sep 2017 23:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506493026; cv=none; d=google.com; s=arc-20160816; b=I9AkD+wA5LwAssFPm5Hq/M+c8nMNwzUswiRrV38+RREj2jYLR/wrQ5o3yS7CqnMF+m N6jqRsdkaZi50bIyZWZs2NK+8BolCJ0XApPmWraLEQSYHlig8hLR99XT48dWvQ63U5kk 1aopJunDXDaZFo6232sL3woSl4LTi9TNjEiUjbA3qLiU/32zYjWQcYUjtDRb/8Sf62Xk TmQfQLeltb1FkEl9HoBOPgd4Wd3OwWCB/YAFweS624TB4jvahbuzLOTg6+TKQeDT5cJt /ACnwAffL9g4+Euhumu3MGC3ij+ZeAmKXUB0Ak6ZMpZ1pwBcdi7+wvwjC8Grpz5iBQlt WDVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=UUk80xfYWEl3tHJQairDKMzhjTXbABUI39P62I2TePo=; b=XpviKxunkNRZ08LQMV2PeXrLMGhUohl6478THm2yK7vzFectdSU6XLZOju3GHXQWgA QuIM6x61NI+mRFxgZwHK6QbIZ/kV0d3knmjZO6Z63uiH/cuwXQP/4wQQT65xPFl/c0x7 jiefQzkkYRO1k5BLIvT6so9T3jMACRpJEId11MudnBp1lSyQRviITsGiLRu06LQxUeJJ g/EgDyep3QER6fHKBkykE4zI5w7O4yOhnBYgaTu/Jw7FMnnTuEOy+vNI4+hPa/mT72hf aEOlPN5+R3SwnOjhbCIN6FG/xW2PbEP29XxpN0g9Ms1O+1McBhjFQYjrm6ltU2bPBoke y9ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fomsjdRe; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id x88si3482130ita.38.2017.09.26.23.17.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Sep 2017 23:17:06 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fomsjdRe; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dx5bN-0002PK-Q9; Wed, 27 Sep 2017 06:13:45 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dx5bM-0002Oi-Lg for xen-devel@lists.xenproject.org; Wed, 27 Sep 2017 06:13:44 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id DD/82-10804-8914BC95; Wed, 27 Sep 2017 06:13:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRWlGSWpSXmKPExsVyMfTARt1pjqc jDeZ/07X4vmUykwOjx+EPV1gCGKNYM/OS8isSWDNWTrvOXrBbuuLD6VmsDYwHxLsYuTiEBGYw Suy5fo0VxGERmMcssWP1PzBHQqCfVWJvwzaWLkZOICdP4u+yDewQdprEpJvToOwKicU7roDZQ gJaEkdPzWaFsFcwSexbqtPFyMHBJmAiMatDAiQsIqAkcW/VZCaQ+cwCFxglZv59zgaSEBZIll jVNwFsF4uAqsSRFc1gNq+At8Tb3ZPYIHbJSdw818kMYnMK+Eic7r/NBrHLW+LSyn7WCYyCCxg ZVjFqFKcWlaUW6Rqa6CUVZaZnlOQmZuboGhqY6eWmFhcnpqfmJCYV6yXn525iBIYcAxDsYLy+ MeAQoyQHk5Iob83/U5FCfEn5KZUZicUZ8UWlOanFhxhlODiUJHjnOZyOFBIsSk1PrUjLzAEGP 0xagoNHSYQ3CiTNW1yQmFucmQ6ROsXoynHhzqU/TBzHNl0Gkl96bwDJA3tuAcmOm3f/MAmx5O XnpUqJ81aBNAuANGeU5sGNhkXuJUZZKWFeRqBjhXgKUotyM0tQ5V8xinMwKgnzJoNM4cnMK4G 74BXQcUxAx/VOPQFyXEkiQkqqgVH86+rZqqoeyx4Wzp56PLz8oJmu38noZr0f8ptXcPos0Lz6 5Za8P89ztpvXa3IDH7yodHwxRTKbb/XbVIOz/xqXVrMrOz5lyQyzinVLPszZFc5xIjSNVfKx8 P/Fzbd3H6k9d33P6tXMk5Pc2rvqRXb4cnjNKdf9kiZ0yEzuW2iq8PXzPJMU1ZVYijMSDbWYi4 oTAbaUH2bXAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-5.tower-27.messagelabs.com!1506492821!113221474!1 X-Originating-IP: [209.85.192.177] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8304 invoked from network); 27 Sep 2017 06:13:42 -0000 Received: from mail-pf0-f177.google.com (HELO mail-pf0-f177.google.com) (209.85.192.177) by server-5.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 27 Sep 2017 06:13:42 -0000 Received: by mail-pf0-f177.google.com with SMTP id r68so6749519pfj.3 for ; Tue, 26 Sep 2017 23:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iEjfZLGFpkTJbmA53YBiJXpiNqpkjy4JrF6UOsZuq6Q=; b=fomsjdRefx1dFb6CfW/8OGNeH3RCe0bl8ld/emFze6SY/uJoV6XIqoSegIzlpL+YtJ HCaCkX484VwNh72LFthmku/j5+q8quv4EA2Pqkc+8tV9cJkBtRaZCX/fjAW6fF+zkaE+ Fnn0z0/CZATNK2XMHa7ZPRzR7wsVDlxq1gdOE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iEjfZLGFpkTJbmA53YBiJXpiNqpkjy4JrF6UOsZuq6Q=; b=Em8tHOLhNPVYD1y8wvLPhRINCFUsJ0s1/Bb+oWb4hiTInhVV2gy0jXn5z9GMQhV872 CbFe+3wfszkr0RRVZKjwo/rx3Mx3QEJxoP+QU803dz12ClNZQ5g+rvjvbuTW5Mce1sOP j3NUcwB8BIA9q42nP2oLNftW1dStsbcTONNtjlk+l/acvHTV3bFhsc2Xj0qL7HCBo6G+ SrT7SeGIGbRUGo8rzOlqLGyqcCwh5Lj3Wt6XjV/B7i6sKtlbT9VEUu8bV7uif8/nYBKT PadITeffb2RGTx2bz2TnJzfjEhRVgJY81BWtAOLutqlDUHoNuzqYw+irDLthGM9Xm/km PSbQ== X-Gm-Message-State: AHPjjUjGf+LLcMTiznJxkKqsZ0cgs4maf79Yx/N1hr5/cVfgK8KIsPuT flzCxchvurlTB3F1aYoI4qg3LTtEeJU= X-Google-Smtp-Source: AOwi7QC9uGPtzo7d0S2WQMzpqCDRmstthE3Dsos8MxzLbwRIxHwOJ55MB0nbaDzzQWhDo8I35VFLHQ== X-Received: by 10.98.200.197 with SMTP id i66mr329637pfk.73.1506492820973; Tue, 26 Sep 2017 23:13:40 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com (h3.248.139.40.ip.windstream.net. [40.139.248.3]) by smtp.gmail.com with ESMTPSA id s187sm18013485pgb.82.2017.09.26.23.13.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Sep 2017 23:13:40 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Wed, 27 Sep 2017 11:43:10 +0530 Message-Id: <1506492816-25954-2-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506492816-25954-1-git-send-email-bhupinder.thakur@linaro.org> References: <1506492816-25954-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 01/27 v11] xen/arm: vpl011: Define common ring buffer helper functions in console.h X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" DEFINE_XEN_FLEX_RING(xencons) defines common helper functions such as xencons_queued() to tell the current size of the ring buffer, xencons_mask() to mask off the index, which are useful helper functions. pl011 emulation code will use these helper functions. io/console.h includes io/ring.h which defines DEFINE_XEN_FLEX_RING. In console/daemon/io.c, string.h had to be included before io/console.h because ring.h uses string functions. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu Acked-by: Konrad Rzeszutek Wilk Reviewed-by: Stefano Stabellini --- CC: Ian Jackson CC: Wei Liu CC: Konrad Rzeszutek Wilk CC: Stefano Stabellini CC: Julien Grall Changes since v10: - Fix for the headers.chk/headers++.chk compilation failures when code is compiled natively. 1) Inclusion of DEFINE_XEN_FLEX_RING in console.h had to be put under !defined(__STRICT_ANSI__) check as console.h is __STRICT_ANSI__ currently since it is part of headers.chk. 2) Also string header file had to be added as a pre-req for headers++.chk to pass the compilation because c++ does not define __STRICT_ANSI__ and thus expands DEFINE_XEN_FLEX_RING, which looks for memcpy(), size_t declarations. To satify that requirement string header file had to be added a pre-req for header++.chk. Changes since v4: - Split this change in a separate patch. tools/console/daemon/io.c | 2 +- xen/include/public/io/console.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) tools/console/daemon/io.c | 2 +- xen/include/Makefile | 1 + xen/include/public/io/console.h | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 7e474bb..e8033d2 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -21,6 +21,7 @@ #include "utils.h" #include "io.h" +#include #include #include #include @@ -29,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/xen/include/Makefile b/xen/include/Makefile index 1299b19..c90fdee 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -98,6 +98,7 @@ PUBLIC_C99_HEADERS := public/io/9pfs.h public/io/pvcalls.h PUBLIC_ANSI_HEADERS := $(filter-out public/%ctl.h public/xsm/% public/%hvm/save.h $(PUBLIC_C99_HEADERS), $(PUBLIC_HEADERS)) public/io/9pfs.h-prereq := string +public/io/console.h-prereq := string public/io/pvcalls.h-prereq := string headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile diff --git a/xen/include/public/io/console.h b/xen/include/public/io/console.h index e2cd97f..0f0711f 100644 --- a/xen/include/public/io/console.h +++ b/xen/include/public/io/console.h @@ -27,6 +27,8 @@ #ifndef __XEN_PUBLIC_IO_CONSOLE_H__ #define __XEN_PUBLIC_IO_CONSOLE_H__ +#include "ring.h" + typedef uint32_t XENCONS_RING_IDX; #define MASK_XENCONS_IDX(idx, ring) ((idx) & (sizeof(ring)-1)) @@ -38,6 +40,10 @@ struct xencons_interface { XENCONS_RING_IDX out_cons, out_prod; }; +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +DEFINE_XEN_FLEX_RING(xencons); +#endif + #endif /* __XEN_PUBLIC_IO_CONSOLE_H__ */ /*