Message ID | 1505730731-10947-13-git-send-email-bhupinder.thakur@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3501210qgf; Mon, 18 Sep 2017 03:34:55 -0700 (PDT) X-Received: by 10.36.95.5 with SMTP id r5mr17619923itb.9.1505730895109; Mon, 18 Sep 2017 03:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505730895; cv=none; d=google.com; s=arc-20160816; b=C+M3fM6v4IFr7sw7mI0I/Kc1bKyxaTcH3cZ3FpujE/FpxDX7F7pUxU9RS9pSkViAyL 4KARtNPy71SWZeNx50XvRrgacwTqwUj8gm60lYplhVNFBeXyOnLGj7ldoTQIeLdInrkh OhQYZFpxG1O8m2QAAyb/ACaFTGpOrF27i7xCmZA7SlLTDAGy37mg1+zayXeyI6kxoZsN CMpFiz8YuRXZ9KxezEeqYBM92S8ZUzkiPDNCnQLkcEJ/VKaXjDpRocHW0fsym3rEzZpC RbIWDkAgLEpQlAnU5TwooBlVGCHMUJOWCneKPNhI2aaZWZ5a2orz9+h1dhzPFi+4XqPT TtYA== 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=RBIonTcOwRkHLeFjaA/5ZTqVDWSkdEy4IXZH98gtXnM=; b=BEhgXDIx53zFQoDBZBvqwc6sRf2Ecy5qELbzlTBFkL2f/DYnBvhc2RjFP3KSkHQt9T Vfy6k0PN4pTMe2dS0wlV/NnmkErIsjCvPY2/EobQBbslGxP5dtIZ2R9cBfFF71R7A0zy O77FoBID6fH2IlZa37VZqKHIrtx6PVOW2BEfAP5KePTAysPj+35mp2dAwL7wuw8U1z2E vCSYFpFGDiwdaomD49EQ+PeO/sqi29j0k4CTlDnmggEW79JHwyEJmALZJrrW3brwcYk3 eI8GVhoTAem5qdE9QymgEr2Jm3ZwjousOwTvD6D9BH06LDMoetx/YZyGn33hNcolCZN1 9dMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DOmhUFMd; 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: <xen-devel-bounces@lists.xen.org> Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id j135si4411292itj.37.2017.09.18.03.34.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Sep 2017 03:34:55 -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=DOmhUFMd; 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 <xen-devel-bounces@lists.xen.org>) id 1dttMK-000242-7w; Mon, 18 Sep 2017 10:33:00 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from <bhupinder.thakur@linaro.org>) id 1dttMJ-00021N-5y for xen-devel@lists.xenproject.org; Mon, 18 Sep 2017 10:32:59 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id B0/34-01778-AD0AFB95; Mon, 18 Sep 2017 10:32:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRWlGSWpSXmKPExsXiVRtspHtjwf5 Ig7nTjSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oy9l+8yF3zjqbj4fD1bA+NDri5GLg4hgWmM EncXHWECcVgE5jFLbJ8yD8yREOhnlfi3ax17FyMnkJMm8ffdRFY4u3M2E4RdKbHi5HowW0hAS +LoqdmsEGN3MElsmbgHyOHgYBMwkZjVIQFSIyKgJHFv1WSwBcwC8xklmib1soEkhAViJC50PA JbwCKgKvGp7yyYzSvgI/H5TivUMjmJm+c6mUFsTqD4+fUPWCEWe0vM+3WFcQKj4AJGhlWMGsW pRWWpRbqGhnpJRZnpGSW5iZk5uoYGxnq5qcXFiempOYlJxXrJ+bmbGIFBxwAEOxhX/3Y6xCjJ waQkyisauT9SiC8pP6UyI7E4I76oNCe1+BCjDAeHkgSv1nygnGBRanpqRVpmDjD8YdISHDxKI rwWIGne4oLE3OLMdIjUKUZjjn17bv1h4ui4efcPkxBLXn5eqpQ47zuQUgGQ0ozSPLhBsLi8xC grJczLCHSaEE9BalFuZgmq/CtGcQ5GJWFeQ5ApPJl5JXD7XgGdwgR0SsuOPSCnlCQipKQaGA2 a+A3PvDZacffVkgNLfnHy77uk9bPK8X/t5fZSzc/LM+0Ckrds5ApaYKt4x9u4e4XcnwKdFxxd 6cdPsU52a82YxRyrMLtFQ9KWf6apQaG3F+OUquhaBu2Gjyv7bvbmXcgRUtoU9ubCwQlPPCveb ZCsX7FqV8n0KEeb8vIA+8Or3O6V+JgfV2Ipzkg01GIuKk4EAInhdm7GAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-10.tower-31.messagelabs.com!1505730775!114591538!1 X-Originating-IP: [74.125.83.50] 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 38069 invoked from network); 18 Sep 2017 10:32:56 -0000 Received: from mail-pg0-f50.google.com (HELO mail-pg0-f50.google.com) (74.125.83.50) by server-10.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Sep 2017 10:32:56 -0000 Received: by mail-pg0-f50.google.com with SMTP id i130so34519pgc.3 for <xen-devel@lists.xenproject.org>; Mon, 18 Sep 2017 03:32:56 -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=yB+nxIvgk8UjZRr/CwimK1H7zFddzpCzBRq7KGA1phI=; b=DOmhUFMds7R2zbi+kft6wWR5/sPlETIpk5A98hO33G1soG6CGLrdsU/b3GILO1BNzE W3CwG4UwXQ7dZhh5oyTZZlfrPrtPJd4xxH6B9HqlvGXISJc+HvMgpZztEtCL/TvnZfg9 Mnvgqtj+fwDWO+okaXXYs9jjvW3WFUOxf8e1M= 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=yB+nxIvgk8UjZRr/CwimK1H7zFddzpCzBRq7KGA1phI=; b=NOPIMleB04b+wuaX2lIO1rhH7ga17puWvkq8Xwe2wKiHmITQHpZor42td4AlMjG5rD /E8oOSdYTyAKjNqbGui3fGlAS1zpPnmDArxYvqcw0WeMuoALjH+0QG5SpiegmP+Giu2g 0B8rQXncBVYVsUwHE1CrwFKBAXcAReC2XFcM8Skv34xcgTIDoHR/STtrOd6BPkUnsPNd UxWcIVXWyN4X/rxoMTVRVCj0gR27UEoX/4UZxpvtwMA7gh4vE1VOkMwso2j/fIR7CCc8 +nRHHMwPKBC7Yt+/IEKOlIGwNEXA82dUR+DPWKZrYY/8ssnNsWJVR87cwviIjkssAPwK EZYA== X-Gm-Message-State: AHPjjUhgL7GskAhXsY44A40zM6ZzeyNgHSO0wb3J7h9QZ3Yy9jYoBg8n Km6XQfeSYu02x1FERZzKyA== X-Google-Smtp-Source: ADKCNb6D+slg+qmqUIU0JAB9Es4mRB951xSoEf03m+GLTRn8iobwL/GdTjRsn7LCpM0xQe/vJ0yAqg== X-Received: by 10.98.62.131 with SMTP id y3mr31097475pfj.178.1505730775135; Mon, 18 Sep 2017 03:32:55 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Sep 2017 03:32:54 -0700 (PDT) From: Bhupinder Thakur <bhupinder.thakur@linaro.org> To: xen-devel@lists.xenproject.org Date: Mon, 18 Sep 2017 16:01:56 +0530 Message-Id: <1505730731-10947-13-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 <wei.liu2@citrix.com>, Julien Grall <julien.grall@arm.com>, Stefano Stabellini <sstabellini@kernel.org>, Ian Jackson <ian.jackson@eu.citrix.com> Subject: [Xen-devel] [PATCH 12/27 v9] xen/arm: vpl011: Add a new buffer_available function in xenconsole X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xen.org> List-Unsubscribe: <https://lists.xen.org/cgi-bin/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xen.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xen.org> List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help> List-Subscribe: <https://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xen.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" <xen-devel-bounces@lists.xen.org> |
Series |
SBSA UART emulation support in Xen
|
expand
|
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 1da08d7..0009bbe 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -163,6 +163,16 @@ static int write_with_timestamp(int fd, const char *data, size_t sz, return 0; } +static inline bool buffer_available(struct console *con) +{ + if (discard_overflowed_data || + !con->buffer.max_capacity || + con->buffer.size < con->buffer.max_capacity) + return true; + else + return false; +} + static void buffer_append(struct console *con) { struct buffer *buffer = &con->buffer; @@ -1120,9 +1130,7 @@ void handle_io(void) con->next_period < next_timeout) next_timeout = con->next_period; } else if (con->xce_handle != NULL) { - if (discard_overflowed_data || - !con->buffer.max_capacity || - con->buffer.size < con->buffer.max_capacity) { + if (buffer_available(con)) { int evtchn_fd = xenevtchn_fd(con->xce_handle); con->xce_pollfd_idx = set_fds(evtchn_fd, POLLIN|POLLPRI);