diff mbox series

[06/13] target/mips: Replace magic value by MMU_DATA_LOAD definition

Message ID 20210128144125.3696119-7-f4bug@amsat.org
State New
Headers show
Series target/mips: Replace integer by MMUAccessType enum when possible | expand

Commit Message

Philippe Mathieu-Daudé Jan. 28, 2021, 2:41 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/op_helper.c  | 2 +-
 target/mips/tlb_helper.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Jiaxun Yang Feb. 2, 2021, 3:37 a.m. UTC | #1
在 2021/1/28 下午10:41, Philippe Mathieu-Daudé 写道:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>

> ---
>   target/mips/op_helper.c  | 2 +-
>   target/mips/tlb_helper.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
> index 89c7d4556a0..9fce0194b3e 100644
> --- a/target/mips/op_helper.c
> +++ b/target/mips/op_helper.c
> @@ -312,7 +312,7 @@ target_ulong helper_##name(CPUMIPSState *env, target_ulong arg, int mem_idx)  \
>           }                                                                     \
>           do_raise_exception(env, EXCP_AdEL, GETPC());                          \
>       }                                                                         \
> -    env->CP0_LLAddr = do_translate_address(env, arg, 0, GETPC());             \
> +    env->CP0_LLAddr = do_translate_address(env, arg, MMU_DATA_LOAD, GETPC()); \
>       env->lladdr = arg;                                                        \
>       env->llval = do_cast cpu_##insn##_mmuidx_ra(env, arg, mem_idx, GETPC());  \
>       return env->llval;                                                        \
> diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c
> index c9535b7f72f..9216c7a91b3 100644
> --- a/target/mips/tlb_helper.c
> +++ b/target/mips/tlb_helper.c
> @@ -492,7 +492,7 @@ hwaddr mips_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
>       hwaddr phys_addr;
>       int prot;
>   
> -    if (get_physical_address(env, &phys_addr, &prot, addr, 0,
> +    if (get_physical_address(env, &phys_addr, &prot, addr, MMU_DATA_LOAD,
>                                cpu_mmu_index(env, false)) != 0) {
>           return -1;
>       }
diff mbox series

Patch

diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
index 89c7d4556a0..9fce0194b3e 100644
--- a/target/mips/op_helper.c
+++ b/target/mips/op_helper.c
@@ -312,7 +312,7 @@  target_ulong helper_##name(CPUMIPSState *env, target_ulong arg, int mem_idx)  \
         }                                                                     \
         do_raise_exception(env, EXCP_AdEL, GETPC());                          \
     }                                                                         \
-    env->CP0_LLAddr = do_translate_address(env, arg, 0, GETPC());             \
+    env->CP0_LLAddr = do_translate_address(env, arg, MMU_DATA_LOAD, GETPC()); \
     env->lladdr = arg;                                                        \
     env->llval = do_cast cpu_##insn##_mmuidx_ra(env, arg, mem_idx, GETPC());  \
     return env->llval;                                                        \
diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c
index c9535b7f72f..9216c7a91b3 100644
--- a/target/mips/tlb_helper.c
+++ b/target/mips/tlb_helper.c
@@ -492,7 +492,7 @@  hwaddr mips_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     hwaddr phys_addr;
     int prot;
 
-    if (get_physical_address(env, &phys_addr, &prot, addr, 0,
+    if (get_physical_address(env, &phys_addr, &prot, addr, MMU_DATA_LOAD,
                              cpu_mmu_index(env, false)) != 0) {
         return -1;
     }