Commits ab1da85791340e504d10487e1add81b9988afa98,
fdfba1a298ae26dd44bcfdb0429314139a0bc55a,
2c17449b3022ca9623c4a7e2a504a4150ac4ad30 added usages of ENV_GET_CPU()
macro to target-specific code.

Use arm_env_get_cpu() instead and enforce separating variable
declarations.

Cc: Edgar E. Iglesias <edgar.igles...@xilinx.com>
Cc: Peter Maydell <peter.mayd...@linaro.org>
Signed-off-by: Andreas Färber <afaer...@suse.de>
---
 target-arm/helper.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/target-arm/helper.c b/target-arm/helper.c
index c67d680..09b8a32 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -2669,15 +2669,17 @@ void switch_mode(CPUARMState *env, int mode)
 
 static void v7m_push(CPUARMState *env, uint32_t val)
 {
-    CPUState *cs = ENV_GET_CPU(env);
+    CPUState *cs = CPU(arm_env_get_cpu(env));
+
     env->regs[13] -= 4;
     stl_phys(cs->as, env->regs[13], val);
 }
 
 static uint32_t v7m_pop(CPUARMState *env)
 {
-    CPUState *cs = ENV_GET_CPU(env);
+    CPUState *cs = CPU(arm_env_get_cpu(env));
     uint32_t val;
+
     val = ldl_phys(cs->as, env->regs[13]);
     env->regs[13] += 4;
     return val;
@@ -3041,7 +3043,7 @@ static int get_phys_addr_v5(CPUARMState *env, uint32_t 
address, int access_type,
                             int is_user, hwaddr *phys_ptr,
                             int *prot, target_ulong *page_size)
 {
-    CPUState *cs = ENV_GET_CPU(env);
+    CPUState *cs = CPU(arm_env_get_cpu(env));
     int code;
     uint32_t table;
     uint32_t desc;
@@ -3137,7 +3139,7 @@ static int get_phys_addr_v6(CPUARMState *env, uint32_t 
address, int access_type,
                             int is_user, hwaddr *phys_ptr,
                             int *prot, target_ulong *page_size)
 {
-    CPUState *cs = ENV_GET_CPU(env);
+    CPUState *cs = CPU(arm_env_get_cpu(env));
     int code;
     uint32_t table;
     uint32_t desc;
@@ -3260,7 +3262,7 @@ static int get_phys_addr_lpae(CPUARMState *env, uint32_t 
address,
                               hwaddr *phys_ptr, int *prot,
                               target_ulong *page_size_ptr)
 {
-    CPUState *cs = ENV_GET_CPU(env);
+    CPUState *cs = CPU(arm_env_get_cpu(env));
     /* Read an LPAE long-descriptor translation table. */
     MMUFaultType fault_type = translation_fault;
     uint32_t level = 1;
-- 
1.8.4.5


Reply via email to