diff mbox

[08/15] target-mips: Don't use _raw load/store accessors

Message ID 1421334118-3287-9-git-send-email-peter.maydell@linaro.org
State New
Headers show

Commit Message

Peter Maydell Jan. 15, 2015, 3:01 p.m. UTC
Use cpu_*_data instead of the direct *_raw load/store accessors.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-mips/op_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Bennée Jan. 19, 2015, 9:05 a.m. UTC | #1
Peter Maydell <peter.maydell@linaro.org> writes:

> Use cpu_*_data instead of the direct *_raw load/store accessors.

I take it this additional level of (macro) redirection is because at
some point there will be a difference between the various cpu accessors?

>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  target-mips/op_helper.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
> index d619ba4..ea7d95f 100644
> --- a/target-mips/op_helper.c
> +++ b/target-mips/op_helper.c
> @@ -74,7 +74,7 @@ void helper_raise_exception(CPUMIPSState *env, uint32_t exception)
>  static inline type do_##name(CPUMIPSState *env, target_ulong addr,      \
>                               int mem_idx)                               \
>  {                                                                       \
> -    return (type) insn##_raw(addr);                                     \
> +    return (type) cpu_##insn##_data(env, addr);                         \
>  }
>  #else
>  #define HELPER_LD(name, insn, type)                                     \
> @@ -101,7 +101,7 @@ HELPER_LD(ld, ldq, int64_t)
>  static inline void do_##name(CPUMIPSState *env, target_ulong addr,      \
>                               type val, int mem_idx)                     \
>  {                                                                       \
> -    insn##_raw(addr, val);                                              \
> +    cpu_##insn##_data(env, addr, val);                                  \
>  }
>  #else
>  #define HELPER_ST(name, insn, type)                                     \
Peter Maydell Jan. 19, 2015, 10:29 a.m. UTC | #2
On 19 January 2015 at 09:05, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> Peter Maydell <peter.maydell@linaro.org> writes:
>
>> Use cpu_*_data instead of the direct *_raw load/store accessors.
>
> I take it this additional level of (macro) redirection is because at
> some point there will be a difference between the various cpu accessors?

Which additional level of redirection? The point of this patch is
to remove a level of redirection (the _raw accessors), and at
the end of the series cpu_*_data aren't macros.

-- PMM
Alex Bennée Jan. 19, 2015, 3:09 p.m. UTC | #3
Peter Maydell <peter.maydell@linaro.org> writes:

> On 19 January 2015 at 09:05, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>>> Use cpu_*_data instead of the direct *_raw load/store accessors.
>>
>> I take it this additional level of (macro) redirection is because at
>> some point there will be a difference between the various cpu accessors?
>
> Which additional level of redirection? The point of this patch is
> to remove a level of redirection (the _raw accessors), and at
> the end of the series cpu_*_data aren't macros.

Ahh I see. I haven't got that far yet as I'm still working through the
glue() magic in the next few patches ;-)


>
> -- PMM
diff mbox

Patch

diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index d619ba4..ea7d95f 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -74,7 +74,7 @@  void helper_raise_exception(CPUMIPSState *env, uint32_t exception)
 static inline type do_##name(CPUMIPSState *env, target_ulong addr,      \
                              int mem_idx)                               \
 {                                                                       \
-    return (type) insn##_raw(addr);                                     \
+    return (type) cpu_##insn##_data(env, addr);                         \
 }
 #else
 #define HELPER_LD(name, insn, type)                                     \
@@ -101,7 +101,7 @@  HELPER_LD(ld, ldq, int64_t)
 static inline void do_##name(CPUMIPSState *env, target_ulong addr,      \
                              type val, int mem_idx)                     \
 {                                                                       \
-    insn##_raw(addr, val);                                              \
+    cpu_##insn##_data(env, addr, val);                                  \
 }
 #else
 #define HELPER_ST(name, insn, type)                                     \