[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 5/7] hw/char/serial: Make 'wakeup' property boolean
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 5/7] hw/char/serial: Make 'wakeup' property boolean |
Date: |
Sat, 12 Sep 2020 13:40:38 +0200 |
Make the "wakeup" property introduced in commit 9826fd597df
("suspend: make serial ports wakeup the guest") a boolean.
As we want to reuse the generic serial properties in the
ISA model (next commit), expose this property.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/hw/char/serial.h | 2 +-
hw/char/serial-isa.c | 2 +-
hw/char/serial.c | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index 264f529a7f1..09845721384 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -61,7 +61,7 @@ struct SerialState {
uint32_t baudbase;
uint32_t tsr_retry;
guint watch_tag;
- uint32_t wakeup;
+ bool wakeup;
/* Time when the last byte was successfully sent out of the tsr */
uint64_t last_xmit_ts;
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index d4aad81a85c..7e1b36c3f67 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -119,7 +119,7 @@ static Property serial_isa_properties[] = {
DEFINE_PROP_UINT32("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_BOOL("wakeup", ISASerialState, state.wakeup, false),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/char/serial.c b/hw/char/serial.c
index ade4adfd526..ade89fadb44 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -1015,6 +1015,7 @@ static const TypeInfo serial_io_info = {
static Property serial_properties[] = {
DEFINE_PROP_CHR("chardev", SerialState, chr),
DEFINE_PROP_UINT32("baudbase", SerialState, baudbase, 115200),
+ DEFINE_PROP_BOOL("wakeup", SerialState, wakeup, false),
DEFINE_PROP_END_OF_LIST(),
};
--
2.26.2
- [PATCH v2 0/7] hw/char/serial: Housekeeping, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 2/7] hw/char/serial: Replace commented DPRINTF() by trace event, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 1/7] hw/char/serial: Assert serial_ioport_read/write offset fits 8 bytes, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 3/7] hw/char/serial: Remove old DEBUG_SERIAL commented code, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 4/7] hw/char/serial: Rename I/O read/write trace events, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 5/7] hw/char/serial: Make 'wakeup' property boolean,
Philippe Mathieu-Daudé <=
- [PATCH v2 6/7] hw/char/serial: Alias QDEV properties from generic serial object, Philippe Mathieu-Daudé, 2020/09/12
- [PATCH v2 7/7] hw/char/serial: Let SerialState have an 'id' field, Philippe Mathieu-Daudé, 2020/09/12
- Re: [PATCH v2 0/7] hw/char/serial: Housekeeping, no-reply, 2020/09/12
- Re: [PATCH v2 0/7] hw/char/serial: Housekeeping, no-reply, 2020/09/12