From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Wjn-0004Ju-Qk for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9Wji-0007li-0g for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:42:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Wjh-0007l8-Oi for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:42:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q867gnOi010579 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Sep 2012 03:42:49 -0400 From: Gerd Hoffmann Date: Thu, 6 Sep 2012 09:42:46 +0200 Message-Id: <1346917367-24691-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1346917367-24691-1-git-send-email-kraxel@redhat.com> References: <1346917367-24691-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 3/4] wakeup: make serial configurable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann serial port #1 gets gpe 0x0a. Now that the wakeup is guest-configurable via acpi we also enable it unconditionally. Other serial ports are unchanged: they continue to use the "other" exit reason and are disabled unless explicitly enabled via wakeup property. Signed-off-by: Gerd Hoffmann --- hw/serial.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/hw/serial.c b/hw/serial.c index a421d1e..06f7e28 100644 --- a/hw/serial.c +++ b/hw/serial.c @@ -140,6 +140,7 @@ struct SerialState { int baudbase; int tsr_retry; uint32_t wakeup; + WakeupReason reason; uint64_t last_xmit_ts; /* Time when the last byte was successfully sent out of the tsr */ SerialFIFO recv_fifo; @@ -641,7 +642,7 @@ 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); + qemu_system_wakeup_request(s->reason); } if(s->fcr & UART_FCR_FE) { int i; @@ -789,6 +790,13 @@ static int serial_isa_initfn(ISADevice *dev) isa->isairq = isa_serial_irq[isa->index]; index++; + if (isa->iobase == 0x3f8) { + s->reason = QEMU_WAKEUP_REASON_GPE_a; + s->wakeup = 1; + } else { + s->reason = QEMU_WAKEUP_REASON_OTHER; + } + s->baudbase = 115200; isa_init_irq(dev, &s->irq, isa->isairq); serial_init_core(s); -- 1.7.1