[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/2] hw/char: sifive_uart
From: |
Peter Maydell |
Subject: |
Re: [PATCH v2 2/2] hw/char: sifive_uart |
Date: |
Sun, 30 May 2021 15:53:16 +0100 |
On Sun, 30 May 2021 at 11:55, Lukas Jünger <lukas.juenger@greensocs.com> wrote:
>
> QOMify sifive_uart model
>
> 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_class_init(ObjectClass *oc, void *data)
> +{
> + DeviceClass *dc = DEVICE_CLASS(oc);
> +
> + dc->realize = sifive_uart_realize;
> + device_class_set_props(dc, sifive_uart_properties);
> +}
> +
> +static const TypeInfo sifive_uart_info = {
> + .name = TYPE_SIFIVE_UART,
> + .parent = TYPE_SYS_BUS_DEVICE,
> + .instance_size = sizeof(SiFiveUARTState),
> + .instance_init = sifive_uart_init,
> + .class_init = sifive_uart_class_init,
> +};
> +
> +static void sifive_uart_register_types(void)
> +{
> + type_register_static(&sifive_uart_info);
> +}
> +
> +type_init(sifive_uart_register_types)
All new QOM devices must implement migration. This is
a baseline requirement so that we always ratchet upwards.
It holds even if not all other devices in the machine
model support migration -- that way we can gradually move
towards actually supporting migration.
You're also missing an implementation of the reset method.
thanks
-- PMM