qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] QOMify sifive_uart model


From: Lukas Jünger
Subject: Re: [PATCH 2/2] QOMify sifive_uart model
Date: Sun, 16 May 2021 13:13:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

On 5/11/21 2:26 PM, Philippe Mathieu-Daudé wrote:
Hi Lukas,

On 5/4/21 5:34 PM, Lukas Jünger wrote:
Signed-off-by: Lukas Jünger <lukas.juenger@greensocs.com>
---
  include/hw/char/sifive_uart.h |  6 +--
  hw/char/sifive_uart.c         | 72 ++++++++++++++++++++++++++++++-----
  2 files changed, 65 insertions(+), 13 deletions(-)
+static void sifive_uart_realize(DeviceState *dev, Error **errp)
+{
+    SiFiveUARTState *s = SIFIVE_UART(dev);
+
+    qemu_chr_fe_set_handlers(&s->chr, uart_can_rx, uart_rx, uart_event,
+                             uart_be_change, s, NULL, true);
+
+}
+
+static void sifive_uart_class_init(ObjectClass *oc, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(oc);
+
+    dc->realize = sifive_uart_realize;
+    device_class_set_props(dc, sifive_uart_properties);
+}
You forgot to add the migration fields (VMState) of the SiFiveUARTState
structure. You might want to convert to the Fifo8 API (like the
SiFiveSPIState does) previous to this patch.

Regards,

Phil.

Thank you for your feedback. If I understand correctly, sifive_spi does not support migration currently. Would it be possible to merge this QOMification without the migration feature for now, as not all devices in sifive_u support it at the moment anyways? It seems it would be difficult to test on my end.

Best regards,

Lukas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]