From patchwork Tue Jul 17 12:30:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 171411 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A68592C007B for ; Tue, 17 Jul 2012 22:31:24 +1000 (EST) Received: from localhost ([::1]:38102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr6vy-0001iG-8N for incoming@patchwork.ozlabs.org; Tue, 17 Jul 2012 08:31:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr6vg-0001hz-2S for qemu-devel@nongnu.org; Tue, 17 Jul 2012 08:31:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sr6vY-0007m9-BS for qemu-devel@nongnu.org; Tue, 17 Jul 2012 08:31:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr6vY-0007lb-3g for qemu-devel@nongnu.org; Tue, 17 Jul 2012 08:30:56 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6HCUsPu016820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Jul 2012 08:30:54 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-24.ams2.redhat.com [10.36.116.24]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6HCUrZn021535; Tue, 17 Jul 2012 08:30:54 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 90D0F408C8; Tue, 17 Jul 2012 14:30:52 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org, seabios@seabios.org Date: Tue, 17 Jul 2012 14:30:51 +0200 Message-Id: <1342528252-11470-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1342528252-11470-1-git-send-email-kraxel@redhat.com> References: <1342528252-11470-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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] [rfc patch qemu 3/4] wakeup: make serial configurable 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 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);