aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2020-06-23 21:49:31 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2020-06-26 10:13:52 +0100
commitcf093b0772ad43538ba45c1dececec7113ab3d03 (patch)
tree342b458f6ca966c3b8c50ea6bcd4eec6575915a5 /hw
parent45c9d721ef9ea4e50dbede53bc97922767db70b8 (diff)
downloadqemu-cf093b0772ad43538ba45c1dececec7113ab3d03.zip
qemu-cf093b0772ad43538ba45c1dececec7113ab3d03.tar.gz
qemu-cf093b0772ad43538ba45c1dececec7113ab3d03.tar.bz2
pmu: add adb_autopoll_block() and adb_autopoll_unblock() functions
Ensure that the PMU buffer is protected from autopoll requests overwriting its contents whilst existing PMU requests are in progress. 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-18-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw')
-rw-r--r--hw/misc/macio/pmu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c
index 01d49e6..598d8e7 100644
--- a/hw/misc/macio/pmu.c
+++ b/hw/misc/macio/pmu.c
@@ -517,6 +517,7 @@ static void pmu_update(PMUState *s)
{
MOS6522PMUState *mps = &s->mos6522_pmu;
MOS6522State *ms = MOS6522(mps);
+ ADBBusState *adb_bus = &s->adb_bus;
/* Only react to changes in reg B */
if (ms->b == s->last_b) {
@@ -578,6 +579,7 @@ static void pmu_update(PMUState *s)
s->cmd_rsp_pos = 0;
s->cmd_state = pmu_state_cmd;
+ adb_autopoll_block(adb_bus);
trace_pmu_debug_protocol_cmd(s->cmd, s->cmdlen, s->rsplen);
break;
@@ -636,6 +638,7 @@ static void pmu_update(PMUState *s)
if (s->cmd_state == pmu_state_rsp && s->rsplen == s->cmd_rsp_pos) {
trace_pmu_debug_protocol_cmd_resp_complete(ms->ier);
+ adb_autopoll_unblock(adb_bus);
s->cmd_state = pmu_state_idle;
}
}