aboutsummaryrefslogtreecommitdiff
path: root/hw/misc
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2021-08-30 11:24:36 +0100
committerLaurent Vivier <laurent@vivier.eu>2021-09-08 15:37:39 +0200
commit17de3d578710368381b897654e1b7b77f43be875 (patch)
tree0f39280d3821cc541c2302541b4127ba4b04367d /hw/misc
parentabf7aee72ea66944a62962603e4c2381f5e473e7 (diff)
downloadqemu-17de3d578710368381b897654e1b7b77f43be875.zip
qemu-17de3d578710368381b897654e1b7b77f43be875.tar.gz
qemu-17de3d578710368381b897654e1b7b77f43be875.tar.bz2
mac_via: introduce new VMStateDescription for q800 VIA1 and VIA2
Move the parent mos6522 objects from vmstate_mac_via into the new VMStateDescription structures to begin the process of splitting MacVIAState into separate VIA1 and VIA2 devices. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20210830102447.10806-2-mark.cave-ayland@ilande.co.uk> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/misc')
-rw-r--r--hw/misc/mac_via.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c
index ff0156d..46e6505 100644
--- a/hw/misc/mac_via.c
+++ b/hw/misc/mac_via.c
@@ -1083,16 +1083,12 @@ static const VMStateDescription vmstate_mac_via = {
.post_load = mac_via_post_load,
.fields = (VMStateField[]) {
/* VIAs */
- VMSTATE_STRUCT(mos6522_via1.parent_obj, MacVIAState, 0, vmstate_mos6522,
- MOS6522State),
VMSTATE_UINT8(mos6522_via1.last_b, MacVIAState),
VMSTATE_BUFFER(mos6522_via1.PRAM, MacVIAState),
VMSTATE_TIMER_PTR(mos6522_via1.one_second_timer, MacVIAState),
VMSTATE_INT64(mos6522_via1.next_second, MacVIAState),
VMSTATE_TIMER_PTR(mos6522_via1.sixty_hz_timer, MacVIAState),
VMSTATE_INT64(mos6522_via1.next_sixty_hz, MacVIAState),
- VMSTATE_STRUCT(mos6522_via2.parent_obj, MacVIAState, 0, vmstate_mos6522,
- MOS6522State),
/* RTC */
VMSTATE_UINT32(tick_offset, MacVIAState),
VMSTATE_UINT8(data_out, MacVIAState),
@@ -1156,11 +1152,23 @@ static void mos6522_q800_via1_init(Object *obj)
VIA1_IRQ_NB);
}
+static const VMStateDescription vmstate_q800_via1 = {
+ .name = "q800-via1",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_STRUCT(parent_obj, MOS6522Q800VIA1State, 0, vmstate_mos6522,
+ MOS6522State),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static void mos6522_q800_via1_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
dc->reset = mos6522_q800_via1_reset;
+ dc->vmsd = &vmstate_q800_via1;
}
static const TypeInfo mos6522_q800_via1_type_info = {
@@ -1200,12 +1208,24 @@ static void mos6522_q800_via2_init(Object *obj)
VIA2_IRQ_NB);
}
+static const VMStateDescription vmstate_q800_via2 = {
+ .name = "q800-via2",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_STRUCT(parent_obj, MOS6522Q800VIA2State, 0, vmstate_mos6522,
+ MOS6522State),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static void mos6522_q800_via2_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
MOS6522DeviceClass *mdc = MOS6522_CLASS(oc);
dc->reset = mos6522_q800_via2_reset;
+ dc->vmsd = &vmstate_q800_via2;
mdc->portB_write = mos6522_q800_via2_portB_write;
}