aboutsummaryrefslogtreecommitdiff
path: root/hw/char
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2020-01-23 15:22:41 +0000
committerPeter Maydell <peter.maydell@linaro.org>2020-01-23 16:34:15 +0000
commitc9d3396d80fe7ece9bcc7a688be6f98e4988f0cf (patch)
treef542a43ec1ec0a5a422cd50af883245a4f305d52 /hw/char
parent6804d2301b630ef4e2fe1bdd6e5065875fe6b7e0 (diff)
hw/char/exynos4210_uart: Implement post_load function
After restoring a VM, serial parameters need to be updated to reflect restored register values. Implement a post_load function to handle this situation. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Message-id: 20200123052540.6132-6-linux@roeck-us.net Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/exynos4210_uart.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index b3199df865..6ffbaddfff 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -522,10 +522,20 @@ static void exynos4210_uart_reset(DeviceState *dev)
trace_exynos_uart_rxsize(s->channel, s->rx.size);
}
+static int exynos4210_uart_post_load(void *opaque, int version_id)
+{
+ Exynos4210UartState *s = (Exynos4210UartState *)opaque;
+
+ exynos4210_uart_update_parameters(s);
+
+ return 0;
+}
+
static const VMStateDescription vmstate_exynos4210_uart_fifo = {
.name = "exynos4210.uart.fifo",
.version_id = 1,
.minimum_version_id = 1,
+ .post_load = exynos4210_uart_post_load,
.fields = (VMStateField[]) {
VMSTATE_UINT32(sp, Exynos4210UartFIFO),
VMSTATE_UINT32(rp, Exynos4210UartFIFO),