qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v1 34/43] target/hexagon: Add get_tb_mmu_index()


From: Richard Henderson
Subject: Re: [RFC PATCH v1 34/43] target/hexagon: Add get_tb_mmu_index()
Date: Fri, 22 Nov 2024 12:34:46 -0600
User-agent: Mozilla Thunderbird

On 11/20/24 19:49, Anton Johansson wrote:
Adds a functions to return the current mmu index given tb_flags of the
current translation block.  Required by helper-to-tcg in order to
retrieve the mmu index for memory operations without changing the
signature of helper functions.

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
  target/hexagon/cpu.h | 12 ++++++++++++
  1 file changed, 12 insertions(+)

diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h
index 764f3c38cc..7be4b5769e 100644
--- a/target/hexagon/cpu.h
+++ b/target/hexagon/cpu.h
@@ -153,6 +153,18 @@ static inline void cpu_get_tb_cpu_state(CPUHexagonState 
*env, vaddr *pc,
      }
  }
+// Returns the current mmu index given tb_flags of the current translation
+// block.  Required by helper-to-tcg in order to retrieve the mmu index for
+// memory operations without changing the signature of helper functions.
+static inline int get_tb_mmu_index(uint32_t flags)
+{
+#ifdef CONFIG_USER_ONLY
+    return MMU_USER_IDX;
+#else
+#error System mode not supported on Hexagon yet
+#endif
+}
+
  typedef HexagonCPU ArchCPU;
void hexagon_translate_init(void);

I suggest placing this somewhere other than cpu.h, as it's private to the translator and its generated code.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]