[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 17/22] pmu: add adb_autopoll_block() and adb_autopoll_unblock() f
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 17/22] pmu: add adb_autopoll_block() and adb_autopoll_unblock() functions |
Date: |
Sun, 14 Jun 2020 15:28:35 +0100 |
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>
---
hw/misc/macio/pmu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c
index e2291cc9f6..833dea4f71 100644
--- a/hw/misc/macio/pmu.c
+++ b/hw/misc/macio/pmu.c
@@ -515,6 +515,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) {
@@ -576,6 +577,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;
@@ -634,6 +636,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;
}
}
--
2.20.1
- [PATCH 07/22] adb: create autopoll variables directly within ADBBusState, (continued)
- [PATCH 07/22] adb: create autopoll variables directly within ADBBusState, Mark Cave-Ayland, 2020/06/14
- [PATCH 08/22] cuda: convert to use ADBBusState internal autopoll variables, Mark Cave-Ayland, 2020/06/14
- [PATCH 09/22] pmu: convert to use ADBBusState internal autopoll variables, Mark Cave-Ayland, 2020/06/14
- [PATCH 10/22] mac_via: convert to use ADBBusState internal autopoll variables, Mark Cave-Ayland, 2020/06/14
- [PATCH 11/22] adb: introduce new ADBDeviceHasData method to ADBDeviceClass, Mark Cave-Ayland, 2020/06/14
- [PATCH 12/22] adb: keep track of devices with pending data, Mark Cave-Ayland, 2020/06/14
- [PATCH 13/22] adb: add status field for holding information about the last ADB request, Mark Cave-Ayland, 2020/06/14
- [PATCH 14/22] adb: use adb_request() only for explicit requests, Mark Cave-Ayland, 2020/06/14
- [PATCH 15/22] adb: add autopoll_blocked variable to block autopoll, Mark Cave-Ayland, 2020/06/14
- [PATCH 16/22] cuda: add adb_autopoll_block() and adb_autopoll_unblock() functions, Mark Cave-Ayland, 2020/06/14
- [PATCH 17/22] pmu: add adb_autopoll_block() and adb_autopoll_unblock() functions,
Mark Cave-Ayland <=
- [PATCH 18/22] mac_via: move VIA1 portB write logic into mos6522_q800_via1_write(), Mark Cave-Ayland, 2020/06/14
- [PATCH 20/22] adb: only call autopoll callbacks when autopoll is not blocked, Mark Cave-Ayland, 2020/06/14
- [PATCH 19/22] mac_via: rework ADB state machine to be compatible with both MacOS and Linux, Mark Cave-Ayland, 2020/06/14
- [PATCH 21/22] adb: use adb_device prefix for ADB device trace events, Mark Cave-Ayland, 2020/06/14
- [PATCH 22/22] adb: add ADB bus trace events, Mark Cave-Ayland, 2020/06/14