Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/sparc: Use cpu_ld*_code_mmu
This passes on the memop as given as argument to
helper_ld_asi to the ultimate load primitive.

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed May 5, 2023
1 parent 316b678 commit 60abd45
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions target/sparc/ldst_helper.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 60abd45

Please sign in to comment.