On 9/27/22 07:14, Alex Bennée wrote:
This removes the hacks to deal with empty current_cpu.

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
Signed-off-by: Alex Bennée <alex.ben...@linaro.org>

---
v2
   - update for new fields
   - bool asserts
---
  hw/timer/arm_mptimer.c | 25 ++++++++++++++-----------
  1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/hw/timer/arm_mptimer.c b/hw/timer/arm_mptimer.c
index cdfca3000b..34693a2534 100644
--- a/hw/timer/arm_mptimer.c
+++ b/hw/timer/arm_mptimer.c
@@ -41,9 +41,10 @@
   * which is used in both the ARM11MPCore and Cortex-A9MP.
   */
-static inline int get_current_cpu(ARMMPTimerState *s)
+static inline int get_current_cpu(ARMMPTimerState *s, MemTxAttrs attrs)
  {
-    int cpu_id = current_cpu ? current_cpu->cpu_index : 0;
+    int cpu_id = attrs.requester_id;
+    g_assert(attrs.requester_type == MTRT_CPU);

I would guess this needs the same non-assert treatment as the gic.


r~

Reply via email to