提交 cf093b07 编写于 作者: M Mark Cave-Ayland

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: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: NFinn Thain <fthain@telegraphics.com.au>
Acked-by: NLaurent Vivier <laurent@vivier.eu>
Message-Id: <20200623204936.24064-18-mark.cave-ayland@ilande.co.uk>
上级 45c9d721
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册