aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-03-05 15:55:27 +0000
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-03-09 09:29:10 +0000
commitd0243b094b681ef38c1d277f519eb21f336fd214 (patch)
tree2f69acab98861a839b0c5f10264236613ede9a5c /hw/scsi
parent1e794c51c429c16ba60b30354fd85adee93b4f1e (diff)
downloadqemu-d0243b094b681ef38c1d277f519eb21f336fd214.zip
qemu-d0243b094b681ef38c1d277f519eb21f336fd214.tar.gz
qemu-d0243b094b681ef38c1d277f519eb21f336fd214.tar.bz2
esp: introduce esp_pdma_cb() function
This function is to be used to execute the current PDMA callback rather than dereferencing the ESPState pdma_cb function pointer directly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20220305155530.9265-8-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/scsi')
-rw-r--r--hw/scsi/esp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index d164021..035fb0d 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -200,6 +200,11 @@ static void esp_set_pdma_cb(ESPState *s, void (*cb)(ESPState *))
s->pdma_cb = cb;
}
+static void esp_pdma_cb(ESPState *s)
+{
+ s->pdma_cb(s);
+}
+
static int esp_select(ESPState *s)
{
int target;
@@ -1268,7 +1273,7 @@ static void sysbus_esp_pdma_write(void *opaque, hwaddr addr,
esp_pdma_write(s, val);
break;
}
- s->pdma_cb(s);
+ esp_pdma_cb(s);
}
static uint64_t sysbus_esp_pdma_read(void *opaque, hwaddr addr,
@@ -1290,7 +1295,7 @@ static uint64_t sysbus_esp_pdma_read(void *opaque, hwaddr addr,
break;
}
if (fifo8_num_used(&s->fifo) < 2) {
- s->pdma_cb(s);
+ esp_pdma_cb(s);
}
return val;
}