[PATCH 02/32] accel/tcg: Hide in_same_page outside of a target-specific context

Richard Henderson posted 32 patches 1 year, 10 months ago
There is a newer version of this series
[PATCH 02/32] accel/tcg: Hide in_same_page outside of a target-specific context
Posted by Richard Henderson 1 year, 10 months ago
While there are other methods that could be used to replace
TARGET_PAGE_MASK, the function is not really required outside
the context of target-specific translation.

This makes the header usable by target independent code.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 include/exec/translator.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/exec/translator.h b/include/exec/translator.h
index 29804de92e..185ab5c374 100644
--- a/include/exec/translator.h
+++ b/include/exec/translator.h
@@ -230,6 +230,7 @@ translator_ldq_swap(CPUArchState *env, DisasContextBase *db,
  */
 void translator_fake_ldb(uint8_t insn8, vaddr pc);
 
+#ifdef NEED_CPU_H
 /*
  * Return whether addr is on the same page as where disassembly started.
  * Translators can use this to enforce the rule that only single-insn
@@ -239,5 +240,6 @@ static inline bool is_same_page(const DisasContextBase *db, vaddr addr)
 {
     return ((addr ^ db->pc_first) & TARGET_PAGE_MASK) == 0;
 }
+#endif
 
 #endif /* EXEC__TRANSLATOR_H */
-- 
2.34.1
Re: [PATCH 02/32] accel/tcg: Hide in_same_page outside of a target-specific context
Posted by Philippe Mathieu-Daudé 1 year, 10 months ago
On 5/4/24 12:24, Richard Henderson wrote:
> While there are other methods that could be used to replace
> TARGET_PAGE_MASK, the function is not really required outside
> the context of target-specific translation.
> 
> This makes the header usable by target independent code.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   include/exec/translator.h | 2 ++
>   1 file changed, 2 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>