From patchwork Thu Jun 22 07:38:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 106163 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2327108qgd; Thu, 22 Jun 2017 00:41:14 -0700 (PDT) X-Received: by 10.36.46.210 with SMTP id i201mr673281ita.77.1498117274743; Thu, 22 Jun 2017 00:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498117274; cv=none; d=google.com; s=arc-20160816; b=U7Lcwv2YH/cxh0Vci0I3+IAHVaPPjxCSF4t6fhIi4F73fXIuf+RbAhzDrTxD0ZPGh+ MkpIo3sPmIn1w4yN2z/hCegUVLkqzRHtcjCkWxfGlqAju+8rYq3urE8tTriAv027eG/4 +1kmG51NcrY3uqBXgRkA2YE4dr3LJ2+zYJAtyUqPBkCyGlQ8uxD4BoARuR0x/GOHLF1I LQbdQUUhc+EYWinkl3W4i/zVDjD1T/hPGyedhkhlmVarDTsdHAku3FcqDPRtFrwJO17r wmdPKYa1hIY4XbkGqsbYAdWEa466TYRqU5owORN1KyI8+xuXfKBrv65SY6qLs9Owae5p OTGw== 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=LqHhFkknXFR4Dg6bBrC/Piodwx58G/y6IoavXVL7oTs=; b=UixAkw594mUnGO5XledPFXTfi1c4ONvuQ6K+Rk1FVAUNZtNd5AA3k+Oz8G/q11DUkr iOI6rfWW2PsT5myS95lHFNuC59ukSFLFN1k3YKgBNKmLpsWoSqMQ0OAxOH35me3b6NPT Y2Nli9TnN9gyuCJP9d3oe9/AdCAt2z3C/t91r8B0VViIoAP8mlX+qV9rx1kz01D4ukXQ r9i08vj9369mLB9O/Z79UZeGnZzrqnIO4TPdB6uabDOqHUTSVJebUdjVPXeaPJbrH/lf mwbJATRUz8LwpazpH1hCkIcGkWzn/vWFHuZhaqIZP9bfvF4FYtTTHsIf0mIctA6BnHe8 UDRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=h2FcZeOS; 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 p73si380887itg.4.2017.06.22.00.41.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2017 00:41:14 -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=h2FcZeOS; 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 1dNwhr-0005Nk-O1; Thu, 22 Jun 2017 07:39:11 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNwhq-0005NB-Jp for xen-devel@lists.xenproject.org; Thu, 22 Jun 2017 07:39:10 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id 00/64-03620-D147B495; Thu, 22 Jun 2017 07:39:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDIsWRWlGSWpSXmKPExsVyMfTANl3ZEu9 Ig0OrJSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1owTW74wFSzmrzg17xZ7A+My3i5GLg4hgRmM Ei/OnmEHcVgE5jFLPD3wiQnEkRDoZ5V4fOAzcxcjJ5CTJrG0u40Rwq6U+NG9HcwWEtCSOHpqN ivEqH1MEpsmvgdyODjYBEwkZnVIgNSICChJ3Fs1GWwos8AFRomZf5+zgSSEBZIktqz/zA5Szy KgKvH9lzhImFfAW+Lg/ntQe+Ukbp7rBLM5BXwkVuxYyA6x11ti15nJLBMYBRYwMqxi1ChOLSp LLdI1tNRLKspMzyjJTczM0TU0MNPLTS0uTkxPzUlMKtZLzs/dxAgMLQYg2MH4Y1nAIUZJDiYl Ud7/ed6RQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4lYuBcoJFqempFWmZOcAgh0lLcPAoifC2g LTyFhck5hZnpkOkTjFacly5su4LE8eG1euB5JQD278wCbHk5eelSonzioLMEwBpyCjNgxsHi8 RLjLJSwryMQAcK8RSkFuVmlqDKv2IU52BUEubVLwKawpOZVwK39RXQQUxAB7044gFyUEkiQkq qgbFLcHqxy3x2UVWX+Zz9zVf1vq4In7f++uzM026MRyXWfZC4njplp9CEzCOJBlFh0prFKX9c XbiFxDWfPKxM5S61XdB3OlQiTj1evGyXXEzXhC2/Nr2TWq0mcMo995fTnI+KxVMEinuDL9+Y+ OD8lK3f/r3y3vFk1aP7JypPppcwHWh/lMAsvk6JpTgj0VCLuag4EQCnAT00vwIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-2.tower-27.messagelabs.com!1498117148!49350367!1 X-Originating-IP: [209.85.192.182] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63132 invoked from network); 22 Jun 2017 07:39:09 -0000 Received: from mail-pf0-f182.google.com (HELO mail-pf0-f182.google.com) (209.85.192.182) by server-2.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 22 Jun 2017 07:39:09 -0000 Received: by mail-pf0-f182.google.com with SMTP id s66so5117056pfs.1 for ; Thu, 22 Jun 2017 00:39:09 -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=YEwV4bXwOQaqrhMbEmQHrtWStXWS41PA5Oyrxmf+y5I=; b=h2FcZeOSTOCjLOwGBB7qv8ZxV4S+V1QdygKDCWh21VnsXy2EcWdDBbMkmuMoQAoiSf jRX2RwGnqyvETxeQ2+Su/nau/NvyN/6k8if5TZ5v1CoY+8jd58myxTDpvUlwfSgieOqv 1FiFMEPqO4TEXmaozTFaRuMmegXYRX+yFKruM= 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=YEwV4bXwOQaqrhMbEmQHrtWStXWS41PA5Oyrxmf+y5I=; b=r7dHI1zboDUzqHkqi0IxVyQcll8hjrSZry6xx8v7h8w37RF7zWVDMcSzDxKmEhXhth HyL4YFh/3isSBHhRO7l7FGowH6ndnmzGTIghql9TQVLSe3dEcfiACg6K3LS0U2N2o2TX FSzJBWLMXbGN+VHhtPSQeY9TYMpCycZqlF9mIKVvCZt75Z/FPhsOssj2kke+nPOnh+UY AmYT3/I1GLyk7WMivXtajmSjasBKuo1Z44fows2cCOdw7ew6TDSCoUUPYVbHfMHUh692 +iXAynIu6ujRbaXevHitlyCtyv9kxIhUZYGa44v/fXlBN9kyoISsyPsVUH1/+KiRwEzy R7rA== X-Gm-Message-State: AKS2vOwiCpwb5hmZkjNtaHDyRB31aTMFjAZvq2MyvKyOaJMtxNHXFA1S Dn6sUDMhcZXsIvXEiOVuXg== X-Received: by 10.99.123.17 with SMTP id w17mr1271022pgc.100.1498117147538; Thu, 22 Jun 2017 00:39:07 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id w69sm1883591pfk.107.2017.06.22.00.39.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Jun 2017 00:39:07 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Thu, 22 Jun 2017 13:08:38 +0530 Message-Id: <1498117132-27139-4-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498117132-27139-1-git-send-email-bhupinder.thakur@linaro.org> References: <1498117132-27139-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 03/17 v5] 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/consol.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__ */ /*