From patchwork Mon Sep 18 10:31:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 112883 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3501090qgf; Mon, 18 Sep 2017 03:34:47 -0700 (PDT) X-Received: by 10.36.10.8 with SMTP id 8mr7362725itw.112.1505730887180; Mon, 18 Sep 2017 03:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505730887; cv=none; d=google.com; s=arc-20160816; b=R8Pb/MM32Of6Vw5sJeA/0Hn94m2sgDvy8YSKMwzv+Yixm1RyR8+9p6LMeAqk5gWSMh 2Zdb5jLDsE9wqxYgGt6uhkBTSP0kEJ/JrKuS/y2NzmCMLw/Jo7XGsEoD+FQltRscom1p /26A7f/Z2ar8ySqIlx/EMyiFLdK81Gyi6mMM0bj5nHiHEB4kT4y9rTWRxtapwTce+cOG +0AqO397v/icGBrVhd0/wt3kCfKsP+TT5naHo2P7R6uFbEHT2MnvnUEA8JhJCgftXlhp 39B5jtyFXlBaj2eR6zHJEPs+MjbgyzTC+dUErvWqACvijjUHeQuJ9gWH0P9laMfEaL0V e5sQ== 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=IxKPDvYb+1OabrIniZPQp+sl1Vg+m4VSWdbQZki1zo0=; b=bE8fTg0EooKU5Lt7tRODts2+5NBaciQzchbU03hBP7WHA4Fv/wkPQty2jhmy/KvoCf RE6cTPfXin7q+Zo73KAf1zeeUmiHyITtiJ7uEZy72ndVlsOCHZ9OOdisW9brXvMwUnjY 3oR+nkLNuigBLWZZtwe1vfM1zT2PMMaCiFJbUn5jMRkc+jOIu1BE6fXCHrgTMjKXjBeB qvoUKOA2KKv/OLv9FX22Nuu/2G81t3HWGRhKKyW/VvqOR2f2kaJQcwwIjwqRonCHhbxQ DYWlDqjP8Z2rMOyGE61iX3AXp8mHpT14/r6aHz09gRxenG0gR3aGf5/aIP1aI9Cy1VXe yu1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=GVvTav4B; 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 o6si5408594iof.95.2017.09.18.03.34.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Sep 2017 03:34:47 -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=GVvTav4B; 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 1dttLn-0001Z7-OV; Mon, 18 Sep 2017 10:32:27 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dttLm-0001Yv-65 for xen-devel@lists.xenproject.org; Mon, 18 Sep 2017 10:32:26 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id 66/FF-02048-9B0AFB95; Mon, 18 Sep 2017 10:32:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRWlGSWpSXmKPExsVyMfTAVt3tC/Z HGkz7YGbxfctkJgdGj8MfrrAEMEaxZuYl5VcksGY8WzCdsaBTsGLV7JPsDYyv+boYuTiEBKYz SvQd3cDUxcjJwSIwj1ni1AQnkISEQD+rxNy2pywgCQmBNIklV7sYYey9N6+zQtiVEvtn9bOB2 EICWhJHT81mhZi6g0nizf6tQFM5ONgETCRmdUiA1IgIKEncWzWZCaSGWeACo8TMv8/BmoUFki S6p3SxQFyhKtHW1scG0ssr4C1xoa8KYpecxM1zncwgNqeAj8T59Q9YIfZ6S8z7dYVxAqPgAka GVYwaxalFZalFukZmeklFmekZJbmJmTm6hgbGermpxcWJ6ak5iUnFesn5uZsYgQFXz8DAuIOx Ya/fIUZJDiYlUV7RyP2RQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4380HygkWpaanVqRl5gBDH yYtwcGjJMK7DiTNW1yQmFucmQ6ROsVoz3HhzqU/TBzHNl0Gkgf23AKSHTfv/mESYsnLz0uVEo eYKgDSllGaBzcUFquXGGWlhHkZGRgYhHgKUotyM0tQ5V8xinMwKgnzLgOZwpOZVwK3+xXQWUx AZ7Xs2ANyVkkiQkqqgXHrdcfIPRpbp58P98wsnfF2X+SyTStsExoYGpoWFcot+j37RmzDFLWJ Ya2p1ek/Z5/+JM5j/vb8//3mM32XzzRpq+A9fnPixt+tppeCqiQzHuQ/ufjhn5+D9JNF3vMfC Gd+yv7n+bLRWHJayrnFRZV1du/rpu/wT2Tf7fD5UsemE54XDd5qSoYpsRRnJBpqMRcVJwIAnD qc0dACAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-7.tower-31.messagelabs.com!1505730742!107735996!1 X-Originating-IP: [209.85.192.181] 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 48901 invoked from network); 18 Sep 2017 10:32:23 -0000 Received: from mail-pf0-f181.google.com (HELO mail-pf0-f181.google.com) (209.85.192.181) by server-7.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Sep 2017 10:32:23 -0000 Received: by mail-pf0-f181.google.com with SMTP id l188so29775pfc.6 for ; Mon, 18 Sep 2017 03:32:23 -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=kHjNQsBYLTEcMCSCGNjE7lavT4ilQV2qZ4hWRmdbIA8=; b=GVvTav4BMPYTtifQHDgHlzLAt+0y2Hy5rkI7HwVISWoipWHdgZbwXEUL3IGZblzcLM WQolRGHgkOMwxSI7SoPHR4GZoyirYg1zs68b89D4iuQZaAKpp54f40WARZ1pvNd4wNVn cBDtCQSrpsHHK/2hZUDmYn9ALrynHLRv1le18= 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=kHjNQsBYLTEcMCSCGNjE7lavT4ilQV2qZ4hWRmdbIA8=; b=lm2qihaEd2qe7txWtC8iGB3muXm5NQjIFip2fVzCZ5UxxL33YT35TZUsQl1Eus6zuJ h7gYLYoeTZLng2Nz6p7Irxe9iguUbctz4q7ESlhl2aZ5h5Ohtc8YSOkxxHaEQJfYx9UO OVLNLS6fb0N/+Z9VgTLlN6KOVv/JvIpdDtnG2d5CctLetj8V9Zky+B/AHLim8YCQ90Il WGqZ6YVFjwS6rPBabXwUmtt4LP8418kZQbk/8/cLyxFY4qS8LSmzV5vR3ou8qndH9iP/ DDN4Gq0szwyK5EsBUxHSYj1dXeMR2FLzedCPhAuRr1g2BTlutecmt3YK5zAaFzqJ6xcF GFSA== X-Gm-Message-State: AHPjjUitz/8g4u62k9w8InWm/cCdWSiYVlGWMx+FypR/FmlntvSZrrLe iv0NbvsC1ZRkJcVsqLlBPQ== X-Google-Smtp-Source: ADKCNb6UkpSTqlfM5qO3OeOwNLCdj8usaaaP12FuWcqxlmK2cHwt4xLypcoisetzpcnFoaY9hVBLMg== X-Received: by 10.84.238.196 with SMTP id l4mr35411418pln.63.1505730742113; Mon, 18 Sep 2017 03:32:22 -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 b7sm12937845pge.79.2017.09.18.03.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Sep 2017 03:32:21 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 18 Sep 2017 16:01:45 +0530 Message-Id: <1505730731-10947-2-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505730731-10947-1-git-send-email-bhupinder.thakur@linaro.org> References: <1505730731-10947-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 01/27 v9] 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(-) 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__ */ /*