This involves (re)adding a PDMA-specific subsection to hold the reference to the
current PDMA callback.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/scsi/esp.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index e8b6f25dbb..7998dcfb97 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -1210,6 +1210,25 @@ static int esp_post_load(void *opaque, int version_id)
return 0;
}
+static bool esp_pdma_needed(void *opaque)
+{
+ ESPState *s = ESP(opaque);
+
+ return s->dma_memory_read == NULL && s->dma_memory_write == NULL &&
+ s->dma_enabled;
+}
+
+static const VMStateDescription vmstate_esp_pdma = {
+ .name = "esp/pdma",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .needed = esp_pdma_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT8(pdma_cb, ESPState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
const VMStateDescription vmstate_esp = {
.name = "esp",
.version_id = 6,
@@ -1244,6 +1263,10 @@ const VMStateDescription vmstate_esp = {
VMSTATE_UINT8_TEST(lun, ESPState, esp_is_version_6),
VMSTATE_END_OF_LIST()
},
+ .subsections = (const VMStateDescription * []) {
+ &vmstate_esp_pdma,
+ NULL
+ }
};
static void sysbus_esp_mem_write(void *opaque, hwaddr addr,
--
2.20.1