[PATCH 08/13] target/mips: Let do_translate_address() take MMUAccessType argument

Philippe Mathieu-Daudé posted 13 patches 5 years ago
Maintainers: Jiaxun Yang <jiaxun.yang@flygoat.com>, Aurelien Jarno <aurelien@aurel32.net>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
[PATCH 08/13] target/mips: Let do_translate_address() take MMUAccessType argument
Posted by Philippe Mathieu-Daudé 5 years ago
The single caller, HELPER_LD_ATOMIC(), passes MMUAccessType to
do_translate_address(). Let the prototype use it as argument,
as it is stricter than an integer.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/op_helper.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
index 9fce0194b3e..b80e8f75401 100644
--- a/target/mips/op_helper.c
+++ b/target/mips/op_helper.c
@@ -288,13 +288,14 @@ target_ulong helper_rotx(target_ulong rs, uint32_t shift, uint32_t shiftx,
 #ifndef CONFIG_USER_ONLY
 
 static inline hwaddr do_translate_address(CPUMIPSState *env,
-                                                      target_ulong address,
-                                                      int rw, uintptr_t retaddr)
+                                          target_ulong address,
+                                          MMUAccessType access_type,
+                                          uintptr_t retaddr)
 {
     hwaddr paddr;
     CPUState *cs = env_cpu(env);
 
-    paddr = cpu_mips_translate_address(env, address, rw);
+    paddr = cpu_mips_translate_address(env, address, access_type);
 
     if (paddr == -1LL) {
         cpu_loop_exit_restore(cs, retaddr);
-- 
2.26.2

Re: [PATCH 08/13] target/mips: Let do_translate_address() take MMUAccessType argument
Posted by Jiaxun Yang 5 years ago
在 2021/1/28 下午10:41, Philippe Mathieu-Daudé 写道:
> The single caller, HELPER_LD_ATOMIC(), passes MMUAccessType to
> do_translate_address(). Let the prototype use it as argument,
> as it is stricter than an integer.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

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

> ---
>   target/mips/op_helper.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
> index 9fce0194b3e..b80e8f75401 100644
> --- a/target/mips/op_helper.c
> +++ b/target/mips/op_helper.c
> @@ -288,13 +288,14 @@ target_ulong helper_rotx(target_ulong rs, uint32_t shift, uint32_t shiftx,
>   #ifndef CONFIG_USER_ONLY
>   
>   static inline hwaddr do_translate_address(CPUMIPSState *env,
> -                                                      target_ulong address,
> -                                                      int rw, uintptr_t retaddr)
> +                                          target_ulong address,
> +                                          MMUAccessType access_type,
> +                                          uintptr_t retaddr)
>   {
>       hwaddr paddr;
>       CPUState *cs = env_cpu(env);
>   
> -    paddr = cpu_mips_translate_address(env, address, rw);
> +    paddr = cpu_mips_translate_address(env, address, access_type);
>   
>       if (paddr == -1LL) {
>           cpu_loop_exit_restore(cs, retaddr);