[PATCH-for-11.0 v3 10/22] target/sh4: Replace cpu_stl_data() call in OCBI helper

Philippe Mathieu-Daudé posted 22 patches 2 days, 13 hours ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Laurent Vivier <laurent@vivier.eu>, Brian Cain <brian.cain@oss.qualcomm.com>, Helge Deller <deller@gmx.de>, Zhao Liu <zhao1.liu@intel.com>, Eduardo Habkost <eduardo@habkost.net>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Chinmay Rath <rathc@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Thomas Huth <thuth@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
[PATCH-for-11.0 v3 10/22] target/sh4: Replace cpu_stl_data() call in OCBI helper
Posted by Philippe Mathieu-Daudé 2 days, 13 hours ago
In preparation of removing the cpu_stl_data() call,
inline it. Set the return address argument.

See commit 852d481faf7 ("SH: Improve movca.l/ocbi
emulation") for more context on this code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/sh4/op_helper.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c
index 557b1bf4972..669bc84cb64 100644
--- a/target/sh4/op_helper.c
+++ b/target/sh4/op_helper.c
@@ -136,6 +136,8 @@ void helper_discard_movcal_backup(CPUSH4State *env)
 
 void helper_ocbi(CPUSH4State *env, uint32_t address)
 {
+    unsigned mmu_idx = cpu_mmu_index(env_cpu(env), false);
+    MemOpIdx oi = make_memop_idx(MO_TE | MO_UL | MO_UNALN, mmu_idx);
     memory_content **current = &(env->movcal_backup);
     while (*current)
     {
@@ -143,7 +145,8 @@ void helper_ocbi(CPUSH4State *env, uint32_t address)
         if ((a & ~0x1F) == (address & ~0x1F))
         {
             memory_content *next = (*current)->next;
-            cpu_stl_data(env, a, (*current)->value);
+
+            cpu_stl_mmu(env, a, (*current)->value, oi, GETPC());
 
             if (next == NULL)
             {
-- 
2.51.0