From patchwork Wed Sep 27 06:13:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 114323 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4665097qgf; Tue, 26 Sep 2017 23:16:37 -0700 (PDT) X-Received: by 10.36.162.14 with SMTP id j14mr818628itf.52.1506492997256; Tue, 26 Sep 2017 23:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506492997; cv=none; d=google.com; s=arc-20160816; b=NiQnMLgvQkeQwza2jul++2ys1WiUwBz+N9IW4Ne0Bb7ftolVZVP2DlJZ/Qr0nrHvj/ FVTPpsFaFQBSyEFclg0irqiJg6CWAFp9c6r4B8kFkU7+Lo+g7JdpN55rufEgWN09Wiiu +wd4oDKi1bldBywTG33HPJzANIB7WBoakMUuSuBIe96dfCv/ea/dCLCkmhmQ01sVGiDL ZYSHxQAvSa6ni3O2eRzTqIn1mtbk3RFhuCIOPn6BMZHAmPnOodAGZ3npJb19kaWrikQG W+RbFXDcY30iRRjSf15sP1PY9X1PdLui8F/gtpQPlIjq50rwokU9Q4wg0TEc9gUOwwsT 609Q== 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=H8RR8P9mLK0Yb6u6N61ymtzG/1SrqORpSqVSo+gXTcg=; b=H6a5aAYVM5VWiZL/6//7SE5OAqmOplcu4xioQEFBUnkfnsAi3H1ZN1YSj2Z9dptMYQ k+oUMRcKp3jZXsmAR5TYltCKIRKNTHHeBY+H+xbUrTfHz4z/QciidxJvYFjN/QSaHVI5 r+/TVoUlIPtUlvl+WolFrqHaJ7YT4wRz2WuLKnQ+tRbvF+l6frr2CHIGPAA8vSALQZSa tM6Qh028BZxRlduDKk2fueDwrvagNfuOyC4+Dw62JY1MjF0N3d7YdD8HBxCn2GYhQ3js gKl/P8ILV0SsPYeijexre6QS+vZ8z3RnQdFtAUKmyhfO8zrQwmkYAZQA80Ctk9JdFXR3 Gc1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VhK8se8r; 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 f5si9012571iob.38.2017.09.26.23.16.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Sep 2017 23:16:37 -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=VhK8se8r; 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 1dx5bl-0002vi-KJ; Wed, 27 Sep 2017 06:14:09 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dx5bj-0002sY-U6 for xen-devel@lists.xenproject.org; Wed, 27 Sep 2017 06:14:08 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id 5F/C8-03642-FA14BC95; Wed, 27 Sep 2017 06:14:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRWlGSWpSXmKPExsVyMfTASt1Vjqc jDY79NLT4vmUykwOjx+EPV1gCGKNYM/OS8isSWDNmrbrCUjBBoGLF1/0sDYxbeLsYuTiEBGYw SrybvJ8RxGERmMcs8e/0KlYQR0Kgn1Xix+1JQBlOICdP4uDX/1B2msTeeYeZuhg5gOxKiV0rt UHCQgJaEkdPzWaFmLqCSWLO9cmsIDVsAiYSszokQGpEBJQk7q2azARSwywwn1GiaVIvG0iNsE C8xLaGQpAaFgFViccTmtlBbF4BH4mpS1uYIdbKSdw81wlmcwLFT/ffZoPY6y1xaWU/6wRGwQW MDKsYNYpTi8pSi3QNjfWSijLTM0pyEzNzdA0NzPRyU4uLE9NTcxKTivWS83M3MQIDjgEIdjB+ WRZwiFGSg0lJlLfm/6lIIb6k/JTKjMTijPii0pzU4kOMMhwcShK8NxxORwoJFqWmp1akZeYAQ x8mLcHBoyTCKwgMfyHe4oLE3OLMdIjUKUZ7jgt3Lv1h4vjSewNIHthzC0h23Lz7h0mIJS8/L1 VKnPciyFQBkLaM0jy4obBYvcQoKyXMywh0phBPQWpRbmYJqvwrRnEORiVh3rsgU3gy80rgdr8 COosJ6KzeqSdAzipJREhJNTDujWKI1dNvYfV4Ku1jdfrdzEy2tytd8nxfVfmJaihqhMn9W9r+ Of6povVJVaHtz0w673Nd/XFBI8k7lzNHbMrlS4td/I4LN9pszxIW2eSZ/txPZP+ypUxes87s/ cryfVkGq5TAFLntwSFnJ66Src2SsoiWKNGPmu9U83NXsLtNy8U8v/cJzUosxRmJhlrMRcWJAO vRRInQAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-15.tower-21.messagelabs.com!1506492841!84633288!1 X-Originating-IP: [209.85.192.169] 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 11694 invoked from network); 27 Sep 2017 06:14:02 -0000 Received: from mail-pf0-f169.google.com (HELO mail-pf0-f169.google.com) (209.85.192.169) by server-15.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 27 Sep 2017 06:14:02 -0000 Received: by mail-pf0-f169.google.com with SMTP id r68so6749885pfj.3 for ; Tue, 26 Sep 2017 23:14:02 -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=cKW4VVAXHwcprLM7odui2WUoZIfS5KdXFh4XFIsCHUU=; b=VhK8se8rypn7NESe113iUn5HBt4d+ZSVfKzGUM1I2Ih8dNVOrEBEgihpZYGO1NjyK2 vkAp2jimjfcvtbnDTDDQNwMnNSRvvxXv7MOdYFANh4AZsH9zQDwQyPoUE3T92igCRh1+ MNpRgRZYpi2kgEdUfCDAPWbU0iUsIgJCvrg5U= 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=cKW4VVAXHwcprLM7odui2WUoZIfS5KdXFh4XFIsCHUU=; b=KSJ+vOi/ob7eg06jaBrwDk3DC0z81j/S/nsC3bupf3O88tdmrbUxtU9g65rR3hhRIl Kg+VS74YW6PmyHwQZ08wCj/vs3blLfYgqNs7VJ1mu1bM4NevK0KZTBVoNWmUC4DBTYXy NfN7hojnO+ro+n7KdnzvalIX/2PM6Yt1+BI8bu+FM46/PbhflXqYuhc6ICwbffDDNZvY S0Sp5BLLWBCN7GfRJ/Y6142V0wVkxmmGYvKyrArUfrXVy/CKzhA3HRziirP6V19MyM3R LmCojRXo86f5rJjvHEM7SdhUOTzSVBz1tXU1sowepvrDGFIOtKmlWYvm96I28LAe4ZE+ BJbQ== X-Gm-Message-State: AHPjjUi5KAJBxqd2eLy1HXeSM/H1xhHxPw57mm5hHV7pT1enQvwSN8GR Vh2MB4ZIFsAzk/ICkCBOCxHyZAXvz7U= X-Google-Smtp-Source: AOwi7QCFGlhCBwAUE9k/AjHyV7pwvnOZvC6uzolG/dhVCrR0GI9MbSaYxKs1+9nPmt0R53lJSPwwzw== X-Received: by 10.84.218.141 with SMTP id r13mr302733pli.271.1506492840926; Tue, 26 Sep 2017 23:14:00 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com (h3.248.139.40.ip.windstream.net. [40.139.248.3]) by smtp.gmail.com with ESMTPSA id s187sm18013485pgb.82.2017.09.26.23.13.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Sep 2017 23:14:00 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Wed, 27 Sep 2017 11:43:26 +0530 Message-Id: <1506492816-25954-18-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506492816-25954-1-git-send-email-bhupinder.thakur@linaro.org> References: <1506492816-25954-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 17/27 v11] xen/arm: vpl011: Add a new handle_console_tty function in xenconsole 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" This patch introduces a new handle_console_tty function. This function performs read/write from/to console tty. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall Changes since v5: - Split this change in a separate patch. tools/console/daemon/io.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index c361b42..5c6da31 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -1130,6 +1130,24 @@ static void maybe_add_console_tty_fd(struct console *con) } } +static void handle_console_tty(struct console *con) +{ + if (con->master_fd != -1 && con->master_pollfd_idx != -1) { + if (fds[con->master_pollfd_idx].revents & + ~(POLLIN|POLLOUT|POLLPRI)) + console_handle_broken_tty(con, domain_is_valid(con->d->domid)); + else { + if (fds[con->master_pollfd_idx].revents & + POLLIN) + handle_tty_read(con); + if (fds[con->master_pollfd_idx].revents & + POLLOUT) + handle_tty_write(con); + } + } + con->master_pollfd_idx = -1; +} + void handle_io(void) { int ret; @@ -1260,22 +1278,7 @@ void handle_io(void) handle_console_ring(con); - if (con->master_fd != -1 && con->master_pollfd_idx != -1) { - if (fds[con->master_pollfd_idx].revents & - ~(POLLIN|POLLOUT|POLLPRI)) - console_handle_broken_tty(con, - domain_is_valid(d->domid)); - else { - if (fds[con->master_pollfd_idx].revents & - POLLIN) - handle_tty_read(con); - if (fds[con->master_pollfd_idx].revents & - POLLOUT) - handle_tty_write(con); - } - } - - con->master_pollfd_idx = -1; + handle_console_tty(con); if (d->last_seen != enum_pass) shutdown_domain(d);