From patchwork Mon Aug 7 08:52:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 109522 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp2481848obb; Mon, 7 Aug 2017 01:55:42 -0700 (PDT) X-Received: by 10.107.173.89 with SMTP id w86mr11791995ioe.2.1502096142813; Mon, 07 Aug 2017 01:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502096142; cv=none; d=google.com; s=arc-20160816; b=B2W88LNG4hRT6kA0QKCOEL+6/CnyN/2+aHyJXn2zcWsGTpRR9+M5gPgmy8N9F0Vz7x llJCjUzFM0F/50cZ2Uc0Sufz2FTCAvm1GtA/sW6MD19ikjVFVPQjDPqp2i/sTUSVjhTg 4MHhWRvkV/DCKJQnYUCPGQYMT46kjTsEiay7KAyokKVi3nNwgNoYAd/Jbc4bzwL1OVXf DZgd5EXjlWFnKAT+Gx8FPh0zRH+yNwx83JUqUU+rhSokJhdpo4mLoRWROnZ3+SjJveL2 SPkZJt/jKchc+qTpTIh+39uUZYLjJz/E2X654QCUV1sylIc0isGj7q5sTQD1Ct8vlPOJ 6kXQ== 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=h2Lgi14r56Z7LAI2sE2QMZenSofcYUDVfI3wXyIoGr8=; b=tBWNCpjoCOcFq6/moysQc9BFDAcEhPjBl9xOH7j8mQKuNC8YO212qLUuJCFAadLhgt rYBkowv2UvxhPZEUHYhT4bchnHzoxuOvp6sPPsP4tCydmPMGWRPB/hjsdR3y3+7crmeF Hv3U7DD6VEaayLJ5PrpD75Jf7HdWuFBowUgFIzc7mXg5cpoUqpGOs1PWVUNc7K2sJQt7 B60xg3wUyIRmRs5Fq8sFLEyg1+acEIKA0SdWBa9zu8buk11QUE73IaYq3soNcNRHvBsT xgAHmfsfdtVaoiKfiKHa76ofHfwtuU5bMdMpp7GGIPpdWUX95oi9SXSgAzp6joSF6mAn XQrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Fu8va02h; 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 f184si8005980itg.1.2017.08.07.01.55.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Aug 2017 01:55:42 -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.b=Fu8va02h; 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 1dedn4-0004Ey-1J; Mon, 07 Aug 2017 08:53:34 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dedn2-0004Eh-M0 for xen-devel@lists.xenproject.org; Mon, 07 Aug 2017 08:53:32 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 99/F2-01724-B8A28895; Mon, 07 Aug 2017 08:53:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJIsWRWlGSWpSXmKPExsXiVRtsqtut1RF p8OwUm8X3LZOZHBg9Dn+4whLAGMWamZeUX5HAmnHv5U+mglaBiiNT/RoYG/i6GLk4hARmMEp8 3HeOsYuRk4NFYB6zxO/HViC2hEA/q8Tvg14QdprE42v/WLsYOYDsSok5a/xBwkICWhJHT81mh ZjTxiTxbulDRpAaNgETiVkdEiA1IgJKEvdWTWYCqWEWuMAoMfPvczaQhLBAksSyPxPYIfaqSq w7NIEFxOYV8JZ49eg9K8ReOYmb5zqZQWxOAR+J85fesEAs9pa4fayPcQKjwAJGhlWMGsWpRWW pRbpGJnpJRZnpGSW5iZk5uoYGxnq5qcXFiempOYlJxXrJ+bmbGIFBVc/AwLiD8dVxv0OMkhxM SqK88SvaIoX4kvJTKjMSizPii0pzUosPMcpwcChJ8CZodkQKCRalpqdWpGXmAMMbJi3BwaMkw vtCHSjNW1yQmFucmQ6ROsVoybFh9fovTByTDmwHkq8m/P/GJMSSl5+XKiXOew5kngBIQ0ZpHt w4WAxeYpSVEuZlZGBgEOIpSC3KzSxBlX/FKM7BqCTMOwlkCk9mXgnc1ldABzEBHfQmsRXkoJJ EhJRUA2NSz6LEkpibOnr+haaLHKPfvG9cHCD5QUP1x+SjiXfCv9p8rz2R0bdywu5gG9Z7P554 fO77INUsOPnUAadILl1Zv1WfW0Njw+OV+Ju/+QQ8WNuwr8Hxz8ulmb0bG5XDza89XBF/yzmwb v2j/PBNmozZe7XuzdwUU8F3kPFv5kqRicVvFbZOYVNiKc5INNRiLipOBAASJlJlvAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-10.tower-31.messagelabs.com!1502096009!108174893!1 X-Originating-IP: [74.125.83.53] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18962 invoked from network); 7 Aug 2017 08:53:30 -0000 Received: from mail-pg0-f53.google.com (HELO mail-pg0-f53.google.com) (74.125.83.53) by server-10.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 7 Aug 2017 08:53:30 -0000 Received: by mail-pg0-f53.google.com with SMTP id l64so31596189pge.5 for ; Mon, 07 Aug 2017 01:53:30 -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=hEkKGCPm47FMsgYwL/NrMZbix4eTUybWDHit8lEDoDc=; b=Fu8va02hKPIVIuB4ZVop+qAafrH7LY18UBOZcmmVVH4B36oYu9xoa1GfausRlz0YQu sLrHSze/j+hsErYPmUH4qDzNrWP84TbKcBpeET/PTIn6yADww94M1r45Xb6DZDT5VXoz cxpqF92w4fodS1SWH948f33rP8neI9MlnUIGg= 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=hEkKGCPm47FMsgYwL/NrMZbix4eTUybWDHit8lEDoDc=; b=FjvAPeyGf9W7PIcRwxscI1GAB7cEX5Zisg9X33ou2kp2gK05GaUFfwsL8es/PCMmky nP8fMnRsVsYXXBkxGmwjU7gYZBRJXSp8vndjno2DLQcwdQ4qK3/6k05/BY7dBGaqRqk1 enOQwxmpMK1KrmzWCT72fR+XSTI5gni9VbrRf8AWV79Rt0Q3aoALU1dg2cB3K4/RwvIb i2Vt09UMe7YsY3W87SVNhYvoVaqADVUCLdUUt56ntebabfRVjMWQtTmJPQGBF49FxKGK skABhOQXi35zbc6kieafIBlDHZIWeXMvoyzbxPzSNi+FLco88JCH/gMMiBhERBoBZqJX KUNQ== X-Gm-Message-State: AIVw1117Y25MAo9oKXGtYzYgkKLHxT49TCIn2SU6vunJ2rlGVzSj5CqX LFRPoS3BGsHLKGHbljnNnQ== X-Received: by 10.101.91.70 with SMTP id y6mr10780458pgr.122.1502096009114; Mon, 07 Aug 2017 01:53:29 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id p77sm12604047pfi.153.2017.08.07.01.53.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 01:53:28 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 7 Aug 2017 14:22:53 +0530 Message-Id: <1502095997-31219-2-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> References: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 01/25 v7] 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 --- CC: Ian Jackson CC: Wei Liu CC: Konrad Rzeszutek Wilk CC: Stefano Stabellini CC: Julien Grall 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(-) 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/public/io/console.h b/xen/include/public/io/console.h index e2cd97f..5e45e1c 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,8 @@ struct xencons_interface { XENCONS_RING_IDX out_cons, out_prod; }; +DEFINE_XEN_FLEX_RING(xencons); + #endif /* __XEN_PUBLIC_IO_CONSOLE_H__ */ /*