From patchwork Thu Feb 23 12:45:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 142624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 01642B6EF3 for ; Fri, 24 Feb 2012 00:48:34 +1100 (EST) Received: from localhost ([::1]:56664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0Y4H-00047Q-Fc for incoming@patchwork.ozlabs.org; Thu, 23 Feb 2012 07:46:41 -0500 Received: from eggs.gnu.org ([140.186.70.92]:60331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0Y3O-0001ox-UR for qemu-devel@nongnu.org; Thu, 23 Feb 2012 07:45:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0Y3I-0000u8-A3 for qemu-devel@nongnu.org; Thu, 23 Feb 2012 07:45:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0Y3I-0000te-2t for qemu-devel@nongnu.org; Thu, 23 Feb 2012 07:45:40 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1NCjdom009823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Feb 2012 07:45:39 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1NCjXxd015090; Thu, 23 Feb 2012 07:45:35 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 4DAA941F23; Thu, 23 Feb 2012 13:45:28 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 23 Feb 2012 13:45:23 +0100 Message-Id: <1330001126-20564-10-git-send-email-kraxel@redhat.com> In-Reply-To: <1330001126-20564-1-git-send-email-kraxel@redhat.com> References: <1330001126-20564-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH v6 09/12] suspend: make serial ports wakeup the guest. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add a 'wakeup' property to the serial port. It is off by default. When enabled any incoming character on the serial line will wake up the guest. Useful for guests which have a serial console configured. Signed-off-by: Gerd Hoffmann --- hw/serial.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/serial.c b/hw/serial.c index 144d1b3..c0ee55d 100644 --- a/hw/serial.c +++ b/hw/serial.c @@ -139,6 +139,7 @@ struct SerialState { int it_shift; int baudbase; int tsr_retry; + uint32_t wakeup; uint64_t last_xmit_ts; /* Time when the last byte was successfully sent out of the tsr */ SerialFIFO recv_fifo; @@ -635,6 +636,10 @@ static int serial_can_receive1(void *opaque) static void serial_receive1(void *opaque, const uint8_t *buf, int size) { SerialState *s = opaque; + + if (s->wakeup) { + qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER); + } if(s->fcr & UART_FCR_FE) { int i; for (i = 0; i < size; i++) { @@ -884,6 +889,7 @@ static Property serial_isa_properties[] = { DEFINE_PROP_HEX32("iobase", ISASerialState, iobase, -1), DEFINE_PROP_UINT32("irq", ISASerialState, isairq, -1), DEFINE_PROP_CHR("chardev", ISASerialState, state.chr), + DEFINE_PROP_UINT32("wakeup", ISASerialState, state.wakeup, 0), DEFINE_PROP_END_OF_LIST(), };