From patchwork Fri Sep 22 08:23:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 113976 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3011059qgf; Fri, 22 Sep 2017 01:26:00 -0700 (PDT) X-Received: by 10.36.111.4 with SMTP id x4mr4746441itb.144.1506068760559; Fri, 22 Sep 2017 01:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506068760; cv=none; d=google.com; s=arc-20160816; b=fv1+dbKkKBKz84+zcLAq8aGcmZUro57OLf3ZIcBfdn7cuHwde7F3TCIU9B1KH6cxSk 070eimnwUISBNdUlppwjfJDmMffeZ1lOAB7dPzfH1RbZH35HkfkMYy2Gyn6MTiamqPSq 7sjmXBy+Vx5FlFI8MoObqnel6+AjfIGoY692K+gWvYhujy4jl4rthDks3SYd+6n7OEFM HlutLO31ZwKAyel6OClriW3GSfdNsObI9nPsVtnpUWBRQBGKKzPbJ9QgCYBvyEF3QGMQ GcuqbQmCsUbEa6ubDOlJRXwhUOMlGgCQ1eNuIY7wF4RwbgQCFFLrKFyvkK74Y+WOgnqw eGGg== 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=YsaW546s6pwgzhqde3ytLyO9uQIy3UsCYPaqWnVVZNE=; b=dJzlW5OqQdR+QdL3Dc4Cu+8JQdy/eo9alHHKH1nHolP1yunJhkATan7VzkKUFyCmJD 3n2DtujgRCEYurR4wGDdawYI8dPQV95cj4ktIoF/1yfLQ2aBAI1DujuvpaJ55J3KMFwQ BluijDrpnFzLx7s8aqCc6uDUxng6pYhjltuvm+EoUFn48wjwynUQlRBzHIGOSz60fxL3 VOVctvs7xvLP71bnEPnxAOJpptO814S7Dx6pneDPi+cCDL2jgLPBWiM/UpawJpn9p0Te rbJYQP3BFrgWTR/mX5YSz29vyrXwGbUb2I6jBNhTC53OzPkLJtG8L4E8U3jN1pL2fkrU H2ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aNNd7jwe; 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 12si3005031iom.58.2017.09.22.01.26.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2017 01:26:00 -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=aNNd7jwe; 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 1dvJFN-0003cj-4I; Fri, 22 Sep 2017 08:23:41 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvJFM-0003cN-2U for xen-devel@lists.xenproject.org; Fri, 22 Sep 2017 08:23:40 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id CC/50-03616-B88C4C95; Fri, 22 Sep 2017 08:23:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRWlGSWpSXmKPExsVyMfTABt2uE0c iDdat07X4vmUykwOjx+EPV1gCGKNYM/OS8isSWDPeTHjKWLBPoGLL/GvsDYxb+LoYOTmEBGYw Sixose9i5OJgEZjHLNFz4ggTiCMh0M8qsXj+UlaQKgmBPImHnz8zQthpEov/XGGHsCsl2mcvY IGYpCVx9NRsVgh7B5NE11zRLkYODjYBE4lZHRIgYREBJYl7qyaDzWcWuMAoMfPvczaQhLBAss S7nhVg81kEVCWOH/rEBGLzCnhL/Lz+FuoGOYmb5zqZQWxOAR+Jtf83QO31lth64yrLBEbBBYw Mqxg1ilOLylKLdA0N9JKKMtMzSnITM3OAPDO93NTi4sT01JzEpGK95PzcTYzAgGMAgh2Mx9/H HWKU5GBSEuV9fORIpBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3p3HgXKCRanpqRVpmTnA0IdJS 3DwKInwhoOkeYsLEnOLM9MhUqcY7Tku3Ln0h4nj2KbLQPLAnltAsuPm3T9MQix5+XmpUuK880 HaBEDaMkrz4IbCYvUSo6yUMC8j0JlCPAWpRbmZJajyrxjFORiVhHmvg0zhycwrgdv9CugsJqC zyleDnVWSiJCSamAUED/5bGbF9S07uVYdvR21+7N9PJ+HXPUt9fy1rXoeXQulORX6Fesm1UjK 2ubXlaqf/GElurvuKt/dhw7rPvcyyNu6KrqZrfQ4EjRxhq/yT5uAhBB701jrjFOBbz7eXfB+X lfBZeEapqBtMRYe538diJLm/esvKvxVpVPrCefbGW0Brw9Nf6rEUpyRaKjFXFScCACltGYc0A IAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-8.tower-21.messagelabs.com!1506068617!83978789!1 X-Originating-IP: [209.85.192.176] 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 62975 invoked from network); 22 Sep 2017 08:23:38 -0000 Received: from mail-pf0-f176.google.com (HELO mail-pf0-f176.google.com) (209.85.192.176) by server-8.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 22 Sep 2017 08:23:38 -0000 Received: by mail-pf0-f176.google.com with SMTP id x78so231497pff.10 for ; Fri, 22 Sep 2017 01:23:38 -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=m1XrBZB/btmlDP4Ti7Rax30SosocrCyN6adh9O5pCLw=; b=aNNd7jwecMaVyYFf0/x5CcFKXFRX5h3KSg6PkjyuqhjIhPBS9GCo6byqx3iMiz+O+m Rp9mAmfbJ5yaQtlh1iuv0o9JBtcVrhHppb9aLetHShxr/MeeuEhd570iWBdlp88TV4gj +mRpoyIUXF6SCHX+/2hkJWsnXPryL8GwZ61KQ= 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=m1XrBZB/btmlDP4Ti7Rax30SosocrCyN6adh9O5pCLw=; b=eC6sz/tIyfRzUl2B3vv9zplMeGmv1tOg4yAoL9BZpD6shrIeR0LmGTFHOGZmU4j2mt Vg1Fa35AA9dl7ydviQn/yTOvXAbvOe9QGQRgTIF9t1IOnIXKQTdEKQLyclZbWLheH0NU eWBMFy6rbMNE1PRpCL6AKPVAYolctPgggNfJjljHY/Z0dXf53MAhFrmCrqDx+nGL1jQc RLkMj77N2YlnwyYEGG5U6TeyH2tJBzao6kFyho48jVwc4/eOuvi4++MfOGIo3seu7ZTW FEZD66fCzjXGy1Anl7nSnql10Vx9iKYtXAKNYjXTL2dEtxTu/WbQBHd4FuU6fnOF6JN3 MAyA== X-Gm-Message-State: AHPjjUhsUK11r+p4phl0wmTm306VStF8bYTe/JWBwfK6XzmooDoqY4By VwK5qTXWbCGwOgjLPdjzFPuz6gv7kYM= X-Google-Smtp-Source: AOwi7QAM2XWIwE2Nwcja88WDdcgpxichJvlGPvGQKN0hUfHqrY9B9SrlglnfBRLSu5D5xArFVbE0Uw== X-Received: by 10.84.224.136 with SMTP id s8mr8374622plj.324.1506068616999; Fri, 22 Sep 2017 01:23:36 -0700 (PDT) Received: from blr-ubuntu-linaro.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id f74sm5569284pfa.36.2017.09.22.01.23.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Sep 2017 01:23:36 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Fri, 22 Sep 2017 13:53:00 +0530 Message-Id: <1506068606-17066-2-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506068606-17066-1-git-send-email-bhupinder.thakur@linaro.org> References: <1506068606-17066-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 01/27 v10] 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 --- 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__ */ /*