[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 34/40] lasips2: update VMStateDescription for LASIPS2 device
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v2 34/40] lasips2: update VMStateDescription for LASIPS2 device |
Date: |
Tue, 12 Jul 2022 22:52:45 +0100 |
Since this series has already introduced a migration break for the HPPA B160L
machine, we can use this opportunity to improve the VMStateDescription for
the LASIPS2 device.
Add the new int_status field to the VMStateDescription and remodel the ports
as separate VMSTATE_STRUCT instances representing each LASIPS2Port. Once this
is done, the migration stream can be updated to include buf and loopback_rbne
for each port (which is necessary since the values are accessed across separate
IO accesses), and drop the port id as this is hardcoded for each port type.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Helge Deller <deller@gmx.de>
Acked-by: Helge Deller <deller@gmx.de>
---
hw/input/lasips2.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c
index e602e3c986..ea7c07a2ba 100644
--- a/hw/input/lasips2.c
+++ b/hw/input/lasips2.c
@@ -35,15 +35,28 @@
#include "qapi/error.h"
+static const VMStateDescription vmstate_lasips2_port = {
+ .name = "lasips2-port",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT8(control, LASIPS2Port),
+ VMSTATE_UINT8(buf, LASIPS2Port),
+ VMSTATE_BOOL(loopback_rbne, LASIPS2Port),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static const VMStateDescription vmstate_lasips2 = {
.name = "lasips2",
- .version_id = 0,
- .minimum_version_id = 0,
+ .version_id = 1,
+ .minimum_version_id = 1,
.fields = (VMStateField[]) {
- VMSTATE_UINT8(kbd_port.parent_obj.control, LASIPS2State),
- VMSTATE_UINT8(kbd_port.parent_obj.id, LASIPS2State),
- VMSTATE_UINT8(mouse_port.parent_obj.control, LASIPS2State),
- VMSTATE_UINT8(mouse_port.parent_obj.id, LASIPS2State),
+ VMSTATE_UINT8(int_status, LASIPS2State),
+ VMSTATE_STRUCT(kbd_port.parent_obj, LASIPS2State, 1,
+ vmstate_lasips2_port, LASIPS2Port),
+ VMSTATE_STRUCT(mouse_port.parent_obj, LASIPS2State, 1,
+ vmstate_lasips2_port, LASIPS2Port),
VMSTATE_END_OF_LIST()
}
};
--
2.30.2
- [PATCH v2 24/40] lasips2: introduce port IRQ and new lasips2_port_init() function, (continued)
- [PATCH v2 24/40] lasips2: introduce port IRQ and new lasips2_port_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 25/40] lasips2: introduce LASIPS2PortDeviceClass for the LASIPS2_PORT device, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 26/40] lasips2: add named input gpio to port for downstream PS2 device IRQ, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 27/40] lasips2: add named input gpio to handle incoming port IRQs, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 28/40] lasips2: switch to using port-based IRQs, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 29/40] lasips2: rename LASIPS2Port parent pointer to lasips2, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 30/40] lasips2: standardise on lp name for LASIPS2Port variables, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 32/40] lasips2: don't use legacy ps2_kbd_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 31/40] lasips2: switch register memory region to DEVICE_BIG_ENDIAN, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 33/40] lasips2: don't use legacy ps2_mouse_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 34/40] lasips2: update VMStateDescription for LASIPS2 device,
Mark Cave-Ayland <=
- [PATCH v2 35/40] pckbd: introduce new vmstate_kbd_mmio VMStateDescription for the I8042_MMIO device, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 36/40] pckbd: don't use legacy ps2_kbd_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 39/40] ps2: remove unused legacy ps2_mouse_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 37/40] ps2: remove unused legacy ps2_kbd_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 38/40] pckbd: don't use legacy ps2_mouse_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 40/40] pckbd: remove legacy i8042_mm_init() function, Mark Cave-Ayland, 2022/07/12
- Re: [PATCH v2 00/40] PS2 device QOMification - part 2, Philippe Mathieu-Daudé, 2022/07/12
- Re: [PATCH v2 00/40] PS2 device QOMification - part 2, Mark Cave-Ayland, 2022/07/18