mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
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>
This commit is contained in:
parent
1e794c51c4
commit
d0243b094b
1 changed files with 7 additions and 2 deletions
|
@ -200,6 +200,11 @@ static void esp_set_pdma_cb(ESPState *s, void (*cb)(ESPState *))
|
||||||
s->pdma_cb = cb;
|
s->pdma_cb = cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void esp_pdma_cb(ESPState *s)
|
||||||
|
{
|
||||||
|
s->pdma_cb(s);
|
||||||
|
}
|
||||||
|
|
||||||
static int esp_select(ESPState *s)
|
static int esp_select(ESPState *s)
|
||||||
{
|
{
|
||||||
int target;
|
int target;
|
||||||
|
@ -1268,7 +1273,7 @@ static void sysbus_esp_pdma_write(void *opaque, hwaddr addr,
|
||||||
esp_pdma_write(s, val);
|
esp_pdma_write(s, val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
s->pdma_cb(s);
|
esp_pdma_cb(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t sysbus_esp_pdma_read(void *opaque, hwaddr addr,
|
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;
|
break;
|
||||||
}
|
}
|
||||||
if (fifo8_num_used(&s->fifo) < 2) {
|
if (fifo8_num_used(&s->fifo) < 2) {
|
||||||
s->pdma_cb(s);
|
esp_pdma_cb(s);
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue