diff mbox series

[14/16] target/sparc: Use cpu_ld*_code_mmu

Message ID 20230502160846.1289975-15-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg: Remove TARGET_ALIGNED_ONLY | expand

Commit Message

Richard Henderson May 2, 2023, 4:08 p.m. UTC
This passes on the memop as given as argument to
helper_ld_asi to the ultimate load primitive.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/sparc/ldst_helper.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Mark Cave-Ayland May 3, 2023, 8:27 p.m. UTC | #1
On 02/05/2023 17:08, Richard Henderson wrote:

> This passes on the memop as given as argument to
> helper_ld_asi to the ultimate load primitive.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/sparc/ldst_helper.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c
> index a53580d9e4..7972d56a72 100644
> --- a/target/sparc/ldst_helper.c
> +++ b/target/sparc/ldst_helper.c
> @@ -593,6 +593,7 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr,
>   #if defined(DEBUG_MXCC) || defined(DEBUG_ASI)
>       uint32_t last_addr = addr;
>   #endif
> +    MemOpIdx oi;
>   
>       do_check_align(env, addr, size - 1, GETPC());
>       switch (asi) {
> @@ -692,19 +693,20 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr,
>       case ASI_M_IODIAG:  /* Turbosparc IOTLB Diagnostic */
>           break;
>       case ASI_KERNELTXT: /* Supervisor code access */
> +        oi = make_memop_idx(memop, cpu_mmu_index(env, true));
>           switch (size) {
>           case 1:
> -            ret = cpu_ldub_code(env, addr);
> +            ret = cpu_ldb_code_mmu(env, addr, oi, GETPC());
>               break;
>           case 2:
> -            ret = cpu_lduw_code(env, addr);
> +            ret = cpu_ldw_code_mmu(env, addr, oi, GETPC());
>               break;
>           default:
>           case 4:
> -            ret = cpu_ldl_code(env, addr);
> +            ret = cpu_ldl_code_mmu(env, addr, oi, GETPC());
>               break;
>           case 8:
> -            ret = cpu_ldq_code(env, addr);
> +            ret = cpu_ldq_code_mmu(env, addr, oi, GETPC());
>               break;
>           }
>           break;

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.
diff mbox series

Patch

diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c
index a53580d9e4..7972d56a72 100644
--- a/target/sparc/ldst_helper.c
+++ b/target/sparc/ldst_helper.c
@@ -593,6 +593,7 @@  uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr,
 #if defined(DEBUG_MXCC) || defined(DEBUG_ASI)
     uint32_t last_addr = addr;
 #endif
+    MemOpIdx oi;
 
     do_check_align(env, addr, size - 1, GETPC());
     switch (asi) {
@@ -692,19 +693,20 @@  uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr,
     case ASI_M_IODIAG:  /* Turbosparc IOTLB Diagnostic */
         break;
     case ASI_KERNELTXT: /* Supervisor code access */
+        oi = make_memop_idx(memop, cpu_mmu_index(env, true));
         switch (size) {
         case 1:
-            ret = cpu_ldub_code(env, addr);
+            ret = cpu_ldb_code_mmu(env, addr, oi, GETPC());
             break;
         case 2:
-            ret = cpu_lduw_code(env, addr);
+            ret = cpu_ldw_code_mmu(env, addr, oi, GETPC());
             break;
         default:
         case 4:
-            ret = cpu_ldl_code(env, addr);
+            ret = cpu_ldl_code_mmu(env, addr, oi, GETPC());
             break;
         case 8:
-            ret = cpu_ldq_code(env, addr);
+            ret = cpu_ldq_code_mmu(env, addr, oi, GETPC());
             break;
         }
         break;