@@ -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);
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 <kraxel@redhat.com> --- hw/serial.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)