[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/22] adb: introduce realize/unrealize and VMStateDescription for
From: |
Mark Cave-Ayland |
Subject: |
[PULL 06/22] adb: introduce realize/unrealize and VMStateDescription for ADB bus |
Date: |
Fri, 26 Jun 2020 10:23:01 +0100 |
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200623204936.24064-7-mark.cave-ayland@ilande.co.uk>
---
hw/input/adb.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/hw/input/adb.c b/hw/input/adb.c
index d85278a7b7..21a9b3aa96 100644
--- a/hw/input/adb.c
+++ b/hw/input/adb.c
@@ -89,10 +89,42 @@ int adb_poll(ADBBusState *s, uint8_t *obuf, uint16_t
poll_mask)
return olen;
}
+static const VMStateDescription vmstate_adb_bus = {
+ .name = "adb_bus",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_END_OF_LIST()
+ }
+};
+
+static void adb_bus_realize(BusState *qbus, Error **errp)
+{
+ ADBBusState *adb_bus = ADB_BUS(qbus);
+
+ vmstate_register(NULL, -1, &vmstate_adb_bus, adb_bus);
+}
+
+static void adb_bus_unrealize(BusState *qbus)
+{
+ ADBBusState *adb_bus = ADB_BUS(qbus);
+
+ vmstate_unregister(NULL, &vmstate_adb_bus, adb_bus);
+}
+
+static void adb_bus_class_init(ObjectClass *klass, void *data)
+{
+ BusClass *k = BUS_CLASS(klass);
+
+ k->realize = adb_bus_realize;
+ k->unrealize = adb_bus_unrealize;
+}
+
static const TypeInfo adb_bus_type_info = {
.name = TYPE_ADB_BUS,
.parent = TYPE_BUS,
.instance_size = sizeof(ADBBusState),
+ .class_init = adb_bus_class_init,
};
const VMStateDescription vmstate_adb_device = {
--
2.20.1
- [PULL 00/22] qemu-macppc queue 20200626, Mark Cave-Ayland, 2020/06/26
- [PULL 01/22] adb: coding style update to fix checkpatch errors, Mark Cave-Ayland, 2020/06/26
- [PULL 02/22] adb: fix adb-mouse read length and revert disable-reg3-direct-writes workaround, Mark Cave-Ayland, 2020/06/26
- [PULL 03/22] cuda: convert ADB autopoll timer from ns to ms, Mark Cave-Ayland, 2020/06/26
- [PULL 04/22] pmu: fix duplicate autopoll mask variable, Mark Cave-Ayland, 2020/06/26
- [PULL 05/22] pmu: honour autopoll_rate_ms when rearming the ADB autopoll timer, Mark Cave-Ayland, 2020/06/26
- [PULL 06/22] adb: introduce realize/unrealize and VMStateDescription for ADB bus,
Mark Cave-Ayland <=
- [PULL 07/22] adb: create autopoll variables directly within ADBBusState, Mark Cave-Ayland, 2020/06/26
- [PULL 08/22] cuda: convert to use ADBBusState internal autopoll variables, Mark Cave-Ayland, 2020/06/26
- [PULL 09/22] pmu: convert to use ADBBusState internal autopoll variables, Mark Cave-Ayland, 2020/06/26
- [PULL 10/22] mac_via: convert to use ADBBusState internal autopoll variables, Mark Cave-Ayland, 2020/06/26
- [PULL 11/22] adb: introduce new ADBDeviceHasData method to ADBDeviceClass, Mark Cave-Ayland, 2020/06/26
- [PULL 12/22] adb: keep track of devices with pending data, Mark Cave-Ayland, 2020/06/26
- [PULL 13/22] adb: add status field for holding information about the last ADB request, Mark Cave-Ayland, 2020/06/26
- [PULL 14/22] adb: use adb_request() only for explicit requests, Mark Cave-Ayland, 2020/06/26
- [PULL 15/22] adb: add autopoll_blocked variable to block autopoll, Mark Cave-Ayland, 2020/06/26
- [PULL 16/22] cuda: add adb_autopoll_block() and adb_autopoll_unblock() functions, Mark Cave-Ayland, 2020/06/26