From patchwork Mon Jul 17 13:06:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 107938 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4495023qge; Mon, 17 Jul 2017 06:09:23 -0700 (PDT) X-Received: by 10.36.0.147 with SMTP id 141mr5495157ita.113.1500296963848; Mon, 17 Jul 2017 06:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500296963; cv=none; d=google.com; s=arc-20160816; b=UaHly6rTUmMRzoKOlex86rUG4y+6ANWMQOyqqDuqvkf4rJk/s8x1A0aQ0m1UyOCywu 1G3Uf7vmdtbifpa/3pjr+pB/FUXUyyXO31p9gLW/PD0cZv8kPX1Q8xVHC8ZgLndCariL zY4sn9QIkHtesXboX+hBsIn6PH5/STZRpO3Wf9IPaL513/rNChli+W8MdhdmmeZ8FNL8 wSn5T1ei7UZMy7R+1zwYU5AIBshGzV0nzYzoCIj43H5OgFJ1lKqBFXTHudVSgI3fYFmg NPUpwejIc1rsQ/kcJTnSJ2/DqmdrfhVKhReZnShcI0sKFp/7EBmWcDU8hj3W1Y4txMcf MYHw== 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=j3o3LzdrlXsGpbUJYw71jHwY3+feWpnbG2FZ42yXrB4=; b=KDunuoqUMcB5ogpYCIYW/vmMpO6/jDfPUWCts8lNM8gvwTj2NpeE48lHaU9E8NyLq4 8ilSWjiq5nEOgfRVk0fPOtdTdbheLYys1jZdK/jxsZM1nUeCgJCdQwiyZwYksOHHL7zX xE7odjnI3P6TEmfXrty1eM/3b/4qDvxrx6+D47rpfZgveO0k1MxqdCGoNVnZ5jc35RAX 5XdD030B7tHeUvYxapfOIxnOw/RJpvOlAAZp8IezPICc/ILE5J+vpFGGsrrQdgRrtfbw 4Y/Gg1HKjbCmKQDgq5/cxsxVcSKVMBhCKlq7C/I6NiY3A6fNu70RpdEzQGjWabGshyee IDEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=WlfS7K5f; 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 i41si17184702ioo.203.2017.07.17.06.09.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 06:09:23 -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=WlfS7K5f; 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 1dX5ki-0004m7-Up; Mon, 17 Jul 2017 13:07:56 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX5ki-0004kb-6x for xen-devel@lists.xenproject.org; Mon, 17 Jul 2017 13:07:56 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id 9C/D6-27137-BA6BC695; Mon, 17 Jul 2017 13:07:55 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsXiVRtsqrt6W06 kwdY5TBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8ab0/UFK/krHiy5xN7AeJWni5GLQ0hgOqPE x49v2EEcFoF5zBJzX/SzgDgSAv2sEl9OzwLKcAI5aRIPN21jgbCrJL7MeglmCwloSRw9NZsVY lQrk8S1J8+BHA4ONgETiVkdEiA1IgJKEvdWTWYCqWEWmM8o0TSplw0kISwQJ7Gp7SjYAhYBVY m3rRfBhvIK+Ej0951ghlgmJ3HzXCeYzQkUP7NhNRPEYm+Jm0cmMk1gFFjAyLCKUaM4tagstUj X0FQvqSgzPaMkNzEzR9fQwEwvN7W4ODE9NScxqVgvOT93EyMwtBiAYAfjt2UBhxglOZiURHkv smVHCvEl5adUZiQWZ8QXleakFh9ilOHgUJLg3bw1J1JIsCg1PbUiLTMHGOQwaQkOHiUR3q0ga d7igsTc4sx0iNQpRmOOSQe2f2HieDXh/zcmIZa8/LxUKXHeFSClAiClGaV5cINg0XeJUVZKmJ cR6DQhnoLUotzMElT5V4ziHIxKwryZIFN4MvNK4Pa9AjqFCegUYV+wU0oSEVJSDYyyx5Z5vd0 qP+O7zJrAmqy68AfPL3Tnl+j9vnsz9v37bTfmdE12eHm5RmSu7KtvH7itPH2fZb89/zoqzYrv r/7vAiH1ZXO2nXBdIOnQ0fMs4omKklRx9CK//VueKE29NSFgy7nHHqrCTBJO2aYfVadeMZDev 1jjnR8bi1FY3cliw4X/frSkap1VYinOSDTUYi4qTgQAlHw/h7kCAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-13.tower-27.messagelabs.com!1500296874!97992867!1 X-Originating-IP: [74.125.83.53] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 43691 invoked from network); 17 Jul 2017 13:07:54 -0000 Received: from mail-pg0-f53.google.com (HELO mail-pg0-f53.google.com) (74.125.83.53) by server-13.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Jul 2017 13:07:54 -0000 Received: by mail-pg0-f53.google.com with SMTP id 123so6572432pgj.1 for ; Mon, 17 Jul 2017 06:07:54 -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=JHD4TzvomNM6NaYwRVbF1nslo77q0LGaKotBxN/IgzA=; b=WlfS7K5fkAJ2R8AnNtfSsNscTaFC4n64DSU+Xl22Znv/MosO9i2qVY6OzLeFpFaP/S DhVuftB3qkepX8phriytCKcOU7tUchFnWZMn8s3NFPkMSui1vIB9WDjgda5qBSpUBLai Z2eQJlcLJlKExiSUG/B3/r1xbcjmavXp0ii+k= 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=JHD4TzvomNM6NaYwRVbF1nslo77q0LGaKotBxN/IgzA=; b=DnR1nDS21kR3PTnuxrKVNJZPtYL87MLGTtV3TjeTEsu5cwaXnZ81qGsMIEXCdR7ul+ LjUjjMa8cTOnqKRVBbIL1nwei97A9ozp1VPDk0n0OsU3phQYw1VqtR7WYPSjtE5z0m+d WIWT4sxO4NT5UaTxWwwBFDfmlcXYfIzHaVT8B4PyaNdCc9mL4OO42LxkR0385G7jfZtj IT9Vl12imvvkRV4QJAJrw0h1hbJyCkmROBKs/qqTu2EkhMJ9G+WI0K+uTfrEgogcbRNb R2Bi4HT1/bn0i4uuMsND+Dp4XcJRlPV/tpebNf5reMZryeMWND2+3o6S6IVIXSPEoF5P /zdw== X-Gm-Message-State: AIVw1119F0kaLyRdv9K1uZbP4S9sARYeDW+WFsdQkd2KtjBe1TWPAjlf zi1aLENbtbgikSZAqTk72Q== X-Received: by 10.98.69.219 with SMTP id n88mr18806284pfi.192.1500296873419; Mon, 17 Jul 2017 06:07:53 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id z69sm15705665pgz.42.2017.07.17.06.07.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 06:07:53 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 17 Jul 2017 18:36:47 +0530 Message-Id: <1500296815-10243-18-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500296815-10243-1-git-send-email-bhupinder.thakur@linaro.org> References: <1500296815-10243-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 17/25 v6] 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 Acked-by: Wei Liu Reviewed-by: Stefano Stabellini --- 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 775fb04..4097673 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -1133,6 +1133,24 @@ static void 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; @@ -1263,22 +1281,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);